Search in sources :

Example 1 with ScreenNotOpenException

use of de.diedavids.sneferu.ScreenNotOpenException in project jmix-sneferu by mariodavid.

the class GetOpenedEditorScreenTest method given_noEditorScreenIsOpen_when_getOpenedScreen_then_exceptionIsThrown.

@Test
void given_noEditorScreenIsOpen_when_getOpenedScreen_then_exceptionIsThrown(Screens screens, UiTestAPI uiTestAPI) {
    // given:
    screens.removeAll();
    // when:
    final ScreenNotOpenException exception = Assertions.assertThrows(ScreenNotOpenException.class, () -> uiTestAPI.getOpenedEditorScreen(VisitEdit.class));
    // then:
    assertThat(exception.getMessage()).isEqualTo("No Screen of class VisitEdit found");
}
Also used : ScreenNotOpenException(de.diedavids.sneferu.ScreenNotOpenException) VisitEdit(io.jmix.petclinic.screen.visit.VisitEdit) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 2 with ScreenNotOpenException

use of de.diedavids.sneferu.ScreenNotOpenException 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");
}
Also used : ScreenNotOpenException(de.diedavids.sneferu.ScreenNotOpenException) VisitBrowse(io.jmix.petclinic.screen.visit.VisitBrowse) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest)

Example 3 with ScreenNotOpenException

use of de.diedavids.sneferu.ScreenNotOpenException 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");
}
Also used : ScreenNotOpenException(de.diedavids.sneferu.ScreenNotOpenException) PetBrowse(io.jmix.petclinic.screen.pet.pet.PetBrowse) VisitBrowse(io.jmix.petclinic.screen.visit.VisitBrowse) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest)

Example 4 with ScreenNotOpenException

use of de.diedavids.sneferu.ScreenNotOpenException in project jmix-sneferu by mariodavid.

the class GetLazyOpenedStandardScreenTest method given_lazyTestApiIsReturned_when_accessingScreen_then_ScreenNotFoundExceptionIsThrown.

@Test
void given_lazyTestApiIsReturned_when_accessingScreen_then_ScreenNotFoundExceptionIsThrown(Screens screens, UiTestAPI uiTestAPI) {
    // given:
    screens.removeAll();
    // when:
    final StandardScreenTestAPI<MyVisits> lazyOpenedScreen = uiTestAPI.getLazyOpenedStandardScreen(MyVisits.class);
    // then:
    final ScreenNotOpenException exception = Assertions.assertThrows(ScreenNotOpenException.class, lazyOpenedScreen::screen);
    // then:
    assertThat(exception.getMessage()).isEqualTo("No Screen of class MyVisits found");
}
Also used : ScreenNotOpenException(de.diedavids.sneferu.ScreenNotOpenException) MyVisits(io.jmix.petclinic.screen.visit.MyVisits) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest)

Example 5 with ScreenNotOpenException

use of de.diedavids.sneferu.ScreenNotOpenException in project jmix-sneferu by mariodavid.

the class GetLazyOpenedEditorScreenTest method given_lazyTestApiIsReturned_when_accessingScreen_then_ScreenNotFoundExceptionIsThrown.

@Test
void given_lazyTestApiIsReturned_when_accessingScreen_then_ScreenNotFoundExceptionIsThrown(Screens screens, UiTestAPI uiTestAPI) {
    // given:
    screens.removeAll();
    // when:
    final StandardEditorTestAPI<Visit, VisitEdit> lazyOpenedScreen = uiTestAPI.getLazyOpenedEditorScreen(VisitEdit.class);
    // then:
    final ScreenNotOpenException exception = Assertions.assertThrows(ScreenNotOpenException.class, lazyOpenedScreen::screen);
    // then:
    assertThat(exception.getMessage()).isEqualTo("No Screen of class VisitEdit found");
}
Also used : VisitEdit(io.jmix.petclinic.screen.visit.VisitEdit) ScreenNotOpenException(de.diedavids.sneferu.ScreenNotOpenException) Visit(io.jmix.petclinic.entity.visit.Visit) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

ScreenNotOpenException (de.diedavids.sneferu.ScreenNotOpenException)8 SneferuUiTest (de.diedavids.sneferu.SneferuUiTest)8 Test (org.junit.jupiter.api.Test)8 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)8 MyVisits (io.jmix.petclinic.screen.visit.MyVisits)3 VisitBrowse (io.jmix.petclinic.screen.visit.VisitBrowse)3 Visit (io.jmix.petclinic.entity.visit.Visit)2 PetBrowse (io.jmix.petclinic.screen.pet.pet.PetBrowse)2 VisitEdit (io.jmix.petclinic.screen.visit.VisitEdit)2