Search in sources :

Example 1 with VeterinarianEdit

use of io.jmix.petclinic.screen.veterinarian.veterinarian.VeterinarianEdit in project jmix-sneferu by mariodavid.

the class CloseEditorInteractionTest method given_invalidForm_when_interactionIsPerformedWith_then_screenIsClosedAndFailIsReturned.

@Test
void given_invalidForm_when_interactionIsPerformedWith_then_screenIsClosedAndFailIsReturned(UiTestAPI uiTestAPI) {
    // given:
    StandardEditorTestAPI<Veterinarian, VeterinarianEdit> visitEdit = uiTestAPI.openStandardEditor(Veterinarian.class, VeterinarianEdit.class);
    // and:
    visitEdit.interact(enter(textInputField("firstNameField"), null));
    // when:
    final OperationResult operationResult = visitEdit.andThenGet(closeEditor());
    // then:
    assertThat(operationResult).isEqualTo(OperationResult.fail());
}
Also used : VeterinarianEdit(io.jmix.petclinic.screen.veterinarian.veterinarian.VeterinarianEdit) Veterinarian(io.jmix.petclinic.entity.veterinarian.Veterinarian) OperationResult(io.jmix.ui.util.OperationResult) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest)

Example 2 with VeterinarianEdit

use of io.jmix.petclinic.screen.veterinarian.veterinarian.VeterinarianEdit in project jmix-sneferu by mariodavid.

the class CancelEditorInteractionTest method when_interactionIsPerformed_then_screenIsCanceledAndNothingIsCommitted.

@Test
void when_interactionIsPerformed_then_screenIsCanceledAndNothingIsCommitted(UiTestAPI uiTestAPI) {
    // given:
    StandardEditorTestAPI<Veterinarian, VeterinarianEdit> visitEdit = uiTestAPI.openStandardEditor(Veterinarian.class, VeterinarianEdit.class);
    // and:
    visitEdit.interact(enter(textInputField("firstNameField"), "Oak"));
    // when:
    final OperationResult operationResult = visitEdit.andThenGet(cancelEditor());
    // then:
    assertThat(operationResult).isEqualTo(OperationResult.success());
    // and:
    assertThat(dataManager.load(Veterinarian.class).all().list()).isEmpty();
}
Also used : VeterinarianEdit(io.jmix.petclinic.screen.veterinarian.veterinarian.VeterinarianEdit) Veterinarian(io.jmix.petclinic.entity.veterinarian.Veterinarian) OperationResult(io.jmix.ui.util.OperationResult) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 3 with VeterinarianEdit

use of io.jmix.petclinic.screen.veterinarian.veterinarian.VeterinarianEdit in project jmix-sneferu by mariodavid.

the class CloseEditorInteractionTest method given_validForm_when_interactionIsPerformed_then_screenIsClosedAndSuccessIsReturned.

@Test
void given_validForm_when_interactionIsPerformed_then_screenIsClosedAndSuccessIsReturned(UiTestAPI uiTestAPI) {
    // given:
    StandardEditorTestAPI<Veterinarian, VeterinarianEdit> visitEdit = uiTestAPI.openStandardEditor(Veterinarian.class, VeterinarianEdit.class);
    // and:
    visitEdit.interact(enter(textInputField("firstNameField"), "Oak"));
    // when:
    final OperationResult operationResult = visitEdit.andThenGet(closeEditor());
    // then:
    assertThat(operationResult).isEqualTo(OperationResult.success());
}
Also used : VeterinarianEdit(io.jmix.petclinic.screen.veterinarian.veterinarian.VeterinarianEdit) Veterinarian(io.jmix.petclinic.entity.veterinarian.Veterinarian) OperationResult(io.jmix.ui.util.OperationResult) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest)

Aggregations

SneferuUiTest (de.diedavids.sneferu.SneferuUiTest)3 Veterinarian (io.jmix.petclinic.entity.veterinarian.Veterinarian)3 VeterinarianEdit (io.jmix.petclinic.screen.veterinarian.veterinarian.VeterinarianEdit)3 OperationResult (io.jmix.ui.util.OperationResult)3 Test (org.junit.jupiter.api.Test)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3