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> TgetComponent(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 DialogInfostatic NotificationInfostatic List<DialogInfo>Returns an immutable list ofDialogInfoobjects in the order they were opened.static List<NotificationInfo>Returns an immutable list ofNotificationInfoobjects in the order they were opened.static ValidationErrorsvalidateView(StandardDetailView<?> view) Validates providedViewby 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 providedViewby 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 ofNotificationInfoobjects 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
NotificationInfoin order of opening
- first opened notification has index
-
getLastOpenedNotification
- Returns:
- the most recent opened
NotificationInfoornullif no opened notifications
-
getOpenedDialogs
Returns an immutable list ofDialogInfoobjects 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
DialogInfos in order of opening
- first opened dialog has index
-
getLastOpenedDialog
- Returns:
- the most recent opened
DialogInfoornullif no opened dialogs
-