From 37b81c01e2194cfa0222423531ba9628011ea3d0 Mon Sep 17 00:00:00 2001 From: grails-build Date: Fri, 20 Dec 2024 14:41:42 +0000 Subject: [PATCH 1/4] [skip ci] Release v4.1.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index b99186c..ad37488 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=4.1.1-SNAPSHOT +projectVersion=4.1.1 grailsVersion=6.2.2 gebVersion=6.0 From 5882fd743a1ef7144a01d6a35c34b5c3910e0d2a Mon Sep 17 00:00:00 2001 From: grails-build Date: Fri, 20 Dec 2024 14:54:38 +0000 Subject: [PATCH 2/4] chore: Bump version to 4.1.2-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ad37488..e024849 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=4.1.1 +projectVersion=4.1.2-SNAPSHOT grailsVersion=6.2.2 gebVersion=6.0 From fa6201ffd60930bf975363fe6a0cae0ab07b24e6 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Tue, 24 Dec 2024 23:16:12 +0100 Subject: [PATCH 3/4] Skip Starting Recording Container When Recording Mode is Set to `SKIP` (#118) * fix: disable recording container Closes gh-117 * refactor: set recording mode directly on created container --- .../plugin/geb/WebDriverContainerHolder.groovy | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy index 6ee8a01..de3d367 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy @@ -98,14 +98,11 @@ class WebDriverContainerHolder { } currentConfiguration = specConfiguration - currentContainer = new BrowserWebDriverContainer() - if (grailsGebSettings.recordingEnabled) { - currentContainer = currentContainer.withRecordingMode( - grailsGebSettings.recordingMode, - grailsGebSettings.recordingDirectory, - grailsGebSettings.recordingFormat - ) - } + currentContainer = new BrowserWebDriverContainer().withRecordingMode( + grailsGebSettings.recordingMode, + grailsGebSettings.recordingDirectory, + grailsGebSettings.recordingFormat + ) currentContainer.tap { withAccessToHost(true) start() From 667a075ae619b95ad9cc74d18a959bd6700850ef Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Tue, 24 Dec 2024 23:54:12 +0100 Subject: [PATCH 4/4] Add Setting to Disable Tracing (#120) * fix: add setting to disable tracing Close gh-119 * docs: document `grails.geb.tracing.enabled` setting --- README.md | 12 ++++++++++++ .../grails/plugin/geb/GrailsGebSettings.groovy | 2 ++ .../plugin/geb/WebDriverContainerHolder.groovy | 1 + 3 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 5c3a0e6..e347860 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,18 @@ By default, no test recording will be performed. Here are the system properties * possible values are `FLV` or `MP4` * defaults to `MP4` +#### Observability and Tracing +Selenium integrates with [OpenTelemetry](https://opentelemetry.io) to support observability and tracing out of the box. By default, Selenium [enables tracing](https://www.selenium.dev/blog/2021/selenium-4-observability). + +This plugin, however, **disables tracing by default** since most setups lack an OpenTelemetry collector to process the traces. + +To enable tracing, set the following system property: +* `grails.geb.tracing.enabled` + * possible values are `true` or `false` + * defaults to `false` + +This allows you to opt in to tracing when an OpenTelemetry collector is available. + ### GebSpec If you choose to extend `GebSpec`, you will need to have a [Selenium WebDriver](https://www.selenium.dev/documentation/webdriver/browsers/) installed that matches a browser you have installed on your system. diff --git a/src/testFixtures/groovy/grails/plugin/geb/GrailsGebSettings.groovy b/src/testFixtures/groovy/grails/plugin/geb/GrailsGebSettings.groovy index 264126d..606ba1c 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/GrailsGebSettings.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/GrailsGebSettings.groovy @@ -38,6 +38,7 @@ class GrailsGebSettings { private static VncRecordingMode DEFAULT_RECORDING_MODE = VncRecordingMode.SKIP private static VncRecordingFormat DEFAULT_RECORDING_FORMAT = VncRecordingFormat.MP4 + String tracingEnabled String recordingDirectoryName String reportingDirectoryName VncRecordingMode recordingMode @@ -45,6 +46,7 @@ class GrailsGebSettings { LocalDateTime startTime GrailsGebSettings(LocalDateTime startTime) { + tracingEnabled = System.getProperty('grails.geb.tracing.enabled', 'false') recordingDirectoryName = System.getProperty('grails.geb.recording.directory', 'build/gebContainer/recordings') reportingDirectoryName = System.getProperty('grails.geb.reporting.directory', 'build/gebContainer/reports') recordingMode = VncRecordingMode.valueOf( diff --git a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy index de3d367..a287f1b 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy @@ -104,6 +104,7 @@ class WebDriverContainerHolder { grailsGebSettings.recordingFormat ) currentContainer.tap { + withEnv('SE_ENABLE_TRACING', grailsGebSettings.tracingEnabled) withAccessToHost(true) start() }