vaadin / testbench

Vaadin TestBench is a tool for automated user interface testing of Vaadin applications.
https://vaadin.com/testbench
Other
20 stars 22 forks source link

Make `@ViewPackages` inheritable #1736

Open mvysny opened 8 months ago

mvysny commented 8 months ago

BaseUIUnitTest.scanPackages() only considers ViewPackages on the test class itself, and not on any of the superclasses. That prevents me to create a single abstract inheritable test class that configures the entire test environment, and forces me to repeat the @ViewPackages annotation on all test classes.

An example of a reusable inheritable test class:

/**
 * Fully bootstraps the app, then runs UI unit tests on top of the app.
 */
@SpringBootTest
@ActiveProfiles("test")
@ContextConfiguration(classes = IntegrationTestConfiguration.class)
@EnableConfigurationProperties
@Tag("integrationTest")
@ViewPackages(packages = {"at.salzburgag.myflexbox.customerapp"})
@ExtendWith(TreeOnFailureExtension.class)
public abstract class FastUIIntegrationTest extends SpringUIUnitTest {
}