Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes preserve defaults, propagate Chrome arguments correctly, and leave no identified blocking issues.
No open issues 🎉
What changed in this PR
Adds per-test Chrome arguments to the test framework, preparing for Device Bound Session Credentials coverage without changing global browser defaults.
Changes:
- Applies annotation arguments after defaults for Chrome and Chrome Headless.
- Prevents driver sharing when requested arguments differ.
- Adds documentation, unit tests, and real-browser coverage.
| File | Description |
|---|---|
test-framework/ui/src/main/java/org/keycloak/testframework/ui/webdriver/HtmlUnitWebDriverSupplier.java |
Disambiguates the null overload call. |
test-framework/ui/src/main/java/org/keycloak/testframework/ui/webdriver/DriverUtils.java |
Forwards extra Chrome arguments. |
test-framework/ui/src/main/java/org/keycloak/testframework/ui/webdriver/DriverOptions.java |
Appends arguments after defaults. |
test-framework/ui/src/main/java/org/keycloak/testframework/ui/webdriver/ChromeWebDriverSupplier.java |
Uses annotation arguments for Chrome. |
test-framework/ui/src/main/java/org/keycloak/testframework/ui/webdriver/ChromeHeadlessWebDriverSupplier.java |
Uses annotation arguments for headless Chrome. |
test-framework/ui/src/main/java/org/keycloak/testframework/ui/webdriver/AbstractWebDriverSupplier.java |
Passes annotations and checks argument compatibility. |
test-framework/ui/src/main/java/org/keycloak/testframework/ui/annotations/InjectWebDriver.java |
Declares the chromeArguments option. |
test-framework/tests/src/test/java/org/keycloak/testframework/ui/webdriver/DriverOptionsTest.java |
Tests argument ordering and unchanged defaults. |
test-framework/tests/src/test/java/org/keycloak/testframework/tests/WebDriverChromeArgumentsTest.java |
Verifies arguments affect a Chrome session. |
test-framework/docs/WRITING_TESTS.md |
Documents usage and driver-sharing behavior. |
Review effort: Balanced
Expose per-test Chrome arguments through the WebDriver injection annotation, apply them to Chrome and Chrome Headless sessions, and keep drivers with different arguments isolated. Closes keycloak#54144 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-Authored-By: OpenAI Codex <noreply@openai.com> Signed-off-by: Andre F de Miranda <trixpan@users.noreply.github.com>
trixpan
force-pushed
the
issue-54144-webdriver-chrome-arguments
branch
from
November 26, 2026 23:03
0483197 to
47c3947
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The added tests do not cover argument-based WebDriver isolation, leaving compatible reuse and prevention of argument leakage unverified for the same ref with equal, different, and empty versus nonempty argument arrays.
1 open issue
Review effort: Balanced
| public boolean compatible(InstanceContext<ManagedWebDriver, InjectWebDriver> a, RequestedInstance<ManagedWebDriver, InjectWebDriver> b) { | ||
| return a.getAnnotation().ref().equals(b.getAnnotation().ref()); | ||
| return a.getAnnotation().ref().equals(b.getAnnotation().ref()) | ||
| && Arrays.equals(a.getAnnotation().chromeArguments(), b.getAnnotation().chromeArguments()); |
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.
Closes #54144
Part of the test-framework preparation for #42257.
Summary
chromeArgumentsto@InjectWebDriver.Chrome-specific arguments are ignored by other browser implementations.
Testing
KC_TEST_BROWSER=chrome-headless ./mvnw package -f test-framework/pom.xml -Dtest=DriverOptionsTest,WebDriverChromeArgumentsTest -DfailIfNoTests=false./mvnw package -f test-framework/pom.xml./mvnw spotless:check -pl test-framework/ui,test-framework/testsAI assistance
This PR was developed with assistance from Claude Opus and OpenAI Codex. I reviewed and understand the submitted changes.