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 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
-