From 826dfa74c11742a7a6767f45e766e383ddc9ee4f Mon Sep 17 00:00:00 2001 From: Giulio Longfils Date: Wed, 1 Oct 2025 22:12:58 +0200 Subject: [PATCH 1/9] refactor: moving extensionContext out of event payload --- .../github/giulong/spectrum/SpectrumEntity.java | 2 +- .../spectrum/utils/events/EventsDispatcher.java | 4 ++-- .../utils/events/video/VideoConsumer.java | 7 ++----- .../events/video/VideoDynamicConsumer.java | 3 +-- .../web_driver_events/ScreenshotConsumer.java | 3 +-- .../giulong/spectrum/SpectrumEntityTest.java | 2 +- .../utils/events/EventsDispatcherTest.java | 4 ++-- .../utils/events/video/VideoConsumerTest.java | 4 +--- .../events/video/VideoDynamicConsumerTest.java | 17 ++++------------- .../ScreenshotConsumerTest.java | 7 +------ 10 files changed, 16 insertions(+), 37 deletions(-) diff --git a/spectrum/src/main/java/io/github/giulong/spectrum/SpectrumEntity.java b/spectrum/src/main/java/io/github/giulong/spectrum/SpectrumEntity.java index 35213ba4f..64d4af26d 100644 --- a/spectrum/src/main/java/io/github/giulong/spectrum/SpectrumEntity.java +++ b/spectrum/src/main/java/io/github/giulong/spectrum/SpectrumEntity.java @@ -186,7 +186,7 @@ public void addScreenshotToReport(final String msg, final Status status) { final ExtensionContext context = testContext.get(EXTENSION_CONTEXT, ExtensionContext.class); final byte[] screenshot = ((TakesScreenshot) context.getStore(GLOBAL).get(DRIVER, WebDriver.class)).getScreenshotAs(BYTES); - eventsDispatcher.fire(SCREENSHOT, SCREENSHOT, Map.of(EXTENSION_CONTEXT, context, SCREENSHOT, screenshot)); + eventsDispatcher.fire(SCREENSHOT, SCREENSHOT, context, Map.of(SCREENSHOT, screenshot)); final Path path = fileUtils.writeTempFile("screenshot", ".png", screenshot); final Media media = createScreenCaptureFromPath(path.toString()).build(); diff --git a/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/EventsDispatcher.java b/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/EventsDispatcher.java index 8b683cbdc..7add0708f 100644 --- a/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/EventsDispatcher.java +++ b/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/EventsDispatcher.java @@ -55,8 +55,8 @@ public void fire(final String reason, final Set tags, final Result resul fire(null, null, reason, result, tags, null); } - public void fire(final String primaryId, final String reason, final Map payload) { - fire(primaryId, null, reason, null, null, null, payload); + public void fire(final String primaryId, final String reason, final ExtensionContext context, final Map payload) { + fire(primaryId, null, reason, null, null, context, payload); } public void fire(final String primaryId, final String reason) { diff --git a/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/video/VideoConsumer.java b/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/video/VideoConsumer.java index 20ebf22ce..5a623a2c8 100644 --- a/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/video/VideoConsumer.java +++ b/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/video/VideoConsumer.java @@ -19,11 +19,9 @@ import java.nio.file.Path; import java.security.MessageDigest; import java.util.Arrays; -import java.util.Map; import static io.github.giulong.spectrum.SpectrumEntity.HASH_ALGORITHM; import static io.github.giulong.spectrum.extensions.resolvers.DriverResolver.ORIGINAL_DRIVER; -import static io.github.giulong.spectrum.extensions.resolvers.TestContextResolver.EXTENSION_CONTEXT; import static io.github.giulong.spectrum.extensions.resolvers.TestDataResolver.TEST_DATA; import static io.github.giulong.spectrum.utils.web_driver_events.ScreenshotConsumer.SCREENSHOT; import static java.awt.image.BufferedImage.TYPE_INT_RGB; @@ -44,10 +42,9 @@ public VideoConsumer() { @SneakyThrows public void accept(final Event event) { final Video video = configuration.getVideo(); - final Map payload = event.getPayload(); - final ExtensionContext.Store store = ((ExtensionContext) payload.get(EXTENSION_CONTEXT)).getStore(GLOBAL); + final ExtensionContext.Store store = event.getContext().getStore(GLOBAL); final TestData testData = store.get(TEST_DATA, TestData.class); - final byte[] screenshot = (byte[]) payload.get(SCREENSHOT); + final byte[] screenshot = (byte[]) event.getPayload().get(SCREENSHOT); if (video.isSkipDuplicateFrames() && !isNewFrame(screenshot, testData)) { return; diff --git a/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/video/VideoDynamicConsumer.java b/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/video/VideoDynamicConsumer.java index b601ac89c..3fceaa1e8 100644 --- a/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/video/VideoDynamicConsumer.java +++ b/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/video/VideoDynamicConsumer.java @@ -8,7 +8,6 @@ import java.nio.file.Path; -import static io.github.giulong.spectrum.extensions.resolvers.TestContextResolver.EXTENSION_CONTEXT; import static io.github.giulong.spectrum.extensions.resolvers.TestDataResolver.TEST_DATA; import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.GLOBAL; @@ -22,7 +21,7 @@ protected boolean shouldAccept(final Event event) { return false; } - final ExtensionContext context = (ExtensionContext) event.getPayload().get(EXTENSION_CONTEXT); + final ExtensionContext context = event.getContext(); if (context == null) { return false; } diff --git a/spectrum/src/main/java/io/github/giulong/spectrum/utils/web_driver_events/ScreenshotConsumer.java b/spectrum/src/main/java/io/github/giulong/spectrum/utils/web_driver_events/ScreenshotConsumer.java index 5f489e3e3..496ffdffa 100644 --- a/spectrum/src/main/java/io/github/giulong/spectrum/utils/web_driver_events/ScreenshotConsumer.java +++ b/spectrum/src/main/java/io/github/giulong/spectrum/utils/web_driver_events/ScreenshotConsumer.java @@ -13,7 +13,6 @@ import java.util.Map; import static io.github.giulong.spectrum.extensions.resolvers.DriverResolver.DRIVER; -import static io.github.giulong.spectrum.extensions.resolvers.TestContextResolver.EXTENSION_CONTEXT; import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.GLOBAL; import static org.openqa.selenium.OutputType.BYTES; @@ -36,7 +35,7 @@ public void accept(final WebDriverEvent webDriverEvent) { if (video.shouldRecord(frame)) { final byte[] screenshot = ((TakesScreenshot) context.getStore(GLOBAL).get(DRIVER, WebDriver.class)).getScreenshotAs(BYTES); - eventsDispatcher.fire(SCREENSHOT, SCREENSHOT, Map.of(EXTENSION_CONTEXT, context, SCREENSHOT, screenshot)); + eventsDispatcher.fire(SCREENSHOT, SCREENSHOT, context, Map.of(SCREENSHOT, screenshot)); log.trace("Recording frame {} for event '{}'", frame, webDriverEvent.getMessage()); return; diff --git a/spectrum/src/test/java/io/github/giulong/spectrum/SpectrumEntityTest.java b/spectrum/src/test/java/io/github/giulong/spectrum/SpectrumEntityTest.java index 23a527d26..ccbd45348 100644 --- a/spectrum/src/test/java/io/github/giulong/spectrum/SpectrumEntityTest.java +++ b/spectrum/src/test/java/io/github/giulong/spectrum/SpectrumEntityTest.java @@ -325,7 +325,7 @@ void addScreenshotToReport() { assertArrayEquals(bytes, byteArrayArgumentCaptor.getValue()); verify(screenshots).put(path, bytes); - verify(eventsDispatcher).fire(SCREENSHOT, SCREENSHOT, Map.of(EXTENSION_CONTEXT, context, SCREENSHOT, bytes)); + verify(eventsDispatcher).fire(SCREENSHOT, SCREENSHOT, context, Map.of(SCREENSHOT, bytes)); verify(extentTest).log(status, tag, media); verifyNoMoreInteractions(eventsDispatcher); } diff --git a/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/EventsDispatcherTest.java b/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/EventsDispatcherTest.java index 3f7d19183..bff1ac2c0 100644 --- a/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/EventsDispatcherTest.java +++ b/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/EventsDispatcherTest.java @@ -176,11 +176,11 @@ void firePrimaryIdReasonPayload() { when(eventBuilder.reason(reason)).thenReturn(eventBuilder); when(eventBuilder.result(null)).thenReturn(eventBuilder); when(eventBuilder.tags(null)).thenReturn(eventBuilder); - when(eventBuilder.context(null)).thenReturn(eventBuilder); + when(eventBuilder.context(extensionContext)).thenReturn(eventBuilder); when(eventBuilder.payload(payload)).thenReturn(eventBuilder); when(eventBuilder.build()).thenReturn(event); - eventsDispatcher.fire(primaryId, reason, payload); + eventsDispatcher.fire(primaryId, reason, extensionContext, payload); verify(consumer1).match(event); verify(consumer2).match(event); diff --git a/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/video/VideoConsumerTest.java b/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/video/VideoConsumerTest.java index 1ad03bfcf..c338e1a08 100644 --- a/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/video/VideoConsumerTest.java +++ b/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/video/VideoConsumerTest.java @@ -30,7 +30,6 @@ import java.util.stream.Stream; import static io.github.giulong.spectrum.extensions.resolvers.DriverResolver.ORIGINAL_DRIVER; -import static io.github.giulong.spectrum.extensions.resolvers.TestContextResolver.EXTENSION_CONTEXT; import static io.github.giulong.spectrum.extensions.resolvers.TestDataResolver.TEST_DATA; import static io.github.giulong.spectrum.utils.web_driver_events.ScreenshotConsumer.SCREENSHOT; import static java.awt.image.BufferedImage.TYPE_INT_RGB; @@ -376,9 +375,8 @@ void resize() { private void acceptStubs() { when(configuration.getVideo()).thenReturn(video); when(event.getPayload()).thenReturn(payload); - when(payload.get(EXTENSION_CONTEXT)).thenReturn(context); + when(event.getContext()).thenReturn(context); when(context.getStore(GLOBAL)).thenReturn(store); when(store.get(TEST_DATA, TestData.class)).thenReturn(testData); - //when(payload.get(SCREENSHOT)).thenReturn(screenshot); } } diff --git a/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/video/VideoDynamicConsumerTest.java b/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/video/VideoDynamicConsumerTest.java index 87b6c4cd9..79aed546b 100644 --- a/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/video/VideoDynamicConsumerTest.java +++ b/spectrum/src/test/java/io/github/giulong/spectrum/utils/events/video/VideoDynamicConsumerTest.java @@ -16,11 +16,9 @@ import java.nio.file.Path; import java.security.MessageDigest; -import java.util.Map; import static io.github.giulong.spectrum.enums.Result.DISABLED; import static io.github.giulong.spectrum.enums.Result.SUCCESSFUL; -import static io.github.giulong.spectrum.extensions.resolvers.TestContextResolver.EXTENSION_CONTEXT; import static io.github.giulong.spectrum.extensions.resolvers.TestDataResolver.TEST_DATA; import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.GLOBAL; @@ -53,9 +51,6 @@ class VideoDynamicConsumerTest { @Mock private Event event; - @Mock - private Map payload; - @Captor private ArgumentCaptor byteArrayArgumentCaptor; @@ -76,8 +71,7 @@ void shouldAccept() { when(configuration.getVideo()).thenReturn(video); when(video.isDisabled()).thenReturn(false); - when(event.getPayload()).thenReturn(payload); - when(payload.get(EXTENSION_CONTEXT)).thenReturn(context); + when(event.getContext()).thenReturn(context); when(context.getStore(GLOBAL)).thenReturn(store); when(store.get(TEST_DATA, TestData.class)).thenReturn(testData); @@ -103,8 +97,7 @@ void shouldAcceptFalseContextNull() { when(configuration.getVideo()).thenReturn(video); when(video.isDisabled()).thenReturn(false); - when(event.getPayload()).thenReturn(payload); - when(payload.get(EXTENSION_CONTEXT)).thenReturn(null); + when(event.getContext()).thenReturn(null); assertFalse(videoDynamicConsumer.shouldAccept(event)); } @@ -117,8 +110,7 @@ void shouldAcceptFalseTestDataNull() { when(configuration.getVideo()).thenReturn(video); when(video.isDisabled()).thenReturn(false); - when(event.getPayload()).thenReturn(payload); - when(payload.get(EXTENSION_CONTEXT)).thenReturn(context); + when(event.getContext()).thenReturn(context); when(context.getStore(GLOBAL)).thenReturn(store); when(store.get(TEST_DATA, TestData.class)).thenReturn(null); @@ -133,8 +125,7 @@ void shouldAcceptFalseTestDataNotDynamic() { when(configuration.getVideo()).thenReturn(video); when(video.isDisabled()).thenReturn(false); - when(event.getPayload()).thenReturn(payload); - when(payload.get(EXTENSION_CONTEXT)).thenReturn(context); + when(event.getContext()).thenReturn(context); when(context.getStore(GLOBAL)).thenReturn(store); when(store.get(TEST_DATA, TestData.class)).thenReturn(testData); when(testData.isDynamic()).thenReturn(false); diff --git a/spectrum/src/test/java/io/github/giulong/spectrum/utils/web_driver_events/ScreenshotConsumerTest.java b/spectrum/src/test/java/io/github/giulong/spectrum/utils/web_driver_events/ScreenshotConsumerTest.java index 0eb917c39..70279d97b 100644 --- a/spectrum/src/test/java/io/github/giulong/spectrum/utils/web_driver_events/ScreenshotConsumerTest.java +++ b/spectrum/src/test/java/io/github/giulong/spectrum/utils/web_driver_events/ScreenshotConsumerTest.java @@ -1,7 +1,6 @@ package io.github.giulong.spectrum.utils.web_driver_events; import io.github.giulong.spectrum.enums.Frame; -import io.github.giulong.spectrum.utils.ContextManager; import io.github.giulong.spectrum.utils.HtmlUtils; import io.github.giulong.spectrum.utils.Reflections; import io.github.giulong.spectrum.utils.events.EventsDispatcher; @@ -19,7 +18,6 @@ import static io.github.giulong.spectrum.enums.Frame.AUTO_AFTER; import static io.github.giulong.spectrum.extensions.resolvers.DriverResolver.DRIVER; -import static io.github.giulong.spectrum.extensions.resolvers.TestContextResolver.EXTENSION_CONTEXT; import static io.github.giulong.spectrum.utils.web_driver_events.ScreenshotConsumer.SCREENSHOT; import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.GLOBAL; import static org.mockito.ArgumentMatchers.eq; @@ -31,9 +29,6 @@ class ScreenshotConsumerTest { @Mock private HtmlUtils htmlUtils; - @Mock - private ContextManager contextManager; - @Mock private ExtensionContext.Store store; @@ -76,7 +71,7 @@ void accept() { screenshotConsumer.accept(webDriverEvent); - verify(eventsDispatcher).fire(SCREENSHOT, SCREENSHOT, Map.of(EXTENSION_CONTEXT, context, SCREENSHOT, bytes)); + verify(eventsDispatcher).fire(SCREENSHOT, SCREENSHOT, context, Map.of(SCREENSHOT, bytes)); verifyNoMoreInteractions(eventsDispatcher); } From 9abf6474146aa7c8b8a76cf4ab1abd38c93884c7 Mon Sep 17 00:00:00 2001 From: Giulio Longfils Date: Sat, 4 Oct 2025 11:34:34 +0200 Subject: [PATCH 2/9] docs: minor fix in extent report section --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 5436eeec3..63bbf2eb6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1745,7 +1745,7 @@ You can see an example report here: > 💡 **Tip**
> You can provide your own *look and feel* by putting: > * additional css rules in the `src/test/resources/css/report.css` file -> * additional css rules in the `src/test/resources/js/report.js` file +> * additional js functions in the `src/test/resources/js/report.js` file > > Spectrum will automatically load and apply them to the Extent Report. You can also customise the folder and name of the files above > by changing the `extent.css` and `extent.js` keys in your `configuration*.yaml`. This is indeed the default in the internal From c7ff51831fcbb0dd32bbe04e3367d36572d8ac09 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:21:33 +0000 Subject: [PATCH 3/9] build(deps): bump selenium.version from 4.35.0 to 4.36.0 Bumps `selenium.version` from 4.35.0 to 4.36.0. Updates `org.seleniumhq.selenium:selenium-java` from 4.35.0 to 4.36.0 - [Release notes](https://github.com/SeleniumHQ/selenium/releases) - [Commits](https://github.com/SeleniumHQ/selenium/compare/selenium-4.35.0...selenium-4.36.0) Updates `org.seleniumhq.selenium:selenium-grid` from 4.35.0 to 4.36.0 - [Release notes](https://github.com/SeleniumHQ/selenium/releases) - [Commits](https://github.com/SeleniumHQ/selenium/compare/selenium-4.35.0...selenium-4.36.0) --- updated-dependencies: - dependency-name: org.seleniumhq.selenium:selenium-java dependency-version: 4.36.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.seleniumhq.selenium:selenium-grid dependency-version: 4.36.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 64ac62fc7..f5d77f8fb 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 8.12.6 4.38.0 2.0.17 - 4.35.0 + 4.36.0 From 6a69d40ca8bdd04e148a261dad2469a0081ac533 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:21:41 +0000 Subject: [PATCH 4/9] build(deps): bump ch.qos.logback:logback-classic from 1.5.18 to 1.5.19 Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.18 to 1.5.19. - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](https://github.com/qos-ch/logback/compare/v_1.5.18...v_1.5.19) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-version: 1.5.19 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 64ac62fc7..02810558d 100644 --- a/pom.xml +++ b/pom.xml @@ -195,7 +195,7 @@ ch.qos.logback logback-classic - 1.5.18 + 1.5.19 org.codehaus.janino From 99231a4392536fb4aa558f76e36886a0c2fc8459 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:22:26 +0000 Subject: [PATCH 5/9] build(deps): bump org.junit.platform:junit-platform-launcher Bumps [org.junit.platform:junit-platform-launcher](https://github.com/junit-team/junit-framework) from 1.13.4 to 6.0.0. - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/commits/r6.0.0) --- updated-dependencies: - dependency-name: org.junit.platform:junit-platform-launcher dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 64ac62fc7..511c6212a 100644 --- a/pom.xml +++ b/pom.xml @@ -145,7 +145,7 @@ org.junit.platform junit-platform-launcher - 1.13.4 + 6.0.0 From 3e1ca7211ee50f0383f27c74663131f1535a1ed6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:22:47 +0000 Subject: [PATCH 6/9] build(deps): bump org.apache.maven.plugins:maven-enforcer-plugin Bumps [org.apache.maven.plugins:maven-enforcer-plugin](https://github.com/apache/maven-enforcer) from 3.6.1 to 3.6.2. - [Release notes](https://github.com/apache/maven-enforcer/releases) - [Commits](https://github.com/apache/maven-enforcer/compare/enforcer-3.6.1...enforcer-3.6.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-enforcer-plugin dependency-version: 3.6.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 64ac62fc7..33861c41d 100644 --- a/pom.xml +++ b/pom.xml @@ -437,7 +437,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.6.1 + 3.6.2 From 7492dc9ba17cd3111be9728794b939ea51faab52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:24:05 +0000 Subject: [PATCH 7/9] build(deps): bump junit.version from 5.13.4 to 6.0.0 Bumps `junit.version` from 5.13.4 to 6.0.0. Updates `org.junit.jupiter:junit-jupiter-api` from 5.13.4 to 6.0.0 - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.4...r6.0.0) Updates `org.junit.jupiter:junit-jupiter-engine` from 5.13.4 to 6.0.0 - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.4...r6.0.0) Updates `org.junit.jupiter:junit-jupiter-params` from 5.13.4 to 6.0.0 - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.4...r6.0.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-api dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: org.junit.jupiter:junit-jupiter-params dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 64ac62fc7..0cac74416 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ true true - 5.13.4 + 6.0.0 5.20.0 2.20.0 8.12.6 From 5593228bd2161efb80251281c8e59cced6d057d4 Mon Sep 17 00:00:00 2001 From: Giulio Longfils Date: Mon, 6 Oct 2025 21:22:56 +0200 Subject: [PATCH 8/9] build(deps): junit platform leverages the same version variable of other modules --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eb6731030..bd1578a55 100644 --- a/pom.xml +++ b/pom.xml @@ -145,7 +145,7 @@ org.junit.platform junit-platform-launcher - 6.0.0 + ${junit.version} From 59e80c16369684f1685c6b984f8923e695845fce Mon Sep 17 00:00:00 2001 From: Giulio Longfils Date: Mon, 6 Oct 2025 21:23:16 +0200 Subject: [PATCH 9/9] docs: updating references to JUnit 6 --- DEV.md | 2 +- README.md | 4 ++-- docs/README.md | 24 ++++++++++++------------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/DEV.md b/DEV.md index 2927c982d..f7944287a 100644 --- a/DEV.md +++ b/DEV.md @@ -26,7 +26,7 @@ These modules' build will not fail anyway: they will be checked later on by the # Entrypoint Spectrum leverages [SpectrumSessionListener](spectrum/src/main/java/io/github/giulong/spectrum/SpectrumSessionListener.java) as its entrypoint, -which is a [LauncherSessionListener](https://junit.org/junit5/docs/current/user-guide/#launcher-api-launcher-session-listeners-custom) +which is a [LauncherSessionListener](https://docs.junit.org/current/user-guide/#launcher-api-launcher-session-listeners-custom) registered via the Service Loader mechanism. This means we provide its fqdn in the [org.junit.platform.launcher.LauncherSessionListener](spectrum/src/main/resources/org.junit.platform.launcher.LauncherSessionListener) file, which is copied into the `META-INF/services` folder during the `prepare-package` phase. diff --git a/README.md b/README.md index 975833b85..9ff87bcf7 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ # About -Spectrum is an **e2e test automation framework** that leverages **JUnit 5** and **Selenium 4** to provide these features automatically: +Spectrum is an **e2e test automation framework** that leverages **JUnit 6** and **Selenium 4** to provide these features automatically: * **Driver** management * **Auto-waiting** before interacting with elements, to **highly reduce flakiness** @@ -124,7 +124,7 @@ and the [open issues](https://github.com/giulong/spectrum/issues).
Spectrum leverages these projects you should definitely check out!
    -
  • JUnit 5
  • +
  • JUnit 6
  • Selenium
  • Appium
  • Lombok
  • diff --git a/docs/README.md b/docs/README.md index 63bbf2eb6..7c7b91dcc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # Introduction -Spectrum is a [JUnit 5](https://junit.org/junit5/docs/current/user-guide/){:target="_blank"} and [Selenium 4](https://www.selenium.dev/){:target="_blank"} framework that aims to +Spectrum is a [JUnit 6](https://docs.junit.org/current/user-guide/){:target="_blank"} and [Selenium 4](https://www.selenium.dev/){:target="_blank"} framework that aims to simplify the writing of e2e tests, providing these features: * automatic [execution video](#automatic-execution-video-generation) generation @@ -77,7 +77,7 @@ dependencies { ## Test creation -In general, all you need to do is create a **JUnit 5** test class extending the `SpectrumTest` class: +In general, all you need to do is create a **JUnit 6** test class extending the `SpectrumTest` class: {% include copyCode.html %} @@ -1789,7 +1789,7 @@ extent: ``` > ⚠️ **Dynamic Tests**
    -> [Dynamic Tests](https://junit.org/junit5/docs/current/user-guide/#writing-tests-dynamic-tests){:target="_blank"} +> [Dynamic Tests](https://docs.junit.org/current/user-guide/#writing-tests-dynamic-tests){:target="_blank"} > are shown in the html report as a single one in the left column. In the test's details on the right, > you'll see one collapsible nested block for each dynamic test. Additionally, if you enabled video generation, > you'll find the full video attached on top of the right column, as well as the video related to the specific dynamic test @@ -2409,14 +2409,14 @@ use to define the events they want to be notified about. Most of them can be used in consumers with the type of match specified below: -| Field Name | Type | Match | -|-------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|-------| -| [primaryId](#primaryid-and-secondaryid) | String | regex | -| [secondaryId](#primaryid-and-secondaryid) | String | regex | -| [tags](#tags) | Set\ | exact | -| [reason](#reason) | String | regex | -| [result](#result) | [Result]({{ site.repository_url }}/spectrum/src/main/java/io/github/giulong/spectrum/enums/Result.java){:target="_blank"} | exact | -| [context](#context) | [ExtensionContext](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/extension/ExtensionContext.html){:target="_blank"} | - | +| Field Name | Type | Match | +|-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|-------| +| [primaryId](#primaryid-and-secondaryid) | String | regex | +| [secondaryId](#primaryid-and-secondaryid) | String | regex | +| [tags](#tags) | Set\ | exact | +| [reason](#reason) | String | regex | +| [result](#result) | [Result]({{ site.repository_url }}/spectrum/src/main/java/io/github/giulong/spectrum/enums/Result.java){:target="_blank"} | exact | +| [context](#context) | [ExtensionContext](https://docs.junit.org/current/api/org.junit.jupiter.api/org/junit/jupiter/api/extension/ExtensionContext.html){:target="_blank"} | - | Let's see them in detail: @@ -3644,7 +3644,7 @@ testBook: # Parallel Execution Spectrum tests can be run in parallel by leveraging -[JUnit Parallel Execution](https://junit.org/junit5/docs/snapshot/user-guide/#writing-tests-parallel-execution){:target="_blank"} +[JUnit Parallel Execution](https://docs.junit.org/snapshot/user-guide/#writing-tests-parallel-execution){:target="_blank"} ---