diff --git a/primefaces-integration-tests/src/test/java/org/primefaces/integrationtests/confirmdialog/ConfirmDialog001Test.java b/primefaces-integration-tests/src/test/java/org/primefaces/integrationtests/confirmdialog/ConfirmDialog001Test.java index bb1c50c552..c6aedae9e0 100644 --- a/primefaces-integration-tests/src/test/java/org/primefaces/integrationtests/confirmdialog/ConfirmDialog001Test.java +++ b/primefaces-integration-tests/src/test/java/org/primefaces/integrationtests/confirmdialog/ConfirmDialog001Test.java @@ -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); } @@ -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()); diff --git a/primefaces-integration-tests/src/test/java/org/primefaces/integrationtests/confirmdialog/ConfirmDialog002Test.java b/primefaces-integration-tests/src/test/java/org/primefaces/integrationtests/confirmdialog/ConfirmDialog002Test.java index 3d1be58fd4..d9036a2a10 100644 --- a/primefaces-integration-tests/src/test/java/org/primefaces/integrationtests/confirmdialog/ConfirmDialog002Test.java +++ b/primefaces-integration-tests/src/test/java/org/primefaces/integrationtests/confirmdialog/ConfirmDialog002Test.java @@ -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); } @@ -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()); diff --git a/primefaces-selenium/primefaces-selenium-core/src/main/java/org/primefaces/selenium/AbstractPrimePageTest.java b/primefaces-selenium/primefaces-selenium-core/src/main/java/org/primefaces/selenium/AbstractPrimePageTest.java index 43b33fa1a1..224b2571ec 100644 --- a/primefaces-selenium/primefaces-selenium-core/src/main/java/org/primefaces/selenium/AbstractPrimePageTest.java +++ b/primefaces-selenium/primefaces-selenium-core/src/main/java/org/primefaces/selenium/AbstractPrimePageTest.java @@ -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!");