Repository navigation
Forge: Fix the local-browser Geb feature and rename it to geb-with-local-browsers - #16382
Merged
Merged
Conversation
matrei
force-pushed
the
fix/forge-geb-local-browsers
branch
from
September 23, 2026 10:23
616df20 to
fc10733
Compare
matrei
marked this pull request as ready for review
September 23, 2026 10:24
matrei
force-pushed
the
fix/forge-geb-local-browsers
branch
from
September 23, 2026 10:38
fc10733 to
7b1bf1b
Compare
matrei
marked this pull request as draft
September 23, 2026 10:39
…al-browsers Apps generated with geb-with-webdriver-binaries failed to evaluate build.gradle because the webdriverBinaries block used the pre-4.x String syntax of the org.ysb33r.webdriver-binaries plugin. Version 4.x also no longer connects itself to test tasks, and its driver metadata lags behind current browsers, so the plugin is dropped and Selenium Manager provides the matching drivers. - Rename the feature to geb-with-local-browsers - Pass -Dgeb.env from the Gradle invocation to the test tasks - Make it replace geb-with-testcontainers and generate a GebSpec - Document both Geb features in the functional testing guide Fixes apache#16381
matrei
force-pushed
the
fix/forge-geb-local-browsers
branch
from
September 23, 2026 11:02
7b1bf1b to
95b71b9
Compare
matrei
marked this pull request as ready for review
September 23, 2026 11:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16381
Summary
Apps generated with the
geb-with-webdriver-binariesfeature don't build. The feature appliesorg.ysb33r.webdriver-binaries4.0.0, but the generatedwebdriverBinariesblock still uses the pre-4.x String syntax:Fixing the DSL alone wouldn't make the plugin do anything:
Testtasks by itself, so the drivers never reach the test JVM.useLatestVersion()doesn't help either. Once connected to the test tasks, the plugin would supply ChromeDriver and EdgeDriver versions older than current browsers, and they would take priority over Selenium Manager.Selenium Manager (part of Selenium since 4.6) already downloads the driver that matches the installed browser. That's also why local-browser tests run today, even though the plugin isn't connected to anything.
The feature had two more problems:
GebConfig.groovysays to run./gradlew -Dgeb.env=firefoxHeadless iT, but Gradle never passedgeb.envto the forked test JVM, so the setting was ignored and tests always ran with the default browser.geb-with-testcontainersis a default feature, so it was always added alongsidegeb-with-webdriver-binaries. The generated spec extendedContainerGebSpec, which runs the browser in a Testcontainers container. It readsGebConfig.groovy, but expects thedriverthere to create aRemoteWebDriverconnected to the container. The generated environments create local drivers instead, so they only went unused becausegeb.envnever reached the test JVM.Changes
org.ysb33r.webdriver-binariesplugin, and its version entry in the forgepom.xml, from the feature. Selenium Manager now provides the drivers.geb-with-webdriver-binariestogeb-with-local-browsers, since it no longer uses the webdriver-binaries plugin.create-app --features geb-with-webdriver-binariesand Forge links that use the old name now fail with "The requested feature does not exist". The old name has generated a build that fails to evaluate ever since the switch to webdriver-binaries 4.0.0, so no working setup depends on it. Existinggrails-forge-cli.ymlfiles that list the old name are unaffected, because the CLI never looks those names up.geb.envfrom the Gradle invocation to allTesttasks when the feature is selected. This replaces the unusedfeatures.contains("geb")block inbuildGradle.rocker.raw, because no feature is namedgeb.GebFeatureone-of group forgeb-with-testcontainersandgeb-with-local-browsers. Selectinggeb-with-local-browsersnow replaces the Testcontainers default, and selecting both explicitly fails validation.geb-with-local-browsers, the generated functional spec extendsgeb.spock.GebSpec. The feature now addsgrails-gebtest fixtures itself, which provideGebSpecand the Chrome driver bindings.ContainerGebSpectemplate fromspock.rocker.rawtocontainerGebSpec.rocker.raw, next to the newgebSpec.rocker.raw. The old name dates from when Forge picked test templates by test framework.groovyJunit.rocker.rawtemplate, a Micronaut JUnit test left over from when Forge offered a choice of test framework. Nothing has referenced it since the test-framework option was removed.Testing
GebWithLocalBrowsersSpec(forge-core): no webdriver-binaries plugin or extension in the build,geb.envpassthrough,GebSpecfor web and web-plugin apps, replaces the Testcontainers default, and fails when combined with it.GebWithTestcontainersSpec(forge-core):ContainerGebSpecis generated,geb.envisn't added, and the feature is a default for web apps only.test-coreGebWithLocalBrowsersSpec: generates a web app with the feature and runsbuild compileIntegrationTestGroovy -x integrationTeston the generated project.integrationTest -Dgeb.env=firefoxHeadlesson a generated app.-Dgeb.env=firefoxHeadlessreached the test JVM and the generatedGebSpecpassed against a local Firefox.