Browserless testing on Quarkus needs to mark Vaadin the test class with @QuarkusTest annotation so that all the augmentation provided by the Vaadin extension (scopes, beans, unremovables, ...) is available during test execution.
The drawback is that with @QuarkusTest, the application is started, including the servlet container and the Vaadin initialization.
With browserless testing, both are unnecessary and only slow down the execution of the tests.
After vaadin/quarkus#281 is implemented, the Quarkus browserless testing module should provide a test profile (BrowserlessTestProfile) named vaadin-browserless and a @BrowserlessQuarkusTest annotation which activates @QuarkusTest and the test profile`
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@QuarkusTest
@TestProfile(BrowserlessTestProfile.class)
public @interface BrowserlessQuarkusTest {}
The BrowserlessTestProfile class itself should also prevent the HTTP server from being bound to any port
public class VaadinFastTestProfile implements QuarkusTestProfile {
@Override
public String getConfigProfile() { return "vaadin-browserless"; }
@Override
public Map<String, String> getConfigOverrides() {
return Map.of("quarkus.http.host-enabled", "false");
}
}
User tests should then use @BrowserlessQuarkusTest instead of @QuarkusTest.
Browserless testing on Quarkus needs to mark Vaadin the test class with
@QuarkusTest annotationso that all the augmentation provided by the Vaadin extension (scopes, beans, unremovables, ...) is available during test execution.The drawback is that with
@QuarkusTest, the application is started, including the servlet container and the Vaadin initialization.With browserless testing, both are unnecessary and only slow down the execution of the tests.
After vaadin/quarkus#281 is implemented, the Quarkus browserless testing module should provide a test profile (
BrowserlessTestProfile) namedvaadin-browserlessand a@BrowserlessQuarkusTestannotation which activates@QuarkusTestand the test profile`The
BrowserlessTestProfileclass itself should also prevent the HTTP server from being bound to any portUser tests should then use
@BrowserlessQuarkusTestinstead of@QuarkusTest.