diff --git a/end2end.xml b/end2end.xml index a812ad6..822cef0 100644 --- a/end2end.xml +++ b/end2end.xml @@ -2,7 +2,10 @@ - + + + + \ No newline at end of file diff --git a/src/test/java/com/easybusticket/pages/ContactPage.java b/src/test/java/com/easybusticket/pages/ContactPage.java index 23bce86..81833d0 100644 --- a/src/test/java/com/easybusticket/pages/ContactPage.java +++ b/src/test/java/com/easybusticket/pages/ContactPage.java @@ -65,16 +65,18 @@ public ContactPage() { @FindBy(xpath = "/html/body/section[2]/div/div[3]/div[2]/div/iframe") public WebElement labelMap; + + @Step(" Confirms that they are on the Contact page by seeing the 'Contact Us' banner on the opening page.") public void titleContactTest() { String expectedContactTitle = "Easy Bus Ticket - Contact Us"; String actualContactTitle = Driver.get(env).getTitle(); - softAssert.assertEquals(actualContactTitle,expectedContactTitle); + softAssert.assertEquals(actualContactTitle, expectedContactTitle); softAssert.assertAll(); } @Step("Filling in the Form und click the Send Us Message button") - public void fillTheContactForm(){ + public void fillTheContactForm() { try { Thread.sleep(3000); } catch (InterruptedException e) { @@ -86,16 +88,19 @@ public void fillTheContactForm(){ .sendKeys(Keys.TAB) .sendKeys(faker.internet().emailAddress()) .sendKeys(Keys.TAB) - .sendKeys(faker.letterify("bag")) + .sendKeys(faker.letterify("Lost Bag")) .sendKeys(Keys.TAB) - .sendKeys(faker.letterify("loss")) + .sendKeys(faker.letterify("My bag was lost on expedition 234532. A red medium-sized bag")) .sendKeys(Keys.PAGE_DOWN) .perform(); - sendUsMessageButton.click(); + sendUsMessageButton.click(); - } + + } } + + diff --git a/src/test/java/com/easybusticket/tests/US08_VisitorContactPage.java b/src/test/java/com/easybusticket/tests/US08_VisitorContactPage.java index 6750c5e..186fba4 100644 --- a/src/test/java/com/easybusticket/tests/US08_VisitorContactPage.java +++ b/src/test/java/com/easybusticket/tests/US08_VisitorContactPage.java @@ -9,6 +9,9 @@ import lombok.extern.slf4j.Slf4j; import org.openqa.selenium.JavascriptExecutor; import org.testng.annotations.Test; + +import static com.easybusticket.pages.BasePage.driver; + @Slf4j public class US08_VisitorContactPage extends BaseTest { @@ -56,6 +59,12 @@ public void ContactPageTest() { // The visitor should enter the necessary information in the "Name, E-mail, Subject and Message" // section and click on the "Send Us a Message" button and submit the form contactPage.fillTheContactForm(); + + //Visitor should be Map display + softAssert.assertTrue(contactPage.labelMap.isDisplayed()); + log.info("Map displayed "); + softAssert.assertAll(); + } }