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(); } }
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(); } }
public void Case3622()//Assign to Sumit - Done { utilities.ConsoleMessageStart(); utilities.extenttest = utilities.extent.StartTest("TFS Case 3622 Resource notes not displaying on My bookings page"); utilities.extenttest.AssignCategory("Case 3622. Resource notes not showing on my bookings page."); webappLogin.NavigateTo(); webappLogin.LogInSuccess(); //WebApp Login Thread.Sleep(4000); try { NewBookingMain.AccessingNewBookingLink();//New booking link NewBookingMain.FromDate(); Thread.Sleep(2000); NewBookingMain.ToDate(); Thread.Sleep(1000); NewBookingMain.SearchButton(); Thread.Sleep(1000); NewBookingMain.SelectMultiResourceforBooking();// Select multiresource for booking Thread.Sleep(1000); NewBookingMain.GoToSummary(); Thread.Sleep(2000); booking.BookingTitle(); Thread.Sleep(2000); NewBookingMain.participantcount(); // Add no of paricipant Thread.Sleep(2000); NewBookingMain.AddPeople(); // click on Add People tab Thread.Sleep(2000); webAppBookingSummaryMain.internalsearchbox(); // Search for internal Atendee Thread.Sleep(2000); webAppBookingSummaryMain.internalsearchboxfornextAttendee(); Thread.Sleep(2000); NewBookingMain.SelectAttendeeforresource();// select attendee for booking Thread.Sleep(1000); booking.SaveandexistBooking(); 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); mybookings.MyBookingsSelect(); Thread.Sleep(1000); editBookingMain_s.EditBookingPencil(); Thread.Sleep(2000); booking.EditForAddPeople(); Thread.Sleep(1000); booking.QBAteendee();//Verify Assign Attendee added from Webapp with respective Resource Thread.Sleep(1000); Console.WriteLine("TFS case 3622 run Sucessfully! "); } catch { Console.WriteLine("TFS case 3622 Failed !!"); } }