public void CheckPupilResultsOrder(string forenameSetup, string surnameSetup, string gender, string dateOfBirth, string DateOfAdmission, string yearGroup) { #region Data Preparation SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator); TaskMenuBar taskMenuInstance = new TaskMenuBar(); taskMenuInstance.WaitForTaskMenuBarButton(); DateTime dobSetup = Convert.ToDateTime(dateOfBirth); DateTime dateOfAdmissionSetup = Convert.ToDateTime(DateOfAdmission); var learnerIdSetup = Guid.NewGuid(); var BuildPupilRecord = this.BuildDataPackage(); #endregion BuildPupilRecord.AddBasicLearner(learnerIdSetup, surnameSetup, forenameSetup, dobSetup, dateOfAdmissionSetup, genderCode: "1", enrolStatus: "C"); DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: BuildPupilRecord); AddressBookSearchPage searchBox = new AddressBookSearchPage(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(surnameSetup); POM.Helper.SeleniumHelper.Sleep(2); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(surnameSetup); var selectedElements = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId("PreferredListName_Learner"))); Assert.That(selectedElements[0].Text.Contains(forenameSetup)); }
public void PromptToSaveChangesOnNavigationToOtherScreen() { #region Data Pupil Setup #region Create a new pupil, so that it can be attached later to the newly created contact1 AutomationSugar.Log("Data Creation started"); Guid pupilId = Guid.NewGuid(); DataPackage dataPackage = this.BuildDataPackage(); var pupilSurname = Utilities.GenerateRandomString(10, "LinkForPupil2"); var pupilForename = Utilities.GenerateRandomString(10, "LinkForPupil2" + Thread.CurrentThread.ManagedThreadId); dataPackage.AddBasicLearner(pupilId, pupilSurname, pupilForename, new DateTime(2005, 10, 01), new DateTime(2012, 08, 01)); #endregion DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: dataPackage); #endregion SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator); NavigateToOtherScreen.GoToRoomScreen(); RoomPage SchoolRoomPage = new RoomPage(); SchoolRoomPage.CreateSchoolRoom(); SchoolRoomPage.EnterShortName("Rm60"); AddressBookSearchPage searchBox = new AddressBookSearchPage(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(pupilForename); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); popup.ClickPupilDetailsLink(); popup.WaitForConfirmationDialogToAppear(); WebContext.Screenshot(); bool DialogDisplayed = SeleniumHelper.Get("save_continue_commit_dialog").Displayed; Assert.IsTrue(DialogDisplayed, "Failure to popup confirmation Dialog"); }
public void AddNewManualCommunicationLog() { String[] featureList = { "CommunicationLogs" }; SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator, featureList); AddressBookSearchPage searchBox = new AddressBookSearchPage(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils("ad"); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); popup.ClickCommunicationLogLink(); Wait.WaitForDocumentReady(); CommunicationLogDetail log = new CommunicationLogDetail(); AddLogDialog logDialog = log.AddNewCommunicationLog(); logDialog.SetMessageFormatType(); SeleniumHelper.Sleep(2); logDialog.SetCategory(); logDialog.Date = DateTime.Now.ToShortDateString(); logDialog.Description = "Test description"; logDialog.Refresh(); logDialog.Save(); }
public void LinkToPupilRecordFromPupilInfo() { #region Data Pupil Setup #region Create a new pupil, so that it can be attached later to the newly created contact1 AutomationSugar.Log("Data Creation started"); Guid pupilId = Guid.NewGuid(); DataPackage dataPackage = this.BuildDataPackage(); var pupilSurname = Utilities.GenerateRandomString(10, "LinkForPupil"); var pupilForename = Utilities.GenerateRandomString(10, "LinkForPupil" + Thread.CurrentThread.ManagedThreadId); dataPackage.AddBasicLearner(pupilId, pupilSurname, pupilForename, new DateTime(2005, 10, 01), new DateTime(2012, 08, 01)); #endregion DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: dataPackage); #endregion AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(pupilForename); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); popup.ClickPupilDetailsLink(); bool value = SeleniumHelper.Get(AddressBookElements.OpenedPupilRecordTab).Displayed; Assert.IsTrue(value); }
public void DisplayPupilTelephoneDetails(string pupilSurName, string pupilForeName, string gender, string dateOfBirth, string DateOfAdmission, string yearGroup, string telNo, string email) { #region Data Preparation SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator); TaskMenuBar taskMenuInstance = new TaskMenuBar(); taskMenuInstance.WaitForTaskMenuBarButton(); DateTime dobSetup = Convert.ToDateTime(dateOfBirth); DateTime dateOfAdmissionSetup = Convert.ToDateTime(DateOfAdmission); var learnerIdSetup = Guid.NewGuid(); var BuildPupilRecord = this.BuildDataPackage(); BuildPupilRecord.AddBasicLearner(learnerIdSetup, pupilSurName, pupilForeName, dobSetup, dateOfAdmissionSetup, genderCode: "1", enrolStatus: "C"); DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: BuildPupilRecord); AutomationSugar.NavigateMenu("Tasks", "Pupils", "Pupil Records"); var pupilRecordTriplet = new PupilRecordTriplet(); pupilRecordTriplet.SearchCriteria.PupilName = String.Format("{0}, {1}", pupilSurName, pupilForeName); POM.Helper.SeleniumHelper.Sleep(4); pupilRecordTriplet.SearchCriteria.Search(); var resultPupils = pupilRecordTriplet.SearchCriteria.Search(); int count = resultPupils.Count(); if (count == 1) { var pupilSearchTile = resultPupils.FirstOrDefault(t => t.Name.Equals(String.Format("{0}, {1}", pupilSurName, pupilForeName))); var pupilRecord = pupilSearchTile == null ? null : pupilSearchTile.Click <PupilRecordPage>(); pupilSearchTile.Click <PupilRecordPage>(); // Thread.Sleep(1000); // Assert.AreNotEqual(null, pupilRecord, "Did not find pupil"); // Add Pupil Telephone number pupilRecord.SelectPhoneEmailTab(); pupilRecord = new PupilRecordPage(); pupilRecord.ClickAddTelephoneNumber(); pupilRecord.TelephoneNumberTable[0].TelephoneNumber = telNo; // Add Email Address pupilRecord.ClickAddEmailAddress(); pupilRecord.EmailTable[0].EmailAddress = email; pupilRecord = PupilRecordPage.Create(); pupilRecord.SavePupil(); //Assert // Assert.AreEqual(true, pupilRecord.IsSuccessMessageDisplayed(), "Success message is not display"); #endregion AddressBookSearchPage searchBox = new AddressBookSearchPage(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(pupilSurName); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsTrue(popup.IsPupilTelephoneDisplayed()); } else { throw new Exception(); } }
public static bool CanTabToQuickSearchOnChrome(SeleniumHelper.iSIMSUserType userType) { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationOnTabChrome(userType); searchBox.ClearText(); searchBox.textSearch.SendKeys("ad"); string value = SeleniumHelper.Get(AddressBookElements.LinkAddressBook).GetAttribute("aria-expanded"); return(value == "true"); }
public void SysMgrCanNotAccessCurrentPupilAddress() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.SystemManger); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsFalse(popup.IsAddressDisplayed()); }
public void SysMgrCanAccessCurrentPupil_DOB_Name() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.SystemManger); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsTrue(popup.GetPupilBasicDetailsNameDOB()); }
public void SysMgrCanNotAccessPupilGenderDetails() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.SystemManger); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsTrue(popup.CheckPupilGenderDetailsForBlank()); }
public void CannotAccessCurrentPupilImage() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.ReturnsManager); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsFalse(popup.IsPupilImageDisplayed()); }
public void DisplayCurrentPupilImage() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils("ad"); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsTrue(popup.IsPupilImageDisplayed()); }
public void DisplayStaffAddressDetails(string buildingNo, string street, string district, string city, string postCode, string countryPostCode, string language, string placeOfWork, string jobTitle, string occupation, string priority, string relationship) { #region Arrange var staffId = Guid.NewGuid(); var forename = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook_address"); var surname = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook_address"); var startDate = DateTime.Today.AddDays(-1); var staffRecordData = StaffRecordPage.CreateStaffRecord(out staffId, forename, surname, startDate); DataSetup DataSetStaff = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: staffRecordData); #endregion SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.PersonnelOfficer); AutomationSugar.NavigateMenu("Tasks", "Staff", "Staff Records"); POM.Helper.Wait.WaitLoading(); var staffContactTriplet = new StaffRecordTriplet(); staffContactTriplet.SearchCriteria.StaffName = String.Format("{0}, {1}", surname, forename); //staffContactTriplet.SearchCriteria.Search(); //staffContactTriplet.SearchCriteria.Search(); var resultPupils = staffContactTriplet.SearchCriteria.Search(); int count = resultPupils.Count(); if (count == 1) { var staffSearchTile = resultPupils.FirstOrDefault(t => t.Name.Equals(String.Format("{0}, {1}", surname, forename))); var staffRecord = staffSearchTile == null ? null : staffSearchTile.Click <StaffRecordPage>(); staffSearchTile.Click <StaffRecordPage>(); staffRecord.SelectAddressesTab(); var addAddressDialog = staffRecord.ClickAddAddress(); addAddressDialog.ClickManualAddAddress(); // Add new address addAddressDialog.BuildingNo = buildingNo; addAddressDialog.Street = street; addAddressDialog.District = district; addAddressDialog.City = city; addAddressDialog.PostCode = postCode; addAddressDialog.CountryPostCode = countryPostCode; addAddressDialog.ClickOk(); AutomationSugar.Log("Created a new address to the staff record"); staffContactTriplet.ClickSave(); } AddressBookSearchPage searchBox = new AddressBookSearchPage(); searchBox.ClearText(); searchBox.EnterSearchTextForStaff(surname); searchBox.ClickOnFirstStaffRecord(); AddressBookPopup popup = new AddressBookPopup(); popup.GetStaffBasicDetails(); Assert.IsTrue(popup.IsAddressDisplayed()); }
public void DynamicallyDisplayHideResultSection() //For no results { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.textSearch.SendKeys(invalidtextForSearch); searchBox.waitForPupilResultstoAppear(); String NoResultElementtileTitle = SeleniumHelper.Get("result_tile_scroll").Text; Assert.True(NoResultElementtileTitle == AddressBookConstants.TitleForNoResultsfound, "No results found text didn't appear"); //Assertion for title if records are not found }
public static bool canViewBasicDetailsCurrentPupil(SeleniumHelper.iSIMSUserType userType, string textForSearch) { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(userType); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); WebContext.Screenshot(); return(popup.GetPupilBasicDetails()); }
//Returns true if popup is shown else false public static bool MinimumCharacterRequiredToGetResult(SeleniumHelper.iSIMSUserType userType, string charToSearch) { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationOnTab(userType); searchBox.ClearText(); searchBox.textSearch.SendKeys(charToSearch); bool value = SeleniumHelper.Get(AddressBookElements.PlaceHolderForResults).Displayed; System.Threading.Thread.Sleep(500); SeleniumHelper.Get(AddressBookElements.HomeScreen).Click(); return(value); }
public void DisplayPupilResultsClassYearGroupDetails() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); searchBox.ClickOnFirstPupilRecord(); Assert.IsTrue(searchBox.GetClassYear()); if (true) { WebContext.Screenshot(); } }
public void CheckResultCountForNonExistingPupils() //For invalid pupils { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(InvalidtextForSearch); int resultCount = searchBox.CheckForResultsAvailability(InvalidtextForSearch); Assert.That(resultCount == 0); if (true) { WebContext.Screenshot(); } }
public void CheckResultCountForNonExistingStaff() //For invalid staff { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.textSearch.SendKeys(InvalidtextForSearch); int resultCount = searchBox.CheckForStaffAvailability(InvalidtextForSearch); Assert.That(resultCount == 0); if (true) { WebContext.Screenshot(); } }
public static int hasPermissionToSearchCurrentPupil(SeleniumHelper.iSIMSUserType userType, string textForSearch) { SeleniumHelper.Login(userType); TaskMenuBar taskMenuInstance = new TaskMenuBar(); taskMenuInstance.WaitForTaskMenuBarButton(); AddressBookSearchPage searchBox = new AddressBookSearchPage(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); int resultCount = searchBox.CheckForResultsAvailability(textForSearch); return(resultCount); }
public void DisplayStaffEmailDetails() { #region Arrange var staffId = Guid.NewGuid(); var forename = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook_Email"); var surname = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook_Email"); var startDate = DateTime.Today.AddDays(-1); var staffRecordData = StaffRecordPage.CreateStaffRecord(out staffId, forename, surname, startDate); DataSetup DataSetStaff = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: staffRecordData); #endregion SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.PersonnelOfficer); AutomationSugar.NavigateMenu("Tasks", "Staff", "Staff Records"); POM.Helper.Wait.WaitLoading(); var staffContactTriplet = new StaffRecordTriplet(); staffContactTriplet.SearchCriteria.StaffName = String.Format("{0}, {1}", surname, forename); //staffContactTriplet.SearchCriteria.Search(); //staffContactTriplet.SearchCriteria.Search(); var resultPupils = staffContactTriplet.SearchCriteria.Search(); int count = resultPupils.Count(); if (count == 1) { var staffSearchTile = resultPupils.FirstOrDefault(t => t.Name.Equals(String.Format("{0}, {1}", surname, forename))); var staffRecord = staffSearchTile == null ? null : staffSearchTile.Click <StaffRecordPage>(); staffSearchTile.Click <StaffRecordPage>(); } string emailId = "*****@*****.**"; // Wait.WaitUntilDisplayed(By.CssSelector("[data-maintenance-container='LearnerContactTelephones']")); var Record = new StaffRecordPage(); Record.SelectPhoneEmailTab(); Record.ClickAddEmailId(); Record.EmailTable[0].EmailAddress = emailId; staffContactTriplet.ClickSave(); POM.Helper.SeleniumHelper.Logout(); AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(SeleniumHelper.iSIMSUserType.PersonnelOfficer); searchBox.ClearText(); searchBox.EnterSearchTextForStaff(surname); searchBox.ClickOnFirstStaffRecord(); AddressBookPopup popup = new AddressBookPopup(); popup.GetStaffBasicDetails(); Assert.IsTrue(popup.IsEmailDisplayed()); }
public void IdentifyResultForLeaver() //For invalid pupils { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(leaverPupil); int resultCount = searchBox.CheckForResultsAvailability(leaverPupil); String NoElementtileTitle = SeleniumHelper.Get("result_tile_scroll").Text; Assert.True(NoElementtileTitle == AddressBookConstants.TitleForNoResultsfound, "No results found diddn't appear"); //Assertion for title if records are not found if (true) { WebContext.Screenshot(); } }
public static bool TestAddressBookLinkFocusDefault() { System.Threading.Thread.Sleep(500); SeleniumHelper.Get(AddressBookElements.LinkAddressBook).Click(); AddressBookSearchPage searchBox = new AddressBookSearchPage(); searchBox.ClearText(); searchBox.textSearch.SendKeys("Able to send data immediately after Clicking on link"); System.Threading.Thread.Sleep(500); bool enabledSearchTextBox = searchBox.textSearch.Enabled; System.Threading.Thread.Sleep(500); searchBox.ClearText(); SeleniumHelper.Get(AddressBookElements.HomeScreen).Click(); return(enabledSearchTextBox); }
public void IdentifySectionHeaderForNoResultsFound() //For invalid staff { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.textSearch.SendKeys(InvalidtextForSearch); searchBox.waitForPupilResultstoAppear(); int resultCount = searchBox.CheckForStaffAvailability(InvalidtextForSearch); String NoElementtileTitle = SeleniumHelper.Get("result_tile_scroll").Text; Assert.True(NoElementtileTitle == AddressBookConstants.TitleForNoResultsfound, "No results found text didn't appear"); //Assertion for title if records are not found if (true) { WebContext.Screenshot(); } }
public static bool canViewPupilEmailDetails(SeleniumHelper.iSIMSUserType userType, string textForSearch) { SeleniumHelper.Login(userType); TaskMenuBar taskMenuInstance = new TaskMenuBar(); taskMenuInstance.WaitForTaskMenuBarButton(); AddressBookSearchPage searchBox = new AddressBookSearchPage(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); searchBox.ClickOnFirstPupilRecord(); AddressBookPopup popup = new AddressBookPopup(); popup.WaitForDialogToAppear(); return(popup.IsEmailDisplayed()); }
public void CheckStaffResultsOrder() { #region Arrange var staffId = Guid.NewGuid(); var forename = SeSugar.Utilities.GenerateRandomString(10, "ResultOrder_Staff"); var surname = SeSugar.Utilities.GenerateRandomString(10, "ResultOrder_Staff"); var startDate = DateTime.Today.AddDays(-1); var staffRecordData = StaffRecordPage.CreateStaffRecord(out staffId, forename, surname, startDate); DataSetup DataSetStaff = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: staffRecordData); #endregion SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator); AddressBookSearchPage searchBox = new AddressBookSearchPage(); searchBox.ClearText(); searchBox.EnterSearchTextForStaff(surname); var selectedElements = WebContext.WebDriver.FindElement(By.CssSelector(SeleniumHelper.AutomationId("search_result_tile_Staff"))); Assert.IsTrue(selectedElements.Text.Contains("resultorder_staff")); }
public void DisplayPupilContactBasicDetails() { #region Data Pupil Setup #region Create a new pupil, so that it can be attached later to the newly created contact1 AutomationSugar.Log("Data Creation started"); Guid pupilId = Guid.NewGuid(); DataPackage dataPackage = this.BuildDataPackage(); var pupilSurname = Utilities.GenerateRandomString(10, "CurrentPUPIL"); var pupilForename = Utilities.GenerateRandomString(10, "CurrentPUPIL" + Thread.CurrentThread.ManagedThreadId); dataPackage.AddBasicLearner(pupilId, pupilSurname, pupilForename, new DateTime(2005, 10, 01), new DateTime(2012, 08, 01)); #endregion #region Pre-Condition: Create new contact 1 and refer to pupil //Arrange AutomationSugar.Log("***Pre-Condition: Create new contact1 and refer to pupil"); Guid pupilContactId1 = Guid.NewGuid(); Guid pupilContactRelationshipId1 = Guid.NewGuid(); //Add pupil contact var contactSurname1 = Utilities.GenerateRandomString(10, "PupilContact_WithBasicDetails" + Thread.CurrentThread.ManagedThreadId); var contactForename1 = Utilities.GenerateRandomString(10, "PupilContact_WithBasicDetails" + Thread.CurrentThread.ManagedThreadId); dataPackage.AddPupilContact(pupilContactId1, contactSurname1, contactForename1); dataPackage.AddPupilContactRelationship(pupilContactRelationshipId1, pupilId, pupilContactId1); #endregion DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: dataPackage); #endregion AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForPupilContacts(contactForename1); searchBox.ClickOnFirstPupilContactRecord(); AddressBookPopup popup = new AddressBookPopup(); Assert.IsNotNull(AddressBookElements.DisplayPopup); Assert.IsTrue(popup.GetPupilContactBasicDetails()); }
public void SearchCurrentStaffByName(string textForSearch) { #region Arrange var staffId = Guid.NewGuid(); var forename = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook"); var surname = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook"); var startDate = DateTime.Today.AddDays(-1); var staffRecordData = StaffRecordPage.CreateStaffRecord(out staffId, forename, surname, startDate); DataSetup DataSetStaff = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: staffRecordData); #endregion AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForStaff(textForSearch); double millisecs = searchBox.SearchTimeInMillisecs; searchBox.Log("Results fetched in " + millisecs + " milliseconds"); Assert.Less(millisecs, AddressBookConstants.MaxAcceptableSearchTimeInMillisecs); }
public void DisplayStaffBasicDetails(string textForSearch) { #region Arrange var staffId = Guid.NewGuid(); var forename = SeSugar.Utilities.GenerateRandomString(10, "Sheila"); var surname = SeSugar.Utilities.GenerateRandomString(10, "Fortune"); var startDate = DateTime.Today.AddDays(-1); var staffRecordData = StaffRecordPage.CreateStaffRecord(out staffId, forename, surname, startDate); DataSetup DataSetStaff = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: staffRecordData); #endregion AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForStaff(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstStaffRecord(); Assert.IsTrue(popup.GetStaffBasicDetails()); }
public void DisplayPupilBasicDetails(string forenameSetup, string surnameSetup, string gender, string dateOfBirth, string DateOfAdmission, string yearGroup) { #region Data Preparation DateTime dobSetup = Convert.ToDateTime(dateOfBirth); DateTime dateOfAdmissionSetup = Convert.ToDateTime(DateOfAdmission); var learnerIdSetup = Guid.NewGuid(); var BuildPupilRecord = this.BuildDataPackage(); #endregion BuildPupilRecord.AddBasicLearner(learnerIdSetup, surnameSetup, forenameSetup, dobSetup, dateOfAdmissionSetup, genderCode: "1", enrolStatus: "C"); DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: BuildPupilRecord); AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(surnameSetup); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsTrue(popup.GetPupilBasicDetails()); }
public void DisplayPupilContactAssociatedToPupilDetails() { #region Data Pupil Setup #region Create a new pupil, so that it can be attached later to the newly created contact1 AutomationSugar.Log("Data Creation started"); Guid pupilId = Guid.NewGuid(); DataPackage dataPackage = this.BuildDataPackage(); var pupilSurname = Utilities.GenerateRandomString(10, "Communications_Surname"); var pupilForename = Utilities.GenerateRandomString(10, "Communications_Forename" + Thread.CurrentThread.ManagedThreadId); dataPackage.AddBasicLearner(pupilId, pupilSurname, pupilForename, new DateTime(2005, 01, 01), new DateTime(2012, 09, 01)); #endregion #region Pre-Condition: Create new contact 1 and refer to pupil //Arrange AutomationSugar.Log("***Pre-Condition: Create new contact1 and refer to pupil"); Guid pupilContactId1 = Guid.NewGuid(); Guid pupilContactRelationshipId1 = Guid.NewGuid(); //Add pupil contact var contactSurname1 = Utilities.GenerateRandomString(10, "SeleniumPupilContact1_Surname" + Thread.CurrentThread.ManagedThreadId); var contactForename1 = Utilities.GenerateRandomString(10, "SeleniumPupilContact1_Forename" + Thread.CurrentThread.ManagedThreadId); var titleContact1 = "Mrs"; dataPackage.AddPupilContact(pupilContactId1, contactSurname1, contactForename1); dataPackage.AddPupilContactRelationship(pupilContactRelationshipId1, pupilId, pupilContactId1); #endregion #endregion DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: dataPackage); AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(pupilForename); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.Greater(popup.HaveAssociatedPupil(), 1); }