Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium: change a way for selecting an element from suggestions list #8736

Merged
merged 1 commit into from
Feb 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package org.eclipse.che.selenium.pageobject;

import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.LOAD_PAGE_TIMEOUT_SEC;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.REDRAW_UI_ELEMENTS_TIMEOUT_SEC;
import static org.openqa.selenium.Keys.ALT;
Expand Down Expand Up @@ -153,12 +154,15 @@ public void selectFileByFullName(String pathName) {
* @param nameOfFile name of a file for searching
*/
public void selectFileByName(String nameOfFile) {
new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
.until(
visibilityOfElementLocated(
By.xpath(format(Locators.FILE_NAME_LIST_SELECT, nameOfFile))))
.click();
actionsFactory.createAction(seleniumWebDriver).doubleClick().perform();
WebElement webElement =
new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
.until(
visibilityOfElementLocated(
By.xpath(format(Locators.FILE_NAME_LIST_SELECT, nameOfFile))));

webElement.click();
WaitUtils.sleepQuietly(500, MILLISECONDS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add comment to explain why we should wait so long here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is timeout between selecting element and double click on it. 0.5 sec is not so long.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right.

actionsFactory.createAction(seleniumWebDriver).doubleClick(webElement).perform();
}

/** close the Navigate to file widget by 'Escape' key and wait closing of the widget */
Expand Down