Repository navigation
test: run JUnit 6 browser ITs on the Selenium hub when test.use.hub is set (#27590) (CP: 25.4) - #27684
Conversation
…s set (#27590) (CP: 25.4) Follow-up to #27547 **build failure** · flow-tests · the nightly dev loop build on bender.vaadin.com The first nightly dev loop builds on bender failed in every browser IT: the tests started the Chrome installed on the agent, Chrome 115, which Vaadin no longer supports, so each test timed out on the "your browser is not supported" page. With this change the JUnit 6 browser ITs use the Selenium hub on bender, the same as the JUnit 4 tests already do. **Risks:** - 🔒 The dev loop test applications accept dev tools connections from any host, not only localhost. Test fixtures in dev mode only; nothing outside `flow-tests/test-devloop` changes. - ✅ Without `-Dtest.use.hub=true` the tests still start a local Chrome on `localhost`, so GitHub Actions runs are unchanged. **Context.** The JUnit 4 base class goes to the hub when `test.use.hub` is set and opens the application by the agent's IP address; the JUnit 6 base class always started a local Chrome. Flow only lets dev tools connect from localhost, and the dev loop browser ITs need dev tools to bring an applied change into the open page, so a browser on the hub needs `devmode.hostsAllowed`. - `AbstractBrowserIT` in `flow-test-util-junit6` creates a `RemoteWebDriver` on the hub named by `com.vaadin.testbench.Parameters.hubHostname` when `test.use.hub` is set, and builds the root URL from the new `getDeploymentHostname()`: the site local address on the hub, `localhost` otherwise - `DevLoopBrowserIT`, `DevLoopSpringStatisticsIT` and `AbstractCspStrictIT` open the application by that host name instead of a fixed `localhost` - Every dev loop fixture passes `vaadin.devmode.hostsAllowed=*` to its server, the same way it already passes `vaadin.contentSecurityPolicy`; the Spring Boot fixture sets it in `application.properties` - The value is a pom property and not a `-D` on the build, because the `vaadin-dev` daemon starts the server through a Maven run of its own --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The browser driver and the URL it opens now resolve to the same hostflowchart LR
subgraph Before
direction TB
B1["createDriver()"] --> B2["ChromeDriver, local"]
B3["getRootURL()"] --> B4["http localhost:PORT"]
end
subgraph After
direction TB
A1["createDriver()"] -->|"USE_HUB true"| A2["RemoteWebDriver on hub (new)"]:::changed
A1 -->|"USE_HUB false"| A3["ChromeDriver, local"]
A4["getDeploymentHostname() (new)"]:::changed --> A5["getRootURL() / rootUrl()"]
A2 -.->|"same host"| A4
A3 -.->|"localhost"| A4
end
Before ~~~ After
classDef changed stroke:#c9a227,stroke-width:3px
Previously Diagram Bot draws the mechanism this pull request touches; it does not review the change. Verify it against the diff.
|
|
This PR is eligible for auto-merging policy, so it has been approved automatically. If there are pending conditions, auto merge (with 'squash' method) has been enabled for this PR [Message is sent from bot] |
|



This PR cherry-picks changes from the original PR #27590 to branch 25.4.