diff --git a/src/test/java/org/woehlke/jakartaee/petclinic/it/ui/OwnerUiTest.java b/src/test/java/org/woehlke/jakartaee/petclinic/it/ui/OwnerUiTest.java index 30702f10..3c9a5b33 100644 --- a/src/test/java/org/woehlke/jakartaee/petclinic/it/ui/OwnerUiTest.java +++ b/src/test/java/org/woehlke/jakartaee/petclinic/it/ui/OwnerUiTest.java @@ -237,7 +237,6 @@ public void addNewOwnerPageWithSave() { log.info("------------------------------------------------------------------------------------"); } - @Ignore @Test @InSequence(5) public void openOwnerDetailsPage() { @@ -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()); @@ -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 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()); } @@ -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; + } }