Skip to content

Commit

Permalink
v9.1.0.90
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaswoehlke committed Aug 7, 2022
1 parent 53d4b1e commit ab83263
Show file tree
Hide file tree
Showing 2 changed files with 217 additions and 24 deletions.
161 changes: 150 additions & 11 deletions src/test/java/org/woehlke/jakartaee/petclinic/it/ui/OwnerUiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ public void addNewOwnerPageWithSave() {
log.info("------------------------------------------------------------------------------------");
}

@Ignore
@Test
@InSequence(5)
public void openOwnerDetailsPage() {
Expand All @@ -255,12 +254,11 @@ public void openOwnerDetailsPage() {
log.info("------------------------------------------------------------------------------------");
}

@Ignore
@Test
@InSequence(6)
public void editOwnerPageWithCancel() {
log.info("------------------------------------------------------------------------------------");
log.info(" editOwnerPage ");
log.info(" editOwnerPageWithCancel ");
log.info("------------------------------------------------------------------------------------");
goTo(OwnerPage.class);
Assert.assertTrue(ownerPage.isFlowStateList());
Expand All @@ -275,16 +273,39 @@ public void editOwnerPageWithCancel() {
ownerPage.clickCancelDetailsButton();
Assert.assertTrue(ownerPage.isFlowStateList());
log.info("------------------------------------------------------------------------------------");
log.info(" editOwnerPage DONE ");
log.info(" editOwnerPageWithCancel DONE ");
log.info("------------------------------------------------------------------------------------");
}

@Test
@InSequence(7)
public void editVeterinarianPageWithSave() {
log.info("------------------------------------------------------------------------------------");
log.info(" editVeterinarianPageWithSave ");
log.info("------------------------------------------------------------------------------------");
goTo(OwnerPage.class);
Assert.assertTrue(ownerPage.isFlowStateList());
for(int i=0; i<ownerList.size(); i++){
log.info(" "+i);
ownerPage.clickShowDetailsFormButton(i);
Assert.assertTrue(ownerPage.isFlowStateDetails());
ownerPage.clickShowEditForm();
Assert.assertTrue(ownerPage.isFlowStateEdit());
ownerPage.editNameAddString();
Assert.assertTrue(ownerPage.isFlowStateDetails());
ownerPage.clickCancelDetailsButton();
Assert.assertTrue(ownerPage.isFlowStateList());
}
log.info("------------------------------------------------------------------------------------");
log.info(" editVeterinarianPageWithSave DONE ");
log.info("------------------------------------------------------------------------------------");
}

@Ignore
@Test
@InSequence(8)
public void deleteOwnerPageWithCancel() {
log.info("------------------------------------------------------------------------------------");
log.info(" deleteOwnerPage ");
log.info(" deleteOwnerPageWithCancel ");
log.info("------------------------------------------------------------------------------------");
goTo(OwnerPage.class);
Assert.assertTrue(ownerPage.isFlowStateList());
Expand All @@ -299,11 +320,31 @@ public void deleteOwnerPageWithCancel() {
ownerPage.clickCancelDetailsButton();
Assert.assertTrue(ownerPage.isFlowStateList());
log.info("------------------------------------------------------------------------------------");
log.info(" deleteOwnerPage DONE ");
log.info(" deleteOwnerPageWithCancel DONE ");
log.info("------------------------------------------------------------------------------------");
}

@Test
@InSequence(9)
public void deleteOwnerPageWithSave() {
log.info("------------------------------------------------------------------------------------");
log.info(" deleteOwnerPageWithSave ");
log.info("------------------------------------------------------------------------------------");
goTo(OwnerPage.class);
Assert.assertTrue(ownerPage.isFlowStateList());
for(int i=0; i<ownerList.size(); i++) {
ownerPage.clickShowDetailsFormButton0();
Assert.assertTrue(ownerPage.isFlowStateDetails());
ownerPage.clickShowDeleteForm();
Assert.assertTrue(ownerPage.isFlowStateDelete());
ownerPage.clickSaveDeleteButton();
Assert.assertTrue(ownerPage.isFlowStateList());
}
log.info("------------------------------------------------------------------------------------");
log.info(" deleteOwnerPageWithSave DONE ");
log.info("------------------------------------------------------------------------------------");
}

@Ignore
@Test
@InSequence(10)
public void addNewPetToOwnerPageWithCancel() {
Expand All @@ -328,12 +369,85 @@ public void addNewPetToOwnerPageWithCancel() {
log.info("------------------------------------------------------------------------------------");
}

@Ignore
@Test
@InSequence(11)
public void addNewPetToOwnerPageWithSave() {
log.info("------------------------------------------------------------------------------------");
log.info(" addNewPetToOwnerPageWithSave ");
log.info("------------------------------------------------------------------------------------");
goTo(OwnerPage.class);
ownerPage.fullscreen();
Assert.assertTrue(ownerPage.isFlowStateList());
ownerPage.clickShowDetailsFormButton1();
Assert.assertTrue(ownerPage.isFlowStateDetails());
// ----------------------------------
//ownerPage.clickAddNewPetButton();
//Assert.assertTrue(ownerPage.isFlowStateNewPet());
//ownerPage.clickCancelNewPetButton();
// ----------------------------------
Assert.assertTrue(ownerPage.isFlowStateDetails());
ownerPage.clickCancelDetailsButton();
Assert.assertTrue(ownerPage.isFlowStateList());
log.info("------------------------------------------------------------------------------------");
log.info(" addNewPetToOwnerPageWithSave DONE ");
log.info("------------------------------------------------------------------------------------");
}


@Test
@InSequence(12)
public void editPetOfOwnerPageWithCancel() {
log.info("------------------------------------------------------------------------------------");
log.info(" editPetOfOwnerPageWithCancel ");
log.info("------------------------------------------------------------------------------------");
goTo(OwnerPage.class);
ownerPage.fullscreen();
Assert.assertTrue(ownerPage.isFlowStateList());
ownerPage.clickShowDetailsFormButton1();
Assert.assertTrue(ownerPage.isFlowStateDetails());
// ----------------------------------
ownerPage.clickAddNewPetButton();
Assert.assertTrue(ownerPage.isFlowStateNewPet());
ownerPage.clickCancelNewPetButton();
// ----------------------------------
Assert.assertTrue(ownerPage.isFlowStateDetails());
ownerPage.clickCancelDetailsButton();
Assert.assertTrue(ownerPage.isFlowStateList());
log.info("------------------------------------------------------------------------------------");
log.info(" editPetOfOwnerPageWithCancel DONE ");
log.info("------------------------------------------------------------------------------------");
}

@Test
@InSequence(13)
public void editPetOfOwnerPageWithSave() {
log.info("------------------------------------------------------------------------------------");
log.info(" editPetOfOwnerPageWithSave ");
log.info("------------------------------------------------------------------------------------");
goTo(OwnerPage.class);
ownerPage.fullscreen();
Assert.assertTrue(ownerPage.isFlowStateList());
ownerPage.clickShowDetailsFormButton1();
Assert.assertTrue(ownerPage.isFlowStateDetails());
// ----------------------------------
//ownerPage.clickAddNewPetButton();
//Assert.assertTrue(ownerPage.isFlowStateNewPet());
//ownerPage.clickCancelNewPetButton();
// ----------------------------------
Assert.assertTrue(ownerPage.isFlowStateDetails());
ownerPage.clickCancelDetailsButton();
Assert.assertTrue(ownerPage.isFlowStateList());
log.info("------------------------------------------------------------------------------------");
log.info(" editPetOfOwnerPageWithSave DONE ");
log.info("------------------------------------------------------------------------------------");
}

@Ignore
@Test
@InSequence(14)
public void addNewVisitToOwnersFirstPetPageWithCancel() {
log.info("------------------------------------------------------------------------------------");
log.info(" addNewVisitToOwnersFirstPetPage ");
log.info(" editNewVisitToOwnersFirstPetPageWithCancel ");
log.info("------------------------------------------------------------------------------------");
goTo(OwnerPage.class);
ownerPage.fullscreen();
Expand All @@ -349,7 +463,32 @@ public void addNewVisitToOwnersFirstPetPageWithCancel() {
ownerPage.clickCancelDetailsButton();
Assert.assertTrue(ownerPage.isFlowStateList());
log.info("------------------------------------------------------------------------------------");
log.info(" addNewVisitToOwnersFirstPetPage DONE ");
log.info(" editNewVisitToOwnersFirstPetPageWithCancel DONE ");
log.info("------------------------------------------------------------------------------------");
}

@Ignore
@Test
@InSequence(15)
public void addNewVisitToOwnersFirstPetPageWithSave() {
log.info("------------------------------------------------------------------------------------");
log.info(" editNewVisitToOwnersFirstPetPageWithSave ");
log.info("------------------------------------------------------------------------------------");
goTo(OwnerPage.class);
ownerPage.fullscreen();
Assert.assertTrue(ownerPage.isFlowStateList());
ownerPage.clickShowDetailsFormButton1();
Assert.assertTrue(ownerPage.isFlowStateDetails());
// ----------------------------------
//ownerPage.clickAddNewVisitButton();
//Assert.assertTrue(ownerPage.isFlowStateNewVisit());
//ownerPage.clickCancelNewVisitButton();
// ----------------------------------
Assert.assertTrue(ownerPage.isFlowStateDetails());
ownerPage.clickCancelDetailsButton();
Assert.assertTrue(ownerPage.isFlowStateList());
log.info("------------------------------------------------------------------------------------");
log.info(" editNewVisitToOwnersFirstPetPageWithSave DONE ");
log.info("------------------------------------------------------------------------------------");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public class OwnerPage implements OwnerFlowStatePage {
@FindBy(id="addVisitForm:cancelAddNewOwnersPetVisit")
private WebElement cancelNewVisitButton;


public OwnerPage clickAddNewEntityButton() {
Graphene.guardHttp(showNewFormButton).click();
fullscreen();
Expand Down Expand Up @@ -165,6 +164,18 @@ public OwnerPage clickShowDetailsFormButton4() {
return this;
}

public OwnerPage clickShowDetailsFormButton(int i) {
switch (i){
case 0: clickShowDetailsFormButton0(); break;
case 1: clickShowDetailsFormButton1(); break;
case 2: clickShowDetailsFormButton2(); break;
case 3: clickShowDetailsFormButton3(); break;
case 4: clickShowDetailsFormButton4(); break;
default: break;
}
return this;
}

public OwnerPage clickCancelDetailsButton() {
//Graphene.guardHttp(cancelDetailsButton).click();
cancelDetailsButton.sendKeys(Keys.DOWN);
Expand Down Expand Up @@ -303,7 +314,7 @@ public OwnerPage(WebDriver driver, Map<String, String> data, int timeout) {
@FindBy(id="addNewOwnerForm:saveAddNewOwner")
private WebElement newOwnerSaveButton;

public void addNewEntity(Owner o) {
public OwnerPage addNewEntity(Owner o) {
if(null != o.getAddressInfo()){
newOwnerInputAddressInfo.sendKeys(o.getAddressInfo());
}
Expand All @@ -316,34 +327,77 @@ public void addNewEntity(Owner o) {
newOwnerPhoneNumber.sendKeys(o.getPhoneNumber());
newOwnerEmail.sendKeys(o.getEmail());
Graphene.guardHttp(newOwnerSaveButton).click();
return this;
}

/*
@FindBy(id="")
@FindBy(id="editOwnerForm:firstNameEditOwner")
private WebElement editOwnerInputFirstName;

@FindBy(id="")
@FindBy(id="editOwnerForm:lastNameEditOwner")
private WebElement editOwnerInputLastName;

@FindBy(id="")
@FindBy(id="editOwnerForm:addressEditOwner")
private WebElement editOwnerInputAddress;

@FindBy(id="")
@FindBy(id="editOwnerForm:houseNumberEditOwner")
private WebElement editOwnerInputHouseNumber;

@FindBy(id="")
@FindBy(id="editOwnerForm:addressInfoEditOwner")
private WebElement editOwnerInputAddressInfo;

@FindBy(id="")
@FindBy(id="editOwnerForm:cityEditOwner")
private WebElement editOwnerInputCity;

@FindBy(id="")
@FindBy(id="editOwnerForm:zipCodeEditOwner")
private WebElement editOwnerZipCode;

@FindBy(id="")
@FindBy(id="editOwnerForm:phoneNumberEditOwner")
private WebElement editOwnerPhoneNumber;

@FindBy(id="")
@FindBy(id="editOwnerForm:emailEditOwner")
private WebElement editOwnerEmail;
*/

@FindBy(id="editOwnerForm:saveEditOwner")
private WebElement editOwnerSaveButton;

public OwnerPage editNameAddString() {
String firstName = editOwnerInputFirstName.getText();
String lastName = editOwnerInputLastName.getText();
String address = editOwnerInputAddress.getText();
String houseNumber = editOwnerInputHouseNumber.getText();
String addressInfo = editOwnerInputAddressInfo.getText();
String city = editOwnerInputCity.getText();
String zipCode = editOwnerZipCode.getText();
String phoneNumber = editOwnerPhoneNumber.getText();
String email = editOwnerEmail.getText();
firstName += "Test";
lastName += "TEST";
address += " XY";
houseNumber += " 33";
if(null != addressInfo){
addressInfo += " TeST";
editOwnerInputAddressInfo.sendKeys(addressInfo);
}
city += " ZZ";
zipCode += "99";
phoneNumber += "77";
editOwnerInputFirstName.sendKeys(firstName);
editOwnerInputLastName.sendKeys(lastName);
editOwnerInputAddress.sendKeys(address);
editOwnerInputHouseNumber.sendKeys(houseNumber);
editOwnerInputCity.sendKeys(city);
editOwnerZipCode.sendKeys(zipCode);
editOwnerPhoneNumber.sendKeys(phoneNumber);
editOwnerEmail.sendKeys(email);
Graphene.guardHttp(editOwnerSaveButton).click();
return this;
}

@FindBy(id="deleteOwnerForm:confirmDeleteButton")
private WebElement deleteOwnerSaveButton;

public OwnerPage clickSaveDeleteButton() {
Graphene.guardHttp(deleteOwnerSaveButton).click();
return this;
}
}

0 comments on commit ab83263

Please sign in to comment.