This is an automated email from the ASF dual-hosted git repository. reiern70 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/wicket.git
commit f10ecbed58250bd19a75ffb95420d311fa92ce47 Author: reiern70 <[email protected]> AuthorDate: Fri Oct 2 09:58:16 2026 -0500 Click through the veil like a user in the veil Selenium test theVeilSwallowsClicks expected WebElement.click() on a veiled link to throw ElementClickInterceptedException. Current ChromeDriver does not throw: it waits until nothing covers the element any more, then clicks it. The click therefore landed after the veil came down, sent a second request, and the test failed on both engines although the veil does swallow clicks. It only showed when the test was run, which needs -Dwicket.selenium=true. The test now clicks at the link's position with the Actions API, as a user would, and checks that the click had no effect. --- .../wicket/examples/ajax/builtin/VeilPageSeleniumTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wicket-examples/src/test/java/org/apache/wicket/examples/ajax/builtin/VeilPageSeleniumTest.java b/wicket-examples/src/test/java/org/apache/wicket/examples/ajax/builtin/VeilPageSeleniumTest.java index 424f5d624d..d114cb5b38 100644 --- a/wicket-examples/src/test/java/org/apache/wicket/examples/ajax/builtin/VeilPageSeleniumTest.java +++ b/wicket-examples/src/test/java/org/apache/wicket/examples/ajax/builtin/VeilPageSeleniumTest.java @@ -18,7 +18,6 @@ package org.apache.wicket.examples.ajax.builtin; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.Duration; @@ -34,12 +33,12 @@ import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.openqa.selenium.By; -import org.openqa.selenium.ElementClickInterceptedException; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; +import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; @@ -198,11 +197,12 @@ class VeilPageSeleniumTest extends JettyTestCaseDecorator click("Slow request"); wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(PAGE_VEIL))); + WebElement fastRequest = driver.findElement(By.linkText("Fast request")); @SuppressWarnings("unchecked") - Map<String, Object> hit = (Map<String, Object>)js().executeScript(HIT_TEST, - driver.findElement(By.linkText("Fast request"))); + Map<String, Object> hit = (Map<String, Object>)js().executeScript(HIT_TEST, fastRequest); assertEquals(Boolean.TRUE, hit.get("veiled"), "the veil does not cover the link: " + hit); - assertThrows(ElementClickInterceptedException.class, () -> click("Fast request")); + // WebElement.click() would wait for the veil to come down before clicking + new Actions(driver).moveToElement(fastRequest).click().perform(); awaitPageCounter("1"); awaitNoVeil();
