Skip to content

Commit

Permalink
Selenium: change a way for selecting an element from suggestions list (
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Skorik authored Feb 13, 2018
1 parent be99d16 commit 7bb45b6
Showing 1 changed file with 10 additions and 6 deletions.
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);
actionsFactory.createAction(seleniumWebDriver).doubleClick(webElement).perform();
}

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

0 comments on commit 7bb45b6

Please sign in to comment.