use of io.jmix.petclinic.screen.visit.VisitBrowse in project jmix-sneferu by mariodavid.
the class GetOpenedLookupScreenTest method given_noLookupScreenIsOpen_when_getOpenedScreen_then_exceptionIsThrown.
@Test
void given_noLookupScreenIsOpen_when_getOpenedScreen_then_exceptionIsThrown(Screens screens, UiTestAPI uiTestAPI) {
// given:
screens.removeAll();
// when:
final ScreenNotOpenException exception = Assertions.assertThrows(ScreenNotOpenException.class, () -> uiTestAPI.getOpenedLookupScreen(VisitBrowse.class));
// then:
assertThat(exception.getMessage()).isEqualTo("No Screen of class VisitBrowse found");
}
use of io.jmix.petclinic.screen.visit.VisitBrowse in project jmix-sneferu by mariodavid.
the class GetOpenedLookupScreenTest method given_differentLookupScreenIsOpen_when_getOpenedScreen_then_exceptionIsThrown.
@Test
void given_differentLookupScreenIsOpen_when_getOpenedScreen_then_exceptionIsThrown(Screens screens, UiTestAPI uiTestAPI) {
// given:
screens.removeAll();
screens.create(PetBrowse.class).show();
// when:
final ScreenNotOpenException exception = Assertions.assertThrows(ScreenNotOpenException.class, () -> uiTestAPI.getOpenedLookupScreen(VisitBrowse.class));
// then:
assertThat(exception.getMessage()).isEqualTo("No Screen of class VisitBrowse found");
}
use of io.jmix.petclinic.screen.visit.VisitBrowse in project jmix-sneferu by mariodavid.
the class GetLazyOpenedLookupScreenTest method given_screenIsOpenedAfterRetrievingTheLazyReference_when_accessingScreen_then_screenIsReturned.
@Test
void given_screenIsOpenedAfterRetrievingTheLazyReference_when_accessingScreen_then_screenIsReturned(Screens screens, UiTestAPI uiTestAPI) {
// given:
final StandardLookupTestAPI<Visit, VisitBrowse> lazyOpenedScreen = uiTestAPI.getLazyOpenedLookupScreen(VisitBrowse.class);
// and: screen is opened through the application (or test in this case)
final VisitBrowse screen = screens.create(VisitBrowse.class);
screen.show();
// expect: the previous retrieved lazy reference will return the correct reference to the screen
assertThat(lazyOpenedScreen.screen()).isEqualTo(screen);
}
use of io.jmix.petclinic.screen.visit.VisitBrowse in project jmix-sneferu by mariodavid.
the class OpenTabInteractionTest method when_interactionIsPerformed_then_tabIsSelected.
@Test
void when_interactionIsPerformed_then_tabIsSelected(UiTestAPI uiTestAPI) {
// given:
final StandardLookupTestAPI<Visit, VisitBrowse> openedScreen = uiTestAPI.openStandardLookup(Visit.class, VisitBrowse.class);
final TabsheetComponentDescriptor tabSheet = tabSheet("contentTabSheet");
assertThat(openedScreen.rawComponent(tabSheet)).isNotNull();
assertThat(openedScreen.rawComponent(tabSheet).getTab("tableTab")).isNotNull();
// when:
openedScreen.interact(openTab(tabSheet, "tableTab"));
// then:
final TabSheet.Tab selectedTab = openedScreen.rawComponent(tabSheet).getSelectedTab();
// and:
assertThat(selectedTab.getName()).isEqualTo("tableTab");
}
use of io.jmix.petclinic.screen.visit.VisitBrowse in project jmix-sneferu by mariodavid.
the class OpenTabInteractionTest method when_interactionIsPerformedWithInvalidTab_then_exceptionIsThrown.
@Test
void when_interactionIsPerformedWithInvalidTab_then_exceptionIsThrown(UiTestAPI uiTestAPI) {
// given:
final StandardLookupTestAPI<Visit, VisitBrowse> openedScreen = uiTestAPI.openStandardLookup(Visit.class, VisitBrowse.class);
final TabsheetComponentDescriptor tabSheet = tabSheet("contentTabSheet");
assertThat(openedScreen.rawComponent(tabSheet)).isNotNull();
// expect:
assertThrows(IllegalStateException.class, () -> openedScreen.interact(openTab(tabSheet, "notExistingTab")));
}
Aggregations