//Navigate to BRE Settings public void NavigateToBRESettings() { adminMain.AccessAdminModule(); adminMain.BRESettingsLink(); Thread.Sleep(2000); }
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(); } }
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); }