Beispiel #1
0
        //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();
        }
        public static void ClickBookNow()
        {
            Logger.AddClickAction("BookNow");
            Driver.Instance.WaitForAjax();
            Thread.Sleep(1000);
            //find and click the 'Book Now!" button
            IWebElement bookNowBtn = Driver.Instance.FindElement(By.LinkText("Continue"));

            bookNowBtn.Click();

            //capture time that takes to load summary page
            PaymentPage.WaitForLoad();
        }
        public static void ClickBookNowAndCapture()
        {
            Logger.AddClickAction("BookNowAndCapture");
            SaveBasketGUID();
            Driver.Instance.WaitForAjax();
            //find and click the 'Book Now!" button
            IWebElement bookNowBtn = Driver.Instance.FindElement(By.LinkText("Continue"));

            bookNowBtn.Click();

            //capture time that takes to load summary page
            PaymentPage.WaitForLoad();

            //capture screenshot
            //NonFunctionalReq.GetScreenShot("Payment Page");
        }
Beispiel #4
0
 internal static void WaitForLoad()
 {
     PaymentPage.ResetData();
     throw new NotImplementedException();
     //NonFunctionalReq.CaptureTime(() => Driver.Instance.FindElementWithTimeout(By.Id("submitPaymentButton"), 60, "Payment Page  not loaded within 60 sec"), "Payment page load time is");
 }