Search in sources :

Example 1 with ButtonTestAPI

use of de.diedavids.sneferu.components.testapi.ButtonTestAPI in project jmix-sneferu by mariodavid.

the class ComponentTestApiTest method given_componentIsPresentOnScreen_when_retrieveComponentViaTestAPI_then_componentTestApiIsReturned.

@Test
void given_componentIsPresentOnScreen_when_retrieveComponentViaTestAPI_then_componentTestApiIsReturned(UiTestAPI uiTestAPI) {
    // given:
    final StandardLookupTestAPI<Visit, VisitBrowse> openedScreen = uiTestAPI.openStandardLookup(Visit.class, VisitBrowse.class);
    // and:
    assertThat(openedScreen.screen().getWindow().getComponent("createBtn")).isNotNull();
    // when:
    final ButtonTestAPI createBtnTestAPI = openedScreen.component(button("createBtn"));
    // then:
    assertThat(createBtnTestAPI).isNotNull();
}
Also used : Visit(io.jmix.petclinic.entity.visit.Visit) ButtonTestAPI(de.diedavids.sneferu.components.testapi.ButtonTestAPI) VisitBrowse(io.jmix.petclinic.screen.visit.VisitBrowse) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

SneferuUiTest (de.diedavids.sneferu.SneferuUiTest)1 ButtonTestAPI (de.diedavids.sneferu.components.testapi.ButtonTestAPI)1 Visit (io.jmix.petclinic.entity.visit.Visit)1 VisitBrowse (io.jmix.petclinic.screen.visit.VisitBrowse)1 Test (org.junit.jupiter.api.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1