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> T
getComponent
(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 DialogInfo
static NotificationInfo
static List<DialogInfo>
Gets immutable list ofDialogInfo
s in order of opening.static List<NotificationInfo>
Gets immutable list ofNotificationInfo
in order of opening.static ValidationErrors
validateView
(StandardDetailView<?> view) Validates providedView
by 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 providedView
by 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 ofNotificationInfo
in 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
NotificationInfo
in order of opening
- first opened notification has index
-
getLastOpenedNotification
- Returns:
- the most recent opened
NotificationInfo
ornull
if no opened notifications
-
getOpenedDialogs
Gets immutable list ofDialogInfo
s 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
DialogInfo
s in order of opening
- first opened dialog has index
-
getLastOpenedDialog
- Returns:
- the most recent opened
DialogInfo
ornull
if no opened dialogs
-