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 void ClassTeacherPupilAddressDetailsAccess(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); SharedComponents.HomePages.TaskMenuBar menu = new SharedComponents.HomePages.TaskMenuBar(); menu.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(); Assert.IsTrue(QuickControlAccess.canViewPupilAddressDetails(SeleniumHelper.iSIMSUserType.ClassTeacher, surnameSetup)); }
public void DisplayPupilAddressDetails(string forenameSetup, string surnameSetup, string gender, string dateOfBirth, string DateOfAdmission, string yearGroup, string[] currentAddress) { #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); //Address Add #region AutomationSugar.NavigateMenu("Tasks", "Pupils", "Pupil Records"); AutomationSugar.WaitForAjaxCompletion(); var pupilRecordTriplet = new PupilRecordTriplet(); pupilRecordTriplet.SearchCriteria.PupilName = String.Format("{0}, {1}", surnameSetup, forenameSetup); pupilRecordTriplet.SearchCriteria.Search(); POM.Helper.SeleniumHelper.Sleep(2); pupilRecordTriplet.SearchCriteria.PupilName = ""; pupilRecordTriplet.SearchCriteria.PupilName = String.Format("{0}, {1}", surnameSetup, forenameSetup); 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}", surnameSetup, forenameSetup))); var pupilRecord = pupilSearchTile == null ? null : pupilSearchTile.Click <PupilRecordPage>(); // pupilSearchTile.Click<PupilRecordPage>(); // Thread.Sleep(1000); // Assert.AreNotEqual(null, pupilRecord, "Did not find pupil"); // 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(); } else { throw new Exception(); } AutomationSugar.WaitForAjaxCompletion(); #endregion AddressBookSearchPage searchBox = new AddressBookSearchPage(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(forenameSetup); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); POM.Helper.SeleniumHelper.Sleep(2); Assert.IsTrue(popup.IsAddressDisplayed()); }
public void TC_ATT07_Validate_Deal_with_Chosen_Code_functionality(string foreName, string surName, string gender, string DOB, string dateOfAdmission, string yearGroup, string className, string academicYear, string searchMark) { SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator); #region Pre-Condition //Navigate to Pupil Record SeleniumHelper.NavigateQuickLink("Pupil Records"); var pupilRecords = new PupilRecordTriplet(); //Add new pupil var addNewPupilDialog = pupilRecords.AddNewPupil(); addNewPupilDialog.Forename = foreName; addNewPupilDialog.SurName = surName; addNewPupilDialog.Gender = gender; addNewPupilDialog.DateOfBirth = DOB; var registrationDetailDialog = addNewPupilDialog.Continue(); registrationDetailDialog.DateOfAdmission = dateOfAdmission; registrationDetailDialog.YearGroup = yearGroup; registrationDetailDialog.ClassName = className; registrationDetailDialog.CreateRecord(); var confirmRequiredDialog = new ConfirmRequiredDialog(); confirmRequiredDialog.ClickOk(); //Save pupil //var pupilRecord = PupilRecordPage.Create(); //pupilRecord.SavePupil(); SeleniumHelper.CloseTab("Pupil Record"); #endregion #region Test steps //Navigate to Deal with Chosen SeleniumHelper.NavigateMenu("Tasks", "Attendance", "Deal with Specific Marks"); var dealwithCodes = new DealWithSpecifcMarksTriplet(); //Select Search Criteria dealwithCodes.SearchCriteria.SelectAcademicYear = academicYear; dealwithCodes.SearchCriteria.SelectMark = searchMark; dealwithCodes.SearchCriteria.YearGroup = "Year 2"; var dealChosenCode = dealwithCodes.SearchCriteria.Search <DealWithSpecificMarkPage>(); //Input by keyboard dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][1].Marks = "/"; dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][2].Marks = "\\"; dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][3].Marks = "/"; //Input by drop-down dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][4].MarkDropDown = "A"; dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][5].MarkDropDown = "C"; //Save dealChosenCode.Save(); //Verify input marksRow = dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)]; Assert.AreEqual("/", marksRow[1].Marks, "Cannot input by keyboard"); Assert.AreEqual("\\", marksRow[2].Marks, "Cannot input by keyboard"); Assert.AreEqual("/", marksRow[3].Marks, "Cannot input by keyboard"); Assert.AreEqual("A", marksRow[4].Marks, "Cannot input by dropdown"); Assert.AreEqual("C", marksRow[5].Marks, "Cannot input by dropdown"); Assert.AreEqual("A", marksRow[6].Marks, "Cannot input by code list"); Assert.AreEqual("B", marksRow[7].Marks, "Cannot input by code list"); Assert.AreEqual("C", marksRow[8].Marks, "Cannot input by code list"); //Verify can edit in mode overwrite dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][1].MarkDropDown = "A"; Assert.AreEqual("A", dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][1].Text, "Mark cannot be edit in overwrite mode by dropdown"); dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][2].Select(); dealChosenCode.Code = "B"; Assert.AreEqual("B", dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][2].Text, "Mark cannot be edit in overwrite mode by select from code list"); //Verify cannot edit with invalid value dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][3].Marks = "T"; Assert.AreEqual("/", dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][3].Text, "Mark can be edit with invalid value by keyboard"); //Add comment var addComment = dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][1].AddComment(); addComment.Comment = "Test Comment"; addComment.ClickOk(); //Save dealChosenCode.Save(); //Verify comment dealChosenCode = dealChosenCodes.SearchCriteria.Search <DealWithChosenPage>(); addComment = dealChosenCode.Marks[String.Format("{0}, {1}", surName, foreName)][1].AddComment(); Assert.AreEqual("Test Comment", addComment.Comment, "Can not add comment in Deal with Chosen code page"); addComment.ClickCancel(); //Verify mark of Edit Mark page SeleniumHelper.NavigateQuickLink("Edit Marks"); var editMarkTriplet = new EditMarksTriplet(); editMarkTriplet.SearchCriteria.Week = true; editMarkTriplet.SearchCriteria.SelectClass(className); editMarkTriplet.SearchCriteria.SelectYearGroup(yearGroup); var editMarks = editMarkTriplet.SearchCriteria.Search <EditMarksPage>(); var marks = editMarks.Marks[String.Format("{0}, {1}", surName, foreName)]; Assert.AreEqual("A", marks[1].Text, "Change in Deal Chosen Screen is not record"); Assert.AreEqual("B", marks[2].Text, "Change in Deal Chosen Screen is not record"); Assert.AreEqual("/", marks[3].Text, "Change in Deal Chosen Screen is not record"); Assert.AreEqual("A", marks[4].Text, "Change in Deal Chosen Screen is not record"); Assert.AreEqual("C", marks[5].Text, "Change in Deal Chosen Screen is not record"); Assert.AreEqual("A", marks[6].Text, "Change in Deal Chosen Screen is not record"); Assert.AreEqual("B", marks[7].Text, "Change in Deal Chosen Screen is not record"); Assert.AreEqual("C", marks[8].Text, "Change in Deal Chosen Screen is not record"); #endregion }