Esempio n. 1
0
        public void BookingTitle()
        {
            utilities.ConsoleMessageStart();
            utilities.extenttest = utilities.extent.StartTest("Booking Title Validation");
            utilities.extenttest.AssignCategory("Booking Summary Tests");
            callingloginmethods();
            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(2000);
            bookingsummaryMain.AddTitleDetails();
            bookingsummaryMain.AddHostDetails();
            Thread.Sleep(2000);
            bookingsummaryMain.SingleBookingSave();
            Thread.Sleep(3000);
            bookingsummaryMain.AcceptSaveBookingPopUP();
            Thread.Sleep(3000);

            var bookingtitletext = this.Map.BookingTitleInput.GetAttribute("Value");

            Console.WriteLine(bookingtitletext);

            Thread.Sleep(3000);

            GetReferenceNumber();
            Thread.Sleep(3000);

            utilities.DBConnect("SELECT ReferenceNumber, Title From [Booking] where ReferenceNumber = '" + refNumber + "'");

            Thread.Sleep(3000);

            if (Bookingtitle == bookingtitletext && utilities.data.Contains(refNumber) && utilities.data.Contains(Bookingtitle))
            {
                Console.WriteLine("Test Pass");
                utilities.extenttest.Log(LogStatus.Pass, "Assert pass ");
                Assert.Pass();
            }
            else
            {
                Console.WriteLine("Booking title entered and booking title saved doesn't match.");
                Assert.Fail();
            }
        }
Esempio n. 2
0
 public void AllowMultipleHostsYes()
 {
     //Utilities config for reporting
     utilities.ConsoleMessageStart();
     utilities.extenttest = utilities.extent.StartTest("Allow Mulitple Hosts Yes");
     utilities.extenttest.AssignCategory("Business Rule Settings Tests");
     //Setup test configurations
     callLoginMethods();
     adminMain.AccessAdminModule();
     adminMain.BRESettingsLink();
     BREMain.SelectAllowMultipleHostsYes();
     //Logout and login to refresh setting changes
     //BREMain.ReLogin();
     callReLoginMethods();
     //Run actual test actions
     newBookingMain.AccessingNewBookingLink();   //Access new booking tab
     //newBookingMain.SingleBookingSummary();  //search for single booking and go to summary
     //START new booking creation
     newBookingMain.DurationHourDropdown();
     newBookingMain.DurationHourDropdown();
     newBookingMain.ResourceTypeDropdown();
     Thread.Sleep(2000);
     newBookingMain.SearchButton();
     Thread.Sleep(2000);
     newBookingMain.SelectingFirstResource();
     Thread.Sleep(2000);
     newBookingMain.GoToSummary();
     Thread.Sleep(4000);
     //END new booking creation
     _bookingSummaryMain.AddTitleDetails();           //Add title
     _bookingSummaryMain.AddHostDetails();            //Add Host
     _bookingSummaryMain.AddExternalHostDetails();    //Add 2nd host as an external host
     //If popup displays case fails - If no popup display case passes
     try
     {
         driver.SwitchTo().Alert();
         Console.WriteLine("Adding multiple hosts failed.");
         Assert.Fail();
     }
     catch (NoAlertPresentException Ex)
     {
         Console.WriteLine("Adding multiple hosts passed.");
         utilities.extenttest.Log(LogStatus.Pass, "Assert pass ");
         Assert.Pass();
     }
 }
        //From Date Validation
        public void FromDateValidation()
        {
            utilities.ConsoleMessageStart();
            utilities.extenttest = utilities.extent.StartTest("From Date Validation");
            utilities.extenttest.AssignCategory("New Booking Tests");
            callingloginmethods();
            newbookingMain.AccessingNewBookingLink();
            newbookingMain.FromDate();
            Thread.Sleep(2000);
            newbookingMain.ToDate();
            Thread.Sleep(2000);
            newbookingMain.ResourceTypeDropdown();
            newbookingMain.SearchButton();
            Thread.Sleep(4000);
            newbookingMain.SelectingFirstResource();
            Thread.Sleep(2000);
            var getsearchStartTime = this.Map.FromDateInput.GetAttribute("value");
            var getsearchEndTime   = this.Map.ToDateInput.GetAttribute("value");

            newbookingMain.GoToSummary();
            Thread.Sleep(4000);
            var getBookingstartTime = this.Map.BookingsummarystartTime.Text;
            var getBookingendTime   = this.Map.BookingsummaryendTime.Text;

            Console.WriteLine("Start Time : " + getBookingstartTime + " & " + "End Time : " + getBookingendTime);
            Console.WriteLine("Search Start Time : " + getsearchStartTime + " & " + "Search End Time : " + getsearchEndTime);

            if (getBookingstartTime == getsearchStartTime && getBookingendTime == getsearchEndTime)
            {
                Console.WriteLine("Both Start time and End Time Matches");
                utilities.extenttest.Log(LogStatus.Pass, "Assert pass ");
                Assert.Pass();
            }
            else
            {
                Console.WriteLine("Start or End time not correct");
                Assert.Fail();
            }
        }