Skip to content

Commit

Permalink
Fix wait for item upload
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
helkv committed Sep 6, 2019
1 parent 5bfa6fb commit a36a45a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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']")
Expand Down
2 changes: 2 additions & 0 deletions src/spot/pages/CollectionEntryPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a36a45a

Please sign in to comment.