Skip to content

refactor: reuse Vaadin environment for PER_CLASS Spring tests#109

Draft
mcollovati wants to merge 1 commit into
mainfrom
refactor/spring-per-class-env
Draft

refactor: reuse Vaadin environment for PER_CLASS Spring tests#109
mcollovati wants to merge 1 commit into
mainfrom
refactor/spring-per-class-env

Conversation

@mcollovati

Copy link
Copy Markdown
Contributor

SpringBrowserlessTest rebuilt the Vaadin environment for every test method even under @TestInstance(PER_CLASS), so
SpringBrowserlessPerClassLifecycleTest could not prove it is created once.

Reuse the auto-detecting BrowserlessTestExtension via @ExtendWith so the environment is created once per class when requested, and strengthen SpringBrowserlessPerClassLifecycleTest to assert the same VaadinService, VaadinSession and UI are reused across tests.

`SpringBrowserlessTest` rebuilt the Vaadin environment for every test
method even under `@TestInstance(PER_CLASS)`, so
`SpringBrowserlessPerClassLifecycleTest` could not prove it is created
once.

Reuse the auto-detecting `BrowserlessTestExtension` via `@ExtendWith` so
the environment is created once per class when requested, and strengthen
`SpringBrowserlessPerClassLifecycleTest` to assert the same
`VaadinService`, `VaadinSession` and `UI` are reused across tests.
@mcollovati mcollovati force-pushed the refactor/spring-per-class-env branch from 338c8df to 32495dc Compare June 24, 2026 04:54
@mcollovati mcollovati changed the title fix: reuse Vaadin environment for PER_CLASS Spring tests refactor: reuse Vaadin environment for PER_CLASS Spring tests Jun 24, 2026
@mcollovati mcollovati linked an issue Jun 24, 2026 that may be closed by this pull request
@mcollovati mcollovati marked this pull request as draft June 25, 2026 14:32
@mcollovati

Copy link
Copy Markdown
Contributor Author

Based on #112, this might break existing tests extending SpringBrowserlessTest.
Needs to be reworked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Looking for Test Example of Spring application "per TestSuite"

1 participant