rework selectItemInFileStructure and selectItemInFileStructureByDoubleClick methods in the FileStructure page-object (#7961)

6.19.x
Igor Ohrimenko 2017-12-19 17:18:03 +02:00 committed by GitHub
parent b4ba12302a
commit 434e3f033d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 15 deletions

View File

@ -112,12 +112,8 @@ public class FileStructure {
loader.waitOnClosed();
new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
.until(
new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver driver) {
return getTextFromFileStructurePanel().contains(expText);
}
});
(ExpectedCondition<Boolean>)
driver -> getTextFromFileStructurePanel().contains(expText));
}
/**
@ -165,12 +161,12 @@ public class FileStructure {
* @param item is the name of the item
*/
public void selectItemInFileStructureByDoubleClick(String item) {
WebElement fileStructureItem =
new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
.until(
visibilityOfElementLocated(By.xpath(format(Locators.FILE_STRUCTURE_ITEM, item))));
fileStructureItem.click();
actionsFactory.createAction(seleniumWebDriver).doubleClick(fileStructureItem).perform();
selectItemInFileStructure(item);
actionsFactory
.createAction(seleniumWebDriver)
.moveToElement(getFileStructureItem(item))
.doubleClick()
.perform();
}
/**
@ -189,9 +185,16 @@ public class FileStructure {
* @param item is the name of the item
*/
public void selectItemInFileStructure(String item) {
new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
.until(visibilityOfElementLocated(By.xpath(format(Locators.FILE_STRUCTURE_ITEM, item))))
.click();
actionsFactory
.createAction(seleniumWebDriver)
.moveToElement(getFileStructureItem(item))
.click()
.perform();
}
private WebElement getFileStructureItem(String item) {
return new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
.until(visibilityOfElementLocated(By.xpath(format(Locators.FILE_STRUCTURE_ITEM, item))));
}
/**