This is an automated email from the ASF dual-hosted git repository. cmarcum pushed a commit to branch task/geb-testcontainers in repository https://gitbox.apache.org/repos/asf/groovy-geb.git
commit cadf9053a40116c38f4fd3fd76e4b6b3e3f05a93 Author: Carl Marcum <[email protected]> AuthorDate: Thu Feb 26 19:02:45 2026 -0500 rename grails system properties. --- integration/geb-testcontainers/README.md | 30 +++++++++------------- .../geb-testcontainers/geb-testcontainers.gradle | 10 ++++---- .../org/demo/spock/PerTestRecordingSpec.groovy | 2 +- .../grails/plugin/geb/GebContainerSettings.groovy | 26 +++++++++---------- 4 files changed, 31 insertions(+), 37 deletions(-) diff --git a/integration/geb-testcontainers/README.md b/integration/geb-testcontainers/README.md index aad74240..973166f2 100644 --- a/integration/geb-testcontainers/README.md +++ b/integration/geb-testcontainers/README.md @@ -18,12 +18,6 @@ limitations under the License. A library to support using Testcontainers in Apache Geb integration testing. -## Work in Progress (Temporary Section) - -Currently, this library is a work in progress and is not yet ready for production use. - -Work is ongoing to remove some remaining Grails references. - ## Geb Functional Testing using Testcontainers This library integrates [Geb](https://groovy.apache.org/geb/) with [Testcontainers](https://testcontainers.com/) to make it easy to write functional tests for your applications and utilize browsers running in testcontainers and optionally record the browser using a VNC testcontainer and/or capture reporting screenshots and HTML. @@ -95,7 +89,7 @@ The interface `IContainerGebConfiguration` exists as an inheritable version of t To configure reporting, enable it using the `recording` property on the annotation `ContainerGebConfiguration`. The following system properties exist for reporting configuration: -* `grails.geb.reporting.directory` +* `geb.container.reporting.directory` * purpose: if the test enables reporting, the directory to save the reports relative to the project directory * defaults to `build/gebContainer/reports` @@ -106,22 +100,22 @@ By default, no test recording will be performed. Various system properties exis ```groovy tasks.withType(Test).configureEach { useJUnitPlatform() - systemProperty('grails.geb.recording.mode', 'RECORD_ALL') + systemProperty('geb.container.recording.mode', 'RECORD_ALL') } ``` -* `grails.geb.recording.mode` +* `geb.container.recording.mode` * purpose: which tests to record * possible values: `SKIP`, `RECORD_ALL`, or `RECORD_FAILING` * defaults to `SKIP` -* `grails.geb.recording.directory` +* `geb.container.recording.directory` * purpose: the directory to save the recordings relative to the project directory * defaults to `build/gebContainer/recordings` -* `grails.geb.recording.format` +* `geb.container.recording.format` * purpose: sets the format of the recording * possible values are `FLV` or `MP4` * defaults to `MP4` @@ -150,30 +144,30 @@ An Example of this can be seen in [ContainerSupport#createFileInputSource utilit The following system properties exist to configure timeouts: -* `grails.geb.atCheckWaiting.enabled` +* `geb.container.atCheckWaiting.enabled` * purpose: if `at` checks should wait for the page to be in the expected state (uses configured waiting timeout values) * type: boolean * defaults to `false` -* `grails.geb.timeouts.retryInterval` +* `geb.container.timeouts.retryInterval` * purpose: how often to retry waiting operations * type: Number * defaults to `0.1` seconds -* `grails.geb.timeouts.waiting` +* `geb.container.timeouts.waiting` * purpose: amount of time to wait for waiting operations * type: Number * defaults to `5.0` seconds -* `grails.geb.timeouts.implicitlyWait` +* `geb.container.timeouts.implicitlyWait` * purpose: amount of time the driver should wait when searching for an element if it is not immediately present. * type: int * defaults to `0` seconds, which means that if an element is not found, it will immediately return an error. * Warning: Do not mix implicit and explicit waits. Doing so can cause unpredictable wait times. Consult the [Geb](https://groovy.apache.org/geb/manual/current/#implicit-assertions-waiting) and/or [Selenium](https://www.selenium.dev/documentation/webdriver/waits/) documentation for details. -* `grails.geb.timeouts.pageLoad` +* `geb.container.timeouts.pageLoad` * purpose: amount of time to wait for a page load to complete before throwing an error. * type: int * defaults to `300` seconds -* `grails.geb.timeouts.script` +* `geb.container.timeouts.script` * purpose: amount of time to wait for an asynchronous script to finish execution before throwing an error. * type: int * defaults to `30` seconds @@ -184,7 +178,7 @@ Selenium integrates with [OpenTelemetry](https://opentelemetry.io) to support ob 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` +* `geb.container.tracing.enabled` * possible values are `true` or `false` * defaults to `false` diff --git a/integration/geb-testcontainers/geb-testcontainers.gradle b/integration/geb-testcontainers/geb-testcontainers.gradle index 7b288442..daf9739b 100644 --- a/integration/geb-testcontainers/geb-testcontainers.gradle +++ b/integration/geb-testcontainers/geb-testcontainers.gradle @@ -85,7 +85,7 @@ tasks.named('test') { events 'passed', 'skipped', 'failed' } - systemProperty('grails.geb.recording.mode', 'RECORD_ALL') // also RECORD_FAILING + systemProperty('geb.container.recording.mode', 'RECORD_ALL') // also RECORD_FAILING } tasks.register('integrationTest', Test) { @@ -101,8 +101,8 @@ tasks.register('integrationTest', Test) { } systemProperty('geb.env', System.getProperty('geb.env')) - systemProperty('grails.geb.recording.mode', 'RECORD_ALL') // also RECORD_FAILING - // systemProperty('grails.geb.recording.restartPerTest', 'false') // makes all recording the same + systemProperty('geb.container.recording.mode', 'RECORD_ALL') // also RECORD_FAILING + // systemProperty('geb.container.recording.restartPerTest', 'false') // makes all recording the same dependsOn drivers.collect { tasks["${it}Test"] } enabled = false @@ -119,13 +119,13 @@ drivers.eachWithIndex { driver, index -> events 'passed', 'skipped', 'failed' } - systemProperty('grails.geb.recording.mode', 'RECORD_ALL') // also RECORD_FAILING + systemProperty('geb.container.recording.mode', 'RECORD_ALL') // also RECORD_FAILING systemProperty "geb.build.reportsDir", reporting.file("geb/$name") systemProperty "geb.env", driver // Make Geb tests more resilient in slow CI environments if (project.hasProperty('gebAtCheckWaiting')) { - systemProperty('grails.geb.atCheckWaiting.enabled', 'true') + systemProperty('geb.container.atCheckWaiting.enabled', 'true') } if (index > 0) { diff --git a/integration/geb-testcontainers/src/integration-test/groovy/org/demo/spock/PerTestRecordingSpec.groovy b/integration/geb-testcontainers/src/integration-test/groovy/org/demo/spock/PerTestRecordingSpec.groovy index 04eb63fd..9d96125c 100644 --- a/integration/geb-testcontainers/src/integration-test/groovy/org/demo/spock/PerTestRecordingSpec.groovy +++ b/integration/geb-testcontainers/src/integration-test/groovy/org/demo/spock/PerTestRecordingSpec.groovy @@ -44,7 +44,7 @@ class PerTestRecordingSpec extends ContainerGebSpec { when: 'getting the configured base recording directory' // Logic from GebContainerSettings def recordingDirectoryName = System.getProperty( - 'grails.geb.recording.directory', + 'geb.container.recording.directory', 'build/gebContainer/recordings' ) def baseRecordingDir = new File(recordingDirectoryName) diff --git a/integration/geb-testcontainers/src/main/groovy/grails/plugin/geb/GebContainerSettings.groovy b/integration/geb-testcontainers/src/main/groovy/grails/plugin/geb/GebContainerSettings.groovy index 823e9520..6ebc7593 100644 --- a/integration/geb-testcontainers/src/main/groovy/grails/plugin/geb/GebContainerSettings.groovy +++ b/integration/geb-testcontainers/src/main/groovy/grails/plugin/geb/GebContainerSettings.groovy @@ -65,27 +65,27 @@ class GebContainerSettings { Number retryInterval GebContainerSettings(LocalDateTime startTime) { - tracingEnabled = getBooleanProperty('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') - // browserType = System.getProperty('grails.geb.browser.type', DEFAULT_BROWSER_TYPE) + tracingEnabled = getBooleanProperty('geb.container.tracing.enabled', false) + recordingDirectoryName = System.getProperty('geb.container.recording.directory', 'build/gebContainer/recordings') + reportingDirectoryName = System.getProperty('geb.container.reporting.directory', 'build/gebContainer/reports') + // browserType = System.getProperty('geb.container.browser.type', DEFAULT_BROWSER_TYPE) // browserType = System.getProperty('geb.env', DEFAULT_BROWSER_TYPE) recordingMode = VncRecordingMode.valueOf( - System.getProperty('grails.geb.recording.mode', DEFAULT_RECORDING_MODE.name()) + System.getProperty('geb.container.recording.mode', DEFAULT_RECORDING_MODE.name()) ) recordingFormat = VncRecordingFormat.valueOf( - System.getProperty('grails.geb.recording.format', DEFAULT_RECORDING_FORMAT.name()) + System.getProperty('geb.container.recording.format', DEFAULT_RECORDING_FORMAT.name()) ) restartRecordingContainerPerTest = getBooleanProperty( - 'grails.geb.recording.restartRecordingContainerPerTest', + 'geb.container.recording.restartRecordingContainerPerTest', true ) - implicitlyWait = getIntProperty('grails.geb.timeouts.implicitlyWait', DEFAULT_TIMEOUT_IMPLICITLY_WAIT) - pageLoadTimeout = getIntProperty('grails.geb.timeouts.pageLoad', DEFAULT_TIMEOUT_PAGE_LOAD) - scriptTimeout = getIntProperty('grails.geb.timeouts.script', DEFAULT_TIMEOUT_SCRIPT) - atCheckWaiting = getBooleanProperty('grails.geb.atCheckWaiting.enabled', DEFAULT_AT_CHECK_WAITING) - timeout = getNumberProperty('grails.geb.timeouts.timeout', Wait.DEFAULT_TIMEOUT) - retryInterval = getNumberProperty('grails.geb.timeouts.retryInterval', Wait.DEFAULT_RETRY_INTERVAL) + implicitlyWait = getIntProperty('geb.container.timeouts.implicitlyWait', DEFAULT_TIMEOUT_IMPLICITLY_WAIT) + pageLoadTimeout = getIntProperty('geb.container.timeouts.pageLoad', DEFAULT_TIMEOUT_PAGE_LOAD) + scriptTimeout = getIntProperty('geb.container.timeouts.script', DEFAULT_TIMEOUT_SCRIPT) + atCheckWaiting = getBooleanProperty('geb.container.atCheckWaiting.enabled', DEFAULT_AT_CHECK_WAITING) + timeout = getNumberProperty('geb.container.timeouts.timeout', Wait.DEFAULT_TIMEOUT) + retryInterval = getNumberProperty('geb.container.timeouts.retryInterval', Wait.DEFAULT_RETRY_INTERVAL) this.startTime = startTime }
