From a36a45aa3862b42241a15e96bc758f8ce9433bb4 Mon Sep 17 00:00:00 2001 From: helkv Date: Fri, 6 Sep 2019 10:34:33 +0200 Subject: [PATCH] Fix wait for item upload - Add additional wait for element to be clickable after waiting for the Ajax reload when uploading an item in CollectionEntryPage - Replace xpath selector 'descendant::' by '//' in ConfigurationAutosuggestionPanel --- .../configuration/ConfigurationAutosuggestionPanel.java | 2 +- src/spot/pages/CollectionEntryPage.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/spot/components/configuration/ConfigurationAutosuggestionPanel.java b/src/spot/components/configuration/ConfigurationAutosuggestionPanel.java index 257797a..6703b01 100644 --- a/src/spot/components/configuration/ConfigurationAutosuggestionPanel.java +++ b/src/spot/components/configuration/ConfigurationAutosuggestionPanel.java @@ -11,7 +11,7 @@ public class ConfigurationAutosuggestionPanel extends BasePage { - @FindBy(xpath = "//div[@class='imj_adminPanel']/descendant::h2[contains(text(),'Automatic suggestion')]") + @FindBy(xpath = "//div[@class='imj_adminPanel']//h2[contains(text(),'Automatic suggestion')]") private WebElement autosuggestionPanelReveal; @FindBy(xpath = "//h2[contains(text(),'Automatic suggestion')]/../following-sibling::div[@class='imj_content']") diff --git a/src/spot/pages/CollectionEntryPage.java b/src/spot/pages/CollectionEntryPage.java index 8c1b478..105d6c7 100644 --- a/src/spot/pages/CollectionEntryPage.java +++ b/src/spot/pages/CollectionEntryPage.java @@ -448,6 +448,8 @@ public CollectionEntryPage uploadFile(String filepath) { upload.uploadFiles(filepath); SeleniumWrapper.waitForAjaxLoad(wait, elementToBecomeReloaded); + //Wait until loaderWrapper (which is shown after the Ajax reload) is not visible anymore, by waiting if uploadButton is clickable. + wait.until(ExpectedConditions.elementToBeClickable(uploadButton)); return PageFactory.initElements(driver, CollectionEntryPage.class); }