public static void ClickSearch()
        {
            Logger.AddClickAction("Search");

            //click search button
            GetSearchButton().Click();

            //capture the page load time
            HomePage.Data.SearchTime = NonFunctionalReq.CaptureTime(() => Driver.Instance.FindElementWithTimeout(By.CssSelector("div.row-fluid a.pull-left div.logo"), 65, "Result page is not displayed within 60 Sec"), "Search Page load time is");

            switch (HomePage.Data.SearchOption)
            {
            case SearchOption.FlightOnly:
                //Wait for java script to load
                FlightResultsPage.WaitToLoad();
                break;

            case SearchOption.HotelOnly:
                //Wait for java script to load
                HotelResultsPage.WaitToLoad();
                break;

            case SearchOption.FlightAndHotel:
                //Wait for java script to load
                FlightResultsPage.WaitToLoad();
                break;
            }
        }
        //Select enviorment to run the automation tests
        public static void Navigate(TestEnvironment Env)
        {
            switch (Env)
            {
            case TestEnvironment.Live:
                //Capture Page Load Times
                NonFunctionalReq.CaptureTime(() => Driver.Instance.Navigate().GoToUrl("https://www.alpharooms.com"), "Landing Page load time is");
                break;

            case TestEnvironment.Staging:
                //Capture Page Load Times
                NonFunctionalReq.CaptureTime(() => Driver.Instance.Navigate().GoToUrl("https://no.staging.alpharooms.com/"), "Landing Page load time is");
                break;

            case TestEnvironment.QA:
                //Capture Page Load Times
                NonFunctionalReq.CaptureTime(() => Driver.Instance.Navigate().GoToUrl("http://flightshotfix.alpha2.com/"), "Landing Page load time is");
                break;


            case TestEnvironment.SOAFlights:
                //Capture Page Load Times
                NonFunctionalReq.CaptureTime(() => Driver.Instance.Navigate().GoToUrl("http://flights3.alpha2.com/"), "Landing Page load time is");
                break;
            }
            Logger.Clear();
            HomePage.ResetData();
            FlightResultsPage.ResetData();
            HotelResultsPage.ResetData();
            HotelDetailPage.ResetData();
            ExtrasPage.ResetData();
            InsurancePage.ResetData();
            PaymentPage.ResetData();
        }
Beispiel #3
0
 public static void ClickResultPage(int pageNo)
 {
     if (pageNo < 1)
     {
         throw new ArgumentOutOfRangeException("pageNo", pageNo, "The page number must be 1 or higher.");
     }
     Logger.AddClickAction("ResultPage", "PageNumber", pageNo);
     FlightResultsPage.ClickResultPage(pageNo);
 }
Beispiel #4
0
        public static void ClickSearchAndCapture()
        {
            Logger.AddClickAction("SearchAndCapture");

            //click search button
            GetSearchButton().Click();

            //capture the page load time
            HomePage.Data.SearchTime = NonFunctionalReq.CaptureTime(() => Driver.Instance.FindElementWithTimeout(By.Id("filtersDialog"), 60, "Result page is not displayed within 60 Sec"), "Search Page load time is");

            switch (HomePage.Data.SearchOption)
            {
            case SearchOption.FlightOnly:
                //Wait for java script to load
                FlightResultsPage.WaitToLoad();

                //capture screenshot
                //NonFunctionalReq.GetScreenShot("Hotel Booking Summary Page");
                break;

            case SearchOption.HotelOnly:
                //Wait for java script to load
                HotelResultsPage.WaitToLoad();

                //capture screenshot
                //NonFunctionalReq.GetScreenShot("Hotel Booking Summary Page");
                break;

            case SearchOption.FlightAndHotel:
                //Wait for java script to load
                FlightResultsPage.WaitToLoad();

                //capture screenshot
                //NonFunctionalReq.GetScreenShot("Hotel Booking Summary Page");
                break;
            }
        }
 internal static void WaitToLoad()
 {
     FlightResultsPage.ResetData();
     //Wait for java script to load
     FlightResultsPage.Data.LoadingTime = NonFunctionalReq.CaptureTime(() => Driver.Instance.WaitForAjax(), "Flight Result Page Rendering Time");
 }