예제 #1
0
        public void AllowMultipleLocationsYes()
        {
            //Utilities config for reporting
            utilities.ConsoleMessageStart();
            utilities.extenttest = utilities.extent.StartTest("Allow multi location bookings Yes");
            utilities.extenttest.AssignCategory("Business Rule Settings Tests");
            //Setup test configurations
            callLoginMethods();
            adminMain.AccessAdminModule();
            adminMain.BRESettingsLink();
            BREMain.SelectProperty();
            BREMain.SelectBookingCategory();
            BREMain.BookingCategoryOption1();
            if (this.Map.MultipleHostsYes.Selected) //check if option is already selected
            {
                //DO nothing
            }
            else
            {
                BREMain.SelectAllowMultipleHostsYes();
                callReLoginMethods();
            }
            //Run actual test actions
            newBookingMain.AccessingNewBookingLink();   //Access new booking tab
            //START new booking search criteria
            newBookingMain.DurationHourDropdown();
            newBookingMain.DurationHourDropdown();
            newBookingMain.ResourceTypeDropdown();
            //GET a 2nd property that has resources
            int a = newBookingMain.FindPropertyWithResources();

            //reset search
            newBookingMain.AccessingNewBookingLink();
            newBookingMain.DurationHourDropdown();
            newBookingMain.DurationHourDropdown();
            newBookingMain.ResourceTypeDropdown();
            Thread.Sleep(2000);
            newBookingMain.SearchButton();
            Thread.Sleep(2000);
            newBookingMain.SelectingFirstResource();
            Thread.Sleep(2000);
            newBookingMain.GoToSummary();
            Thread.Sleep(4000);     //Currently in summary with 1 resource selected from default property - int a is value for 2nd property
            _bookingSummaryMain.BookAnotherResource();
            newBookingMain.FindProperty(a);
            //VALDATION IF RESOURCES DISPLAY
            Assert.IsTrue(this.driver.FindElement(By.XPath("//*[@id='ctl00_MainContentPlaceHolder_grdSearchResults_ctl00']/tbody")).Displayed);
        }