Package io.jmix.tabbedmode.testassist
Class UiTestUtils
java.lang.Object
io.jmix.tabbedmode.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 active view.static DialogInfo
static NotificationInfo
static List<DialogInfo>
Returns an immutable list ofDialogInfo
objects in the order they were opened.static List<NotificationInfo>
Returns an immutable list ofNotificationInfo
objects in the order they were opened.static ValidationErrors
validateView
(StandardDetailView<?> view) Validates providedView
by callingStandardDetailView#validateView()
method from it.
-
Method Details
-
getCurrentView
Returns instance of currently active view. Usage example:@Test public void openUserListView() { viewBuilders.view(UiTestUtils.getCurrentView(), UserListView.class) .open(); UserListView userListView = UiTestUtils.getCurrentView(); }
- Type Parameters:
T
- type of navigated view- Returns:
- instance of the currently active 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 an empty object will be returned
-
getOpenedNotifications
Returns an immutable list ofNotificationInfo
objects in the order they were opened.Example of the order in which notifications are stored:
- first opened notification has index
0
- second 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
Returns an immutable list ofDialogInfo
objects in the order they were opened.Example of the order in which dialogs are stored:
- first opened dialog has index
0
- second 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
-