//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();
        }
Example #2
0
        public static void ClickHotelNumber(int hotelNumber)
        {
            SaveSearchGUID();
            SaveTotalSearchResultsFlightsHotel();
            if (hotelNumber < 1)
            {
                throw new ArgumentOutOfRangeException("hotelNumber", hotelNumber, "The hotel number must be 1 or higher.");
            }
            Logger.AddClickAction("HotelNumber", "HotelNumber", hotelNumber);
            HotelResultsPage.SaveHotelData(hotelNumber);
            var hotelPanel    = GetHotelPanel(hotelNumber);
            var hotelNameLink = hotelPanel.FindElement(By.CssSelector("div.establishment-header h2.establishment-heading a"));

            hotelNameLink.Click();
            HotelDetailPage.WaitForLoad();
        }
Example #3
0
        public static void ClickHotelNumberAndCapture(int hotelNumber)
        {
            SaveSearchGUID();
            if (hotelNumber < 1)
            {
                throw new ArgumentOutOfRangeException("hotelNumber", hotelNumber, "The hotel number must be 1 or higher.");
            }
            Logger.AddClickAction("HotelNumberAndCapture", "HotelNumber", hotelNumber);
            HotelResultsPage.SaveHotelData(hotelNumber);
            var hotelPanel    = GetHotelPanel(hotelNumber);
            var hotelNameLink = hotelPanel.FindElement(By.CssSelector("h3.hotel-name a"));

            hotelNameLink.Click();

            HotelDetailPage.WaitForLoad();

            //capture screenshot
            //NonFunctionalReq.GetScreenShot("Hotel Booking Summary Page");
        }
 internal static void WaitForLoad()
 {
     HotelDetailPage.ResetData();
     HotelDetailPage.Data.LoadingTime = NonFunctionalReq.CaptureTime(() => Driver.Instance.FindElementWithTimeout(By.Id("establishmentpage"), 60, "Hotel Details Page  not loaded within 60 sec"), "Hotel details page load time is");
 }