Package io.jmix.ui.testassist.junit
Annotation Interface UiTest
@Target(TYPE)
@Retention(RUNTIME)
@ExtendWith({org.springframework.test.context.junit.jupiter.SpringExtension.class,JmixUiTestExtension.class})
@Documented
@Inherited
public @interface UiTest
The annotation is used for testing Jmix screens on JUnit.
For instance:
@UiTest(authenticatedUser = "admin", mainScreenId = "MainScreen", screenBasePackages = "com.company.demo.screen") @ContextConfiguration(classes = {DemoApplication.class, UiTestAssistConfiguration.class}) public class UserBrowseTest { @Test protected void openUserBrowse(Screens screens) { UserBrowse screen = screens.create(UserBrowse.class); screen.show(); } }
Screens
bean can be obtained from method parameters or via BeanFactory.getBean(Class)
.- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionThe username that should be authenticated before each test.The main screen id that should be opened before each test.String[]
Screens under these packages will be available in test.
-
Element Details
-
authenticatedUser
String authenticatedUserThe username that should be authenticated before each test. If username is not set, authentication will be performed by system user.- Default:
- ""
-
mainScreenId
String mainScreenIdThe main screen id that should be opened before each test. The screen with given id should be placed under one of packages that are provided byscreenBasePackages()
.If main screen id is not set, the
UiProperties.getMainScreenId()
will be used.- Default:
- ""
-
screenBasePackages
String[] screenBasePackagesScreens under these packages will be available in test. If packages are not set, all application screens will be available depending on the test's configuration.- Default:
- {}
-