コード例 #1
0
        private void SetBookingType(BookingConfiguration bookingConfig)
        {
            switch (bookingConfig.BookType)
            {
            case BookingType.FlightAndHotel:
                break;

            case BookingType.Flight:
                break;

            case BookingType.Hotel:
                HotelSelector.Click();
                break;

            case BookingType.Transfer:
                break;

            case BookingType.Extra:
                break;

            case BookingType.CarHire:
                break;

            case BookingType.AdHocProperty:
                break;

            default:
                break;
            }
        }
コード例 #2
0
 //methods
 internal SearchResultPage FillOutFormAndSubmit(BookingConfiguration bookingConfig)
 {
     if (IsVisible)
     {
         //choose type of booking
         SetBookingType(bookingConfig);
         //hotel name
         HotelNameField.SendKeys(bookingConfig.HotelName);
         Wait.Until(ExpectedConditions.ElementToBeClickable(HotelNameContainer));
         HotelNameField.SendKeys(Keys.Enter);
         //date of arrival and duration
         ArrivalMonthSelector.SelectByText(bookingConfig.ArrivalMonth);
         ArrivalDaySelector.SelectByText(bookingConfig.ArrivalDay);
         DurationSelector.SelectByText(bookingConfig.Duration);
         //guest configuration settings
         NumberOfRoomsSelector.SelectByText(bookingConfig.NumberOfRooms.ToString());
         NumberOfAdultsSelector.SelectByText(bookingConfig.NumberOfAdultsRoom1.ToString());
         NumberOfChildrenSelector.SelectByText(bookingConfig.NumberOfChildrenRoom1.ToString());
         NumberOfInfantsSelector.SelectByText(bookingConfig.NumberOfInfantsRoom1.ToString());
         //property source setting
         AllPropertySourceCheckBox.Click();
         OwnPropertyCheckBox.Click();
         //submit search
         SearchButton.Click();
         Wait.Until(ExpectedConditions.ElementIsVisible(ResultHolder));
         return(new SearchResultPage(Driver));
     }
     else
     {
         Console.WriteLine($"Booking Search page is not visible. Expected: {PageTitle}, " +
                           $"Actual: {Driver.Title}");
         return(null);
     }
 }
コード例 #3
0
        public void TC01_SingleRoomBookingFor1Adult()
        {
            BookingConfig = new BookingConfiguration(BookingType.Hotel, "S02 Test Property (Marbella)", "Nov '19", "15 (Fri)", "1",
                                                     1, 1, 0, 0, PropertySource.Own);
            Member = new TradeMember("Sanyi Test Trade Member", "Sandor Bucsi", PaymentType.Invoice);

            var bookingMenuPage = BookingFlow();

            Assert.IsTrue(bookingMenuPage.IsVisible);
        }
コード例 #4
0
        public void TC02_SingleRoomBookingFor2Adults()
        {
            //configurations
            BookingConfig = new BookingConfiguration(BookingType.Hotel, "S02 Test Property (Marbella)", "Nov '19", "27 (Wed)", "3",
                                                     1, 2, 0, 0, PropertySource.Own);
            Member = new TradeMember("Sanyi Test Trade Member", "Sandor Bucsi", PaymentType.CreditCard);

            var bookingMenuPage = BookingFlow();

            Assert.IsTrue(bookingMenuPage.IsVisible);
        }
コード例 #5
0
        private void FillGuest(GuestDetailsPage guestDetailsPage, BookingConfiguration configuration)
        {
            //Fill out lead guest info (1st room, 1st adult guest - mandatory (TC 01 - 10)
            LeadGuest leadGuest = new LeadGuest("Mr", "Test", "Test", "10 Feb 1979", "37314829992");

            guestDetailsPage.FillOutLeadGuestInfo(leadGuest);
            //Fill out 2nd adult guest information for 1st room, if that guest exists (TC 02 - 05, 07, 09, 10)
            if (configuration.NumberOfAdultsRoom1 >= 2)
            {
                Guest adult2 = new Guest("Mrs", "TBA", "TBA", "24 Jul 1986");
                guestDetailsPage.FillOutGuestInfo(adult2);
                //Fill out 3rd adult guest information for 1st room in case of 3A configuration (TC 07)
                if (configuration.NumberOfAdultsRoom1 == 3)
                {
                    Guest adult3 = new Guest("Mr", "TA", "TA", "11 Oct 1990");
                }
                //Fill out 1st Child data in addition to 2 adults, if child exists (TC 03, 04, 09)
                if (configuration.NumberOfChildrenRoom1 >= 1)
                {
                    Guest child1 = new Guest("Mr", "Child", "Child", "11 Oct 2011");

                    //Fill out 2nd child information for 1st room in case of 2A2C configuration (TC 03)
                    if (configuration.NumberOfChildrenRoom1 == 2)
                    {
                        Guest child2 = new Guest("Mr", "SecChild", "SecChild", "20 Aug 2008");
                    }
                    //Fill out Infant information for 1st room in case of 2A1C1I configuration (TC 04, 09)
                    if (configuration.NumberOfInfantsRoom1 == 1)
                    {
                        Guest infant1 = new Guest("Mr", "Infant", "Infant", "15 Mar 2019");
                    }
                }
            }
            //Fill out Infant data for 1st room in case of 1A1I configuration (TC 08)
            if (configuration.NumberOfAdultsRoom1 == 1 && configuration.NumberOfInfantsRoom1 == 1)
            {
                Guest infant1 = new Guest("Mr", "Infant", "Infant", "15 Mar 2019");
            }
        }