This is an automated email from the ASF dual-hosted git repository. thiagohp pushed a commit to branch better-page-invalidation in repository https://gitbox.apache.org/repos/asf/tapestry-5.git
The following commit(s) were added to refs/heads/better-page-invalidation by this push: new 8a01c3e3c More test code improving (or workaround-ing) 8a01c3e3c is described below commit 8a01c3e3c00b4995e9d6ce96f7a261b8a653862f Author: Thiago H. de Paula Figueiredo <thi...@arsmachina.com.br> AuthorDate: Sat May 13 16:47:44 2023 -0300 More test code improving (or workaround-ing) --- .../tapestry5/integration/app1/BeanEditorTests.java | 4 +++- .../org/apache/tapestry5/test/SeleniumTestCase.java | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java index e403ff3ef..e4b99bf0c 100644 --- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java +++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java @@ -151,9 +151,11 @@ public class BeanEditorTests extends App1TestCase * TAPESTRY-1869 */ @Test - public void null_fields_and_bean_editor() + public void null_fields_and_bean_editor() throws InterruptedException { openLinks("Number BeanEditor Demo"); + + Thread.sleep(2000);// Another of that weird sitations ... clickAndWait(SUBMIT); diff --git a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java index ccd1bbb0e..58d19082a 100644 --- a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java +++ b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java @@ -1692,6 +1692,10 @@ public abstract class SeleniumTestCase extends Assert implements Selenium { openBaseURL(); + if (getTitle().toLowerCase().contains("service unavailable")) { + throw new RuntimeException("Webapp didn't start correctly. HTML contents: " + getHtmlSource()); + } + // Trying to solve some cases where the link is present on the page but somehow // openBaseURL() couldn't find it. if (linkText.length > 0) @@ -1707,12 +1711,17 @@ public abstract class SeleniumTestCase extends Assert implements Selenium } } - if (getTitle().toLowerCase().contains("service unavailable")) { - throw new RuntimeException("Webapp didn't start correctly. HTML contents: " + getHtmlSource()); - } - for (String text : linkText) { + try + { + waitForCondition(ExpectedConditions.presenceOfElementLocated(By.linkText(text)), 3); + } + catch (org.openqa.selenium.TimeoutException e) + { + LOGGER.warn("Page content: {}", getHtmlSource()); + throw e; + } clickAndWait("link=" + text); } }