public void OpenDummyBooking()
 {
     bookingsMain.AccessBookingSearchLink();
     newBookingMain.AccessExistingBookingSummary();
     Thread.Sleep(2000);
 }
Exemplo n.º 2
0
        public void Case3621()
        {
            utilities.ConsoleMessageStart();
            utilities.extenttest = utilities.extent.StartTest("TFS Case 3620 Resource notes not displaying on My bookings page");
            utilities.extenttest.AssignCategory("Case 3620. Resource notes not showing on my bookings page.");
            webappLogin.NavigateTo();
            webappLogin.LogInSuccess();  //WebApp Login
            Thread.Sleep(4000);
            admin.AccessAdminModule();   //Access Admin Module
            admin.AccessSettings();      //Access Settings Tab
            admin.StatusLink();          //Click on Status Link
            webappStatus.AddNewStatus(); //Creating New Status
            string statusName = webappStatus.StatusName;

            Console.WriteLine(statusName);

            Thread.Sleep(2000);

            //Open New Tab in the Same window and continue on the new Window.
            ((IJavaScriptExecutor)driver).ExecuteScript("window.open();");
            driver.SwitchTo().Window(driver.WindowHandles.Last());

            Thread.Sleep(2000);
            login.NavigateTo();                 //Navigate to QB
            login.LoginSuccess();               //Login to QB
            Thread.Sleep(4000);
            homepage.SelectResource();          //Selecting a Resource
            login.Wait();
            attendees.AddingInternalAttendee(); //Adding Internal Attendee
            Thread.Sleep(2000);
            homepage.NextButton();              //Go to next Page
            Thread.Sleep(2000);
            booking.BookingTitle();
            var refnumber = this.driver.FindElement(By.XPath("//*[@id='page-wrap']/section[2]/div[1]/div/div[3]/span")).Text;

            Console.WriteLine(refnumber);
            Thread.Sleep(3000);

            driver.SwitchTo().Window(driver.WindowHandles.First());

            Thread.Sleep(2000);
            webAppBookingsMain.AccessBookingSearchLink();

            Thread.Sleep(2000);
            this.BookingSearchRefMap.BookingRefNumber.SendKeys(refnumber);

            this.BookingSearchRefMap.BookingSearchSearchButton.Click();


            this.BookingSearchRefMap.BookingLinkWhenSearchByRefNumber.Click();

            SelectElement select = new SelectElement(this.BookingSummaryRefMap.BookingStatusDropdown);

            select.SelectByText(statusName);
            Thread.Sleep(2000);

            this.BookingSummaryRefMap.SaveButton.Click();
            webAppBookingSummaryMain.AcceptSaveBookingPopUP();

            driver.SwitchTo().Window(driver.WindowHandles.Last());

            mybookings.MyBookingsSelect();
            Thread.Sleep(3000);


            utilities.DBConnect("SELECT BookingID, StartTime FROM [Booking] where ReferenceNumber = '" + refnumber + "'");
            Thread.Sleep(2000);
            string D1 = utilities.data[0];
            string D2 = utilities.data[1];


            Console.WriteLine("D1: " + D1);
            Console.WriteLine("D2 : " + D2);

            //Pasing the date value in Text box
            IWebElement         element = driver.FindElement(By.CssSelector(".mybooking-calendar .text-box"));
            IJavaScriptExecutor jse     = (IJavaScriptExecutor)driver;

            jse.ExecuteScript("arguments[0].value='" + D2 + "';", element);

            driver.FindElement(By.CssSelector(".mybooking-calendar .text-box")).SendKeys(Keys.Enter);

            Thread.Sleep(2000);

            this.driver.FindElement(By.XPath("//*[@id='page-wrap']/section[3]/span[1]")).Click();

            Thread.Sleep(2000);
        }