Search in sources :

Example 1 with VisitType

use of io.jmix.petclinic.entity.visit.VisitType 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 2 with VisitType

use of io.jmix.petclinic.entity.visit.VisitType 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 3 with VisitType

use of io.jmix.petclinic.entity.visit.VisitType 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)

Example 4 with VisitType

use of io.jmix.petclinic.entity.visit.VisitType in project jmix-sneferu by mariodavid.

the class InteractionsTest method when_interactIsPerformedMultipleTimes_then_allInteractionsArePerformed.

@Test
void when_interactIsPerformedMultipleTimes_then_allInteractionsArePerformed(UiTestAPI uiTestAPI) {
    // given:
    final StandardEditorTestAPI<Visit, VisitEdit> openedScreen = uiTestAPI.openStandardEditor(Visit.class, VisitEdit.class);
    // and:
    assertThat(openedScreen.component(dateField("visitStartField"))).isNotNull();
    assertThat(openedScreen.component(comboBox("typeField"))).isNotNull();
    // and:
    final LocalDateTime startDate = LocalDateTime.of(2022, 1, 15, 6, 0);
    final VisitType recharge = VisitType.RECHARGE;
    // when:
    openedScreen.interact(enter(dateField("visitStartField"), startDate)).andThen(select(comboBox("typeField"), recharge));
    // then:
    assertThat(openedScreen.verify(entityValue("visitStart", LocalDateTime.class))).isEqualTo(startDate);
    // and:
    assertThat(openedScreen.verify(entityValue("type", VisitType.class))).isEqualTo(recharge);
}
Also used : VisitEdit(io.jmix.petclinic.screen.visit.VisitEdit) LocalDateTime(java.time.LocalDateTime) Visit(io.jmix.petclinic.entity.visit.Visit) VisitType(io.jmix.petclinic.entity.visit.VisitType) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

SneferuUiTest (de.diedavids.sneferu.SneferuUiTest)4 Visit (io.jmix.petclinic.entity.visit.Visit)4 VisitType (io.jmix.petclinic.entity.visit.VisitType)4 VisitEdit (io.jmix.petclinic.screen.visit.VisitEdit)4 Test (org.junit.jupiter.api.Test)4 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)4 LocalDateTime (java.time.LocalDateTime)1