Add support for JUnit Jupiter
Highlights
This release adds full JUnit Jupiter support to Selenium Foundation, alongside the existing JUnit 4 and TestNG integrations. Test classes built on JUnit Jupiter now get the same feature set already available under the other two frameworks — automatic retry, artifact capture on failure, and target platform filtering — via a new set of Jupiter-native base classes and extensions.
New base classes, under com.nordstrom.automation.selenium.jupiter:
JupiterBase/JupiterClassBase—PER_METHOD/PER_CLASSlifecycle support, mirroringJUnitBase/TestNgBase's driver and page-object storage strategies.JupiterPlatformBase/JupiterTargetBase— target platform support, the Jupiter-native equivalent ofJUnitPlatformBase/JUnitTargetBase.DriverWatcher— manages the WebDriver session lifecycle around each test invocation, built on Jupiter'sInvocationInterceptorAPI.PageSourceCapture/ScreenshotCapture— on-failure artifact capture, built on Jupiter Foundation'sArtifactCollector.SeleniumRetryExtension— automatic retry with driver-lifecycle handling re-applied on every attempt, extending Jupiter Foundation'sRetryExtension.JupiterGridListener— manages local Selenium Grid startup/shutdown for the whole test run, the Jupiter Platform-native equivalent of the JUnit 4GridWatcher/DriverListenerpair.
New dependency: jupiter-foundation 1.0.0 (-j8 for the selenium3 profile, -j17 for selenium4), providing the underlying JUnit Jupiter retry, artifact capture, and resolved-argument capture mechanisms this integration builds on.
New Gradle task: testJupiter, alongside the existing testNG task, so the Jupiter test suite can be run independently (./gradlew testJupiter) or as part of the full test task.
Bug Fixes
- Fixed a
ThreadLocalcleanup gap in the new JupiterDriverWatcher: setup logic that could throw (driver acquisition, target-platform mismatch skips) previously ran outside thetry/finallyblock responsible for clearing per-invocation state, risking a leakedExtensionContextreference on a reused pooled thread underPER_CLASSlifecycle.
Known Limitations
- This is the first release of the Jupiter integration. While the core lifecycle (driver acquisition, artifact capture, retry, target platform filtering) has been exercised against a live browser session, it has not seen the depth of real-world use the JUnit 4 and TestNG integrations have.
- Most of
JupiterModelTest's coverage is intentionally@Disabled, mirroringJUnitModelTest's own scope — the same underlying page-object-model behavior is exercised via the TestNG suite, and running it three times over was adding significant time to the full build without added value.
Upgrading
No breaking changes for existing JUnit 4 or TestNG users — this release is additive. JUnit Jupiter users can begin extending JupiterBase/JupiterClassBase/JupiterTargetBase directly; see the updated README for usage examples.