use of de.diedavids.sneferu.components.descriptor.TabsheetComponentDescriptor 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 de.diedavids.sneferu.components.descriptor.TabsheetComponentDescriptor 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