Package io.jmix.flowui.testassist
Class UiTestUtils
java.lang.Object
io.jmix.flowui.testassist.UiTestUtils
Class provides helper methods for testing.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TgetComponent(View<?> view, String componentId) Returns a component defined in the view by the component id.static <T extends View<?>>
TReturns instance of currently navigated view.static DialogInfostatic NotificationInfostatic List<DialogInfo>Gets immutable list ofDialogInfos in order of opening.static List<NotificationInfo>Gets immutable list ofNotificationInfoin order of opening.static ValidationErrorsvalidateView(StandardDetailView<?> view) Validates providedViewby callingStandardDetailView#validateView()method from it.
-
Method Details
-
getCurrentView
Returns instance of currently navigated view. Usage example:@Test public void navigateToUserListView() { viewNavigators.view(UserListView.class) .navigate(); UserListView view = UiTestUtils.getCurrentView(); }- Type Parameters:
T- type of navigated view- Returns:
- instance of currently navigated view
-
getComponent
Returns a component defined in the view by the component id.- Throws:
IllegalArgumentException- if not found
-
validateView
Validates providedViewby callingStandardDetailView#validateView()method from it.- Parameters:
view- detail view to validate- Returns:
- errors if validation failed, otherwise empty object will be returned
-
getOpenedNotifications
Gets immutable list ofNotificationInfoin order of opening.Example of the storage order of notifications:
- first opened notification has index
0 - seconds opened notification has index
1 - last opened notification has index
openedNotifications.size() - 1
- Returns:
- immutable list of
NotificationInfoin order of opening
- first opened notification has index
-
getLastOpenedNotification
- Returns:
- the most recent opened
NotificationInfoornullif no opened notifications
-
getOpenedDialogs
Gets immutable list ofDialogInfos in order of opening.Example of the storage order of dialogs:
- first opened dialog has index
0 - seconds opened dialog has index
1 - last opened dialog has index
openedDialogs.size() - 1
- Returns:
- immutable list of
DialogInfos in order of opening
- first opened dialog has index
-
getLastOpenedDialog
- Returns:
- the most recent opened
DialogInfoornullif no opened dialogs
-