//methods
 internal void FillOutLeadGuestInfo(LeadGuest leadGuest)
 {
     if (IsVisible)
     {
         LeadGuestTitleSelector.SelectByText(leadGuest.Title);
         LeadGuestFirstNameTextBox.SendKeys(leadGuest.FirstName);
         LeadGuestLastNameTextBox.SendKeys(leadGuest.LastName);
         LeadGuestPhoneTextBox.SendKeys(leadGuest.EmergencyPhone);
         Guest1Title.SendKeys(leadGuest.Title);
         Guest1FirstName.SendKeys(leadGuest.FirstName);
         Guest1LastName.SendKeys(leadGuest.LastName);
         Guest1BirthDate.SendKeys(leadGuest.BirthDate);
     }
     else
     {
         Console.WriteLine($"Lead Guest page is not visible. Expected: {PageTitle}, " +
                           $"Actual: {Driver.Title}");
     }
 }
コード例 #2
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");
            }
        }