Conversation
A browserless test can now set Vaadin application properties, feature flags, and Lookup services for a single test class or test method with @BrowserlessTestConfig, or build the same configuration in code. The settings are scoped to the environment created for that test, so a feature flag no longer needs development mode, a properties file in the project folder, or a @beforeeach and @AfterEach pair to reset it. Adds a Test Configuration page covering the annotation, the merge rules for inherited and method-level declarations, and the programmatic surfaces, and links to it from the extension configuration table. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The services of the Spring and Quarkus integrations moved to frameworkLookupServices() and are always registered, so an override of lookupServices() adds to them rather than replacing them, and the method is deprecated in favor of the test configuration. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mcollovati
self-requested a review
September 21, 2026 08:53
mcollovati
reviewed
Sep 21, 2026
| } | ||
| ---- | ||
|
|
||
| A configuration built on an extension or on the application context builder wins over the class-level annotation, and loses against the method-level one. A [methodname]`testConfiguration()` override ranks differently: [methodname]`super.testConfiguration()` returns the configuration already resolved from the annotations, so whatever the override adds on top of it wins over all of them, the method-level annotation included. Build on [methodname]`super.testConfiguration()` to refine the declared configuration, and leave out the values that a test method needs to override. |
Contributor
There was a problem hiding this comment.
A configuration built on an extension or on the application context builder wins over the class-level annotation, and loses against the method-level one
This is true only for the JUnit extension. BrowserlessApplicationContext only uses the configuration built with its own builder; it does take into account any annotation.
However, the annotation configuration can be provided explicitly by using BrowserlessConfiguration.from(...) factory method.
BrowserlessApplicationContext.create(b -> b.withViewPackages(MyView.class)
.withConfiguration(BrowserlessConfiguration.from(getClass())));
mcollovati
requested changes
Sep 21, 2026
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.
Summary
Browserless Test 1.2 lets a test set Vaadin application properties, feature flags, and
Lookupservices for one test class or one test method, with the new@BrowserlessTestConfigannotation or the matching builder methods (vaadin/browserless-test#148). Nothing in the documentation mentions it, and the Configuring the Extension table lists onlywithServices(...).The feature replaces a pattern the docs never endorsed but that tests had to use: setting
vaadin.experimental.*system properties in@BeforeAlland clearing them in@AfterAll. Flags set through the annotation need no development mode and write nothing into the project folder.What changed
articles/flow/testing/browserless/test-configuration.adoc(order 46, right after JUnit 6 Extensions):applicationProperties,featureFlags, andlookupServices;BrowserlessClassExtensionshares one environment across the class;testConfiguration()override, with the precedence between them;SpringServletand therefore wins.extensions.adoc— three rows for the new builder methods, and a line pointing at the new page.Notes for the reviewer
vaadin/browserless-test#148is merged but landed after the1.2.0-rc1tag, so it needs 1.2.0 final to ship with 25.3. Hold this pull request if the release does not pick it up. The API carries@since 25.3in the sources.lookupServices()toframeworkLookupServices(), and deprecatedlookupServices(). That is a behavior change for a test that overrides it, and belongs in the upgrade guide rather than here.extensions.adoc, because the annotation works for plainBrowserlessTestsubclasses too, and those tests never read the extensions page.How to test
Documentation only, with inline snippets that are not compiled. The behavior matches
BrowserlessTestConfig,BrowserlessConfiguration, and the configuration tests onvaadin/browserless-testmain.🤖 Generated with Claude Code