rework selectItemInFileStructure and selectItemInFileStructureByDoubleClick methods in the FileStructure page-object (#7961)
parent
b4ba12302a
commit
434e3f033d
|
|
@ -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))));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue