diff --git a/src/test/FlightBookingTest b/src/test/FlightBookingTest new file mode 100644 index 00000000..d2f17d1e --- /dev/null +++ b/src/test/FlightBookingTest @@ -0,0 +1,58 @@ +import com.sun.javafx.PlatformUtil; +import org.openqa.selenium.By; +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.chrome.ChromeDriver; +import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.ui.Select; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.List; + +public class FlightBookingTest extends BaseClass{ + + + + @Test + public void testThatResultsAppearForAOneWayJourney() { + + setDriverPath(); + driver.get("https://www.cleartrip.com/"); + waitFor(2000); + + //wait for the auto complete options to appear for the origin + + waitFor(2000); + List originOptions = driver.findElement(By.id("ui-id-1")).findElements(By.tagName("li")); + originOptions.get(0).click(); + + //wait for the auto complete options to appear for the destination + + waitFor(2000); + //select the first item from the destination auto complete list + List destinationOptions = driver.findElement(By.id("ui-id-2")).findElements(By.tagName("li")); + destinationOptions.get(0).click(); + + driver.findElement(By.xpath("//*[@id='ui-datepicker-div']/div[1]/table/tbody/tr[3]/td[7]/a")).click(); + + + waitFor(5000); + //verify that result appears for the provided journey search + Assert.assertTrue(isElementPresent(By.className("searchSummary"))); + + //close the browser + driver.quit(); + + } + + + CommonClass.waitFor(); + + + CommonClass c1=new ComonClass(); + c1. isElementPresent(); + + +}