public static bool KeyDownNavigationOnPupilResults(SeleniumHelper.iSIMSUserType user) { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(user); SearchResultTile srt = searchBox.EnterSearchTextForPupils("ad"); int resultCount = srt.tileCount(); bool traversed = false; Actions action = new Actions(WebContext.WebDriver); action.SendKeys(Keys.Tab).Perform(); action.SendKeys(Keys.Tab).Perform(); for (var index = 0; index < resultCount; index++) { action.SendKeys(OpenQA.Selenium.Keys.Down).Perform(); String classNameForStrongTags = srt.getClassForStrongname(index); if (classNameForStrongTags.Contains("tt-selectable")) { traversed = true; } else { return(false); } } return(traversed); }
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 SysMgrCanNotAccessCurrentPupilAddress() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.SystemManger); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsFalse(popup.IsAddressDisplayed()); }
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 SysMgrCanAccessCurrentPupil_DOB_Name() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.SystemManger); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsTrue(popup.GetPupilBasicDetailsNameDOB()); }
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()); }
public void RMCanAccessCurrentPupilAddress(string forenameSetup, string surnameSetup, string gender, string dateOfBirth, string DateOfAdmission, string yearGroup, string[] currentAddress) { #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); //Address Add #region SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator); TaskMenuBar taskMenuInstance = new TaskMenuBar(); taskMenuInstance.WaitForTaskMenuBarButton(); AutomationSugar.NavigateMenu("Tasks", "Pupils", "Pupil Records"); AutomationSugar.WaitForAjaxCompletion(); var pupilRecords = new PupilRecordTriplet(); pupilRecords.SearchCriteria.PupilName = String.Format("{0}, {1}", surnameSetup, forenameSetup); pupilRecords.SearchCriteria.IsCurrent = true; var pupilSearchResults = pupilRecords.SearchCriteria.Search(); AutomationSugar.WaitForAjaxCompletion(); // This sometimes takes an eternity PupilRecordTriplet.PupilRecordSearchResultTile pupilTile = null; for (var cnt = 0; cnt < 10; cnt++) { Thread.Sleep(5000); pupilTile = pupilSearchResults.FirstOrDefault(t => t.Name.Equals(String.Format("{0}, {1}", surnameSetup, forenameSetup))); if (pupilTile != null) { break; } } var pupilRecord = pupilTile.Click <PupilRecordPage>(); AutomationSugar.WaitForAjaxCompletion(); pupilRecord.SelectAddressesTab(); var addAddress = pupilRecord.ClickAddAddress(); addAddress.ClickManualAddAddress(); addAddress.BuildingNo = currentAddress[0]; addAddress.BuildingName = currentAddress[1]; addAddress.Flat = currentAddress[2]; addAddress.Street = currentAddress[3]; addAddress.District = currentAddress[4]; addAddress.City = currentAddress[5]; addAddress.County = currentAddress[6]; addAddress.PostCode = currentAddress[7]; addAddress.CountryPostCode = currentAddress[8]; addAddress.ClickOk(5); //Save pupilRecord.SavePupil(); AutomationSugar.WaitForAjaxCompletion(); #endregion POM.Helper.SeleniumHelper.Logout(); AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.ReturnsManager); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(surnameSetup); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsTrue(popup.IsAddressDisplayed()); }