Search in sources :

Example 1 with VisitEdit

use of io.jmix.petclinic.screen.visit.VisitEdit in project jmix-sneferu by mariodavid.

the class GetValueInteractionTest method componentValue_isAnAliasForGetValue.

@Test
void componentValue_isAnAliasForGetValue(UiTestAPI uiTestAPI) {
    // given:
    StandardEditorTestAPI<Visit, VisitEdit> visitEdit = uiTestAPI.openStandardEditor(Visit.class, VisitEdit.class);
    visitEdit.interact(enter(VISIT_START_FIELD, VISIT_START_VALUE));
    // when:
    final LocalDateTime actualVisitStart = (LocalDateTime) visitEdit.andThenGet(componentValue(VISIT_START_FIELD));
    // then:
    assertThat(actualVisitStart).isEqualTo(VISIT_START_VALUE);
}
Also used : VisitEdit(io.jmix.petclinic.screen.visit.VisitEdit) LocalDateTime(java.time.LocalDateTime) Visit(io.jmix.petclinic.entity.visit.Visit) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest)

Example 2 with VisitEdit

use of io.jmix.petclinic.screen.visit.VisitEdit in project jmix-sneferu by mariodavid.

the class ScreenOpenModeInteractionTest method when_interactionIsPerformed_then_openModeIsReturned.

@Test
void when_interactionIsPerformed_then_openModeIsReturned(UiTestAPI uiTestAPI) {
    // given:
    final Visit expectedVisit = dataManager.create(Visit.class);
    // and:
    StandardEditorTestAPI<Visit, VisitEdit> visitEdit = uiTestAPI.openStandardEditor(Visit.class, VisitEdit.class, expectedVisit);
    // when:
    final OpenMode actualOpenMode = visitEdit.andThenGet(screenOpenMode());
    // then:
    assertThat(actualOpenMode).isEqualTo(OpenMode.DIALOG);
}
Also used : VisitEdit(io.jmix.petclinic.screen.visit.VisitEdit) Visit(io.jmix.petclinic.entity.visit.Visit) OpenMode(io.jmix.ui.screen.OpenMode) Interactions.screenOpenMode(de.diedavids.sneferu.Interactions.screenOpenMode) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest)

Example 3 with VisitEdit

use of io.jmix.petclinic.screen.visit.VisitEdit in project jmix-sneferu by mariodavid.

the class SetValueInteractionTest method enter_isAnAliasForSetValue.

@Test
void enter_isAnAliasForSetValue(UiTestAPI uiTestAPI) {
    // given:
    final StandardEditorTestAPI<Visit, VisitEdit> openedScreen = openVisitEditor(uiTestAPI);
    // and:
    final VisitType recharge = VisitType.RECHARGE;
    // when:
    openedScreen.interact(enter(comboBox("typeField"), recharge));
    // then:
    typeHasValue(openedScreen, recharge);
}
Also used : VisitEdit(io.jmix.petclinic.screen.visit.VisitEdit) Visit(io.jmix.petclinic.entity.visit.Visit) VisitType(io.jmix.petclinic.entity.visit.VisitType) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest)

Example 4 with VisitEdit

use of io.jmix.petclinic.screen.visit.VisitEdit in project jmix-sneferu by mariodavid.

the class SetValueInteractionTest method when_interactionIsPerformed_then_valueIsSet.

@Test
void when_interactionIsPerformed_then_valueIsSet(UiTestAPI uiTestAPI) {
    // given:
    final StandardEditorTestAPI<Visit, VisitEdit> openedScreen = openVisitEditor(uiTestAPI);
    // and:
    final VisitType recharge = VisitType.RECHARGE;
    // when:
    openedScreen.interact(setValue(comboBox("typeField"), recharge));
    // then:
    typeHasValue(openedScreen, recharge);
}
Also used : VisitEdit(io.jmix.petclinic.screen.visit.VisitEdit) Visit(io.jmix.petclinic.entity.visit.Visit) VisitType(io.jmix.petclinic.entity.visit.VisitType) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest)

Example 5 with VisitEdit

use of io.jmix.petclinic.screen.visit.VisitEdit in project jmix-sneferu by mariodavid.

the class SetValueInteractionTest method select_isAnAliasForSetValue.

@Test
void select_isAnAliasForSetValue(UiTestAPI uiTestAPI) {
    // given:
    final StandardEditorTestAPI<Visit, VisitEdit> openedScreen = openVisitEditor(uiTestAPI);
    // and:
    final VisitType recharge = VisitType.RECHARGE;
    // when:
    openedScreen.interact(select(comboBox("typeField"), recharge));
    // then:
    typeHasValue(openedScreen, recharge);
}
Also used : VisitEdit(io.jmix.petclinic.screen.visit.VisitEdit) Visit(io.jmix.petclinic.entity.visit.Visit) VisitType(io.jmix.petclinic.entity.visit.VisitType) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest)

Aggregations

VisitEdit (io.jmix.petclinic.screen.visit.VisitEdit)19 SneferuUiTest (de.diedavids.sneferu.SneferuUiTest)18 Visit (io.jmix.petclinic.entity.visit.Visit)18 Test (org.junit.jupiter.api.Test)18 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)18 LocalDateTime (java.time.LocalDateTime)5 VisitType (io.jmix.petclinic.entity.visit.VisitType)4 OperationResult (io.jmix.ui.util.OperationResult)3 ScreenNotOpenException (de.diedavids.sneferu.ScreenNotOpenException)2 Interactions.screenOpenMode (de.diedavids.sneferu.Interactions.screenOpenMode)1 Pet (io.jmix.petclinic.entity.pet.Pet)1 VisitBrowse (io.jmix.petclinic.screen.visit.VisitBrowse)1 OpenMode (io.jmix.ui.screen.OpenMode)1 NotNull (org.jetbrains.annotations.NotNull)1