Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion end2end.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<suite name="End2End Suit">
<test name="End2End Test">
<packages>
<package name="com.easybusticket.tests"/>
<package name="com.easybusticket"/>
</packages>
<classes>
<class name="com.easybusticket.tests.US08_VisitorContactPage"></class>
</classes>
</test>
</suite>
17 changes: 11 additions & 6 deletions src/test/java/com/easybusticket/pages/ContactPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();

}

}
}






Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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();

}

}
Expand Down