Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
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");
        }
Ejemplo n.º 3
0
        public static void ClickAvailableRoomAndCapture(int hotelNumber, int availableRoom)
        {
            if (hotelNumber < 1)
            {
                throw new ArgumentOutOfRangeException("hotelNumber", hotelNumber, "The hotel number must be 1 or higher.");
            }
            if (availableRoom < 1)
            {
                throw new ArgumentOutOfRangeException("availableRoom", availableRoom, "availableRoom must be 1 or higher.");
            }
            Logger.AddClickAction("AvailableRoomAndCapture", "HotelNumber", hotelNumber, "AvailableRoom", availableRoom);
            HotelResultsPage.SaveHotelData(hotelNumber);
            var selectRoomLink = GetAvailableRoomButton(hotelNumber, availableRoom);

            SaveSearchGUID();
            SaveTotalSearchResults();
            SaveRoomData(hotelNumber, currentRoomNumber, availableRoom);
            selectRoomLink.Click();

            if (HomePage.Data.Rooms.Length == 1)
            {
                try
                {
                    //capture time that takes to load summary page
                    ExtrasPage.WaitForLoad();
                }
                catch (Exception ex)
                {
                    if (Driver.Instance.IsElementDisplayedBy(By.CssSelector("div.alert h4[class='alert alert-error hidden']")))
                    {
                        throw new Exception(string.Format("Hotel Number {0} selected room is no longer available.", hotelNumber));
                    }
                    if (Driver.Instance.IsElementDisplayedBy(By.CssSelector("div.alert h4[class='alert alert-warning hidden']")))
                    {
                        throw new Exception(string.Format("Hotel Number {0} is fully booked for the dates selected.", hotelNumber));
                    }
                    throw ex;
                }
                //capture screenshot
                //NonFunctionalReq.GetScreenShot("Hotel Booking Summary Page");
            }
        }
Ejemplo n.º 4
0
        public static void ClickRoomNumber(int hotelNumber, int roomNumber)
        {
            if (hotelNumber < 1)
            {
                throw new ArgumentOutOfRangeException("hotelNumber", hotelNumber, "The hotel number must be 1 or higher.");
            }
            if (roomNumber < 1)
            {
                throw new ArgumentOutOfRangeException("roomNumber", roomNumber, "The room number must be 1 or higher.");
            }
            Logger.AddClickAction("RoomNumber", "HotelNumber", hotelNumber, "RoomNumber", roomNumber);
            currentRoomNumber = roomNumber;
            HotelResultsPage.Data.EnsureCapacity(roomNumber);
            HotelResultsPage.SaveHotelData(hotelNumber);
            var hotelPanel   = GetHotelPanel(hotelNumber);
            var selectedRoom = hotelPanel.FindElement(By.Id(string.Format("estab{0}-room-tab{1}", hotelNumber - 1, roomNumber)));

            selectedRoom.Click();
            Driver.Instance.WaitForAjax();
            Thread.Sleep(500);
        }