Skip to content

Commit

Permalink
Check either clickable or loading
Browse files Browse the repository at this point in the history
  • Loading branch information
jepsar committed Jan 7, 2024
1 parent 2df5406 commit 6038b40
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ void nonAjaxYes(Page page) {
PrimeSelenium.guardHttp(dialog.getYesButton().getRoot()).click();

// Assert
//PrimeSelenium.waitGui().until(PrimeExpectedConditions.visibleInViewport(page.message));
//assertEquals("Full page submitted", page.message.getMessage(0).getDetail());
assertDialog(page, false);
}

Expand All @@ -209,9 +207,8 @@ private void assertDialog(Page page, boolean visible) {
}
}
else {
waitAjaxMinLoadAnimation();
assertClickable(page.confirm);
assertClickable(page.delete);
assertClickableOrLoading(page.confirm);
assertClickableOrLoading(page.delete);
}

assertConfiguration(dialog.getWidgetConfiguration());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ void nonAjaxYes(Page page) {
dialog.getYesButton().click();

// Assert
//PrimeSelenium.waitGui().until(PrimeExpectedConditions.visibleInViewport(page.message));
//assertEquals("Full page submitted", page.message.getMessage(0).getDetail());
assertDialog(page, false);
}

Expand All @@ -209,9 +207,8 @@ private void assertDialog(Page page, boolean visible) {
}
}
else {
waitAjaxMinLoadAnimation();
assertClickable(page.confirm);
assertClickable(page.delete);
assertClickableOrLoading(page.confirm);
assertClickableOrLoading(page.delete);
}

assertConfiguration(dialog.getWidgetConfiguration());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ protected void assertClickable(WebElement element) {
}
}

protected void assertClickableOrLoading(WebElement element) {
if (!PrimeSelenium.isElementClickable(element) && !PrimeSelenium.hasCssClass(element, "ui-state-loading")) {
fail("Element should be clickable or loading!");
}
}

protected void assertNotClickable(WebElement element) {
if (PrimeSelenium.isElementClickable(element)) {
fail("Element should not be clickable!");
Expand Down

0 comments on commit 6038b40

Please sign in to comment.