Ejemplo n.º 1
0
        public void TC_AD08_Add_New_Applicant_View_Report(string sureName, string middleName, string foreName, string gender, string dateOfBirth,
                                                          string admissionGroup, string enrolmentStatus, string Class, string attendanceMode, string boarderStatus)
        {
            #region PRE-CONDITIONS:

            // Login as Admission
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.AdmissionsOfficer);

            // Navigate to Application page
            SeleniumHelper.NavigateMenu("Tasks", "Admissions", "Applications");
            var applicantTriplet = new ApplicationTriplet();

            //Search the Applicant is existing to change to Admitted
            applicantTriplet.SearchCriteria.SetStatus("Applied", true);
            applicantTriplet.SearchCriteria.SetStatus("Offered", true);
            applicantTriplet.SearchCriteria.SetStatus("Accepted", true);
            applicantTriplet.SearchCriteria.SearchByName = sureName;
            var searchResults = applicantTriplet.SearchCriteria.Search();
            var applicantTile = searchResults.SingleOrDefault(t => t.Code.Equals(sureName + ", " + foreName));
            applicantTriplet.ChangeToAdmit(applicantTile);

            #endregion

            #region STEPS:

            // Create new an Applicant
            var addNewApplicationDialog = applicantTriplet.AddNewApplicationDialog();
            addNewApplicationDialog.ForeName    = foreName;
            addNewApplicationDialog.MiddleName  = middleName;
            addNewApplicationDialog.SureName    = sureName;
            addNewApplicationDialog.Gender      = gender;
            addNewApplicationDialog.DateofBirth = dateOfBirth;

            // Add new informations on RegistrationDetails Dialog
            addNewApplicationDialog.Continue();
            // addNewApplicationDialog.ContiueCreateApplicant();
            var registrationDetailsDialog = new RegistrationDetailsDialog();
            registrationDetailsDialog.AdmissionGroup  = admissionGroup;
            registrationDetailsDialog.EnrolmentStatus = enrolmentStatus;
            registrationDetailsDialog.Class           = Class;
            registrationDetailsDialog.AttendanceMode  = attendanceMode;
            registrationDetailsDialog.BoarderStatus   = boarderStatus;
            registrationDetailsDialog.CreateRecord();
            var applicationPage = ApplicationPage.Create();

            applicantTriplet.SearchCriteria.SetStatus("Offered", false);
            applicantTriplet.SearchCriteria.SetStatus("Accepted", false);
            applicantTriplet.SearchCriteria.SearchByName = sureName;
            searchResults   = applicantTriplet.SearchCriteria.Search();
            applicantTile   = searchResults.SingleOrDefault(t => t.Code.Equals(sureName + ", " + foreName));
            applicationPage = applicantTile.Click <ApplicationPage>();

            // Verify that Applicant was created successfully
            Assert.AreEqual(foreName, applicationPage.LegalForeName, "LegalForName is not equal");
            Assert.AreEqual(sureName, applicationPage.LegalSureName, "LegalSurName is not equal");
            Assert.AreEqual(gender, applicationPage.Gender, "Gender is not equal");
            Assert.AreEqual(dateOfBirth, applicationPage.DateOfBirth, "Date of Birth is not equal");
            Assert.AreEqual(SeleniumHelper.GetMonthsAndYears(dateOfBirth), applicationPage.Age, "Ages is not equal");
            Assert.AreEqual("Applied", applicationPage.ApplicationStatus, "Application Status is not equal");
            Assert.AreEqual(admissionGroup, applicationPage.AdmissionGroup, "Admission Group is not equal");
            Assert.AreEqual(enrolmentStatus, applicationPage.ProposedEnrolmentStatus, "Enrolment Status is not equal");
            Assert.AreEqual("", applicationPage.AdmissionNumber, "Admission number is not equal");
            Assert.AreEqual(true, applicationPage.VerifyDisable(), "Age and Age On Entry are not disable");

            //Change Applicant to Admitted
            applicationPage.ApplicationStatus = "Admitted";
            applicationPage.ClickSave();
            var confirmChangeStatusDialog = new ConfirmRequiredChangeStatus();
            confirmChangeStatusDialog.ConfirmContinueChangeStatus();

            // Missing report functional

            #endregion
        }
Ejemplo n.º 2
0
        public void Add_New_Applicant(
            string sureName, string middleName, string foreName, string gender, string dateOfBirth,
            string enrolmentStatus, string Class, string attendanceMode, string boarderStatus)
        {
            #region PRE-CONDITIONS:

            var          schoolIntakeId           = Guid.NewGuid();
            const string admissionTerm            = "Spring";
            const int    numberOfPlannedAdmission = 31;
            const int    capacity           = 10;
            var          admissionYear      = String.Format("{0}/{1}", (DateTime.Now.Year), (DateTime.Now.Year + 1));
            var          dateOfAdmission    = new DateTime(DateTime.Today.Year, 8, 8);
            var          admissionGroupName = Utilities.GenerateRandomString(10, "TC_AG01_Data");
            var          yearGroup          = Queries.GetFirstYearGroup();

            var dataPackage = this.BuildDataPackage();
            dataPackage.AddSchoolIntake(
                schoolIntakeId,
                admissionYear,
                admissionTerm,
                yearGroup,
                numberOfPlannedAdmission,
                admissionGroupName,
                dateOfAdmission,
                capacity);

            // Act
            using (new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: dataPackage))
            {
                // Login as Admission
                SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.AdmissionsOfficer);

                // Navigate to Application page
                AutomationSugar.NavigateMenu("Tasks", "Admissions", "Applications");

                Wait.WaitForAjaxReady();

                var applicantTriplet = new ApplicationTriplet();

                // Search to change to Admitted if existing Applicant
                applicantTriplet.SearchCriteria.SetStatus("Applied", true);
                applicantTriplet.SearchCriteria.SetStatus("Offered", true);
                applicantTriplet.SearchCriteria.SetStatus("Accepted", true);
                applicantTriplet.SearchCriteria.SearchByName = sureName;
                var searchResults = applicantTriplet.SearchCriteria.Search();
                var applicantTile = searchResults.SingleOrDefault(t => t.Code.Equals(sureName + ", " + foreName));
                applicantTriplet.ChangeToAdmit(applicantTile);

                #endregion

                #region STEPS:

                // Create new an Applicant
                applicantTriplet = new ApplicationTriplet();
                var addNewApplicationDialog = applicantTriplet.AddNewApplicationDialog();
                addNewApplicationDialog.ForeName    = foreName;
                addNewApplicationDialog.MiddleName  = middleName;
                addNewApplicationDialog.SureName    = sureName;
                addNewApplicationDialog.Gender      = gender;
                addNewApplicationDialog.DateofBirth = dateOfBirth;
                addNewApplicationDialog.Continue();

                // Navigate to Registration Details dialog
                var registrationDetailsDialog = new RegistrationDetailsDialog();
                registrationDetailsDialog.AdmissionGroup  = admissionGroupName;
                registrationDetailsDialog.EnrolmentStatus = enrolmentStatus;
                registrationDetailsDialog.Class           = Class;
                registrationDetailsDialog.AttendanceMode  = attendanceMode;
                registrationDetailsDialog.BoarderStatus   = boarderStatus;
                registrationDetailsDialog.AddRecord();

                // Search Applicant that has just created
                applicantTriplet.SearchCriteria.SearchByName = sureName;
                searchResults = applicantTriplet.SearchCriteria.Search();
                applicantTile = searchResults.SingleOrDefault(t => t.Code.Equals(sureName + ", " + foreName));

                try
                {
                    // Verify that Applicant was created
                    Assert.IsNotNull(applicantTile, "Application record not created");

                    var applicationPage = applicantTile.Click <ApplicationPage>();

                    // Verify that Applicant was created successfully
                    Assert.AreEqual(foreName, applicationPage.LegalForeName, "Legal ForName is not equal");
                    Assert.AreEqual(sureName, applicationPage.LegalSureName, "Legal SurName is not equal");
                    Assert.AreEqual(gender, applicationPage.Gender, "Gender is not equal");
                    Assert.AreEqual(dateOfBirth, applicationPage.DateOfBirth, "Date of Birth is not equal");
                    Assert.AreEqual(dateOfBirth.GetMonthsAndYears(), applicationPage.Age, "Ages is not equal");
                    Assert.AreEqual("Applied", applicationPage.ApplicationStatus, "Application Status is not equal");
                    Assert.AreEqual(admissionGroupName, applicationPage.AdmissionGroup, "Admission Group is not equal");
                    Assert.AreEqual("", applicationPage.AdmissionNumber, "Admission Number is not equal");
                    Assert.AreEqual(true, applicationPage.VerifyDisable(), "Age and Age On Entry are not disabled");
                }
                finally
                {
                    // Tear down linked records before clean up
                    var learnerId     = Queries.GetLearnerId(sureName, foreName, dateOfBirth);
                    var applicationId = Queries.GetApplicationId(learnerId);
                    PurgeLinkedData.DeleteApplicationStatusLog(applicationId);
                    PurgeLinkedData.DeleteApplication(applicationId);
                    PurgeLinkedData.DeleteLearnerEnrolmentStatusForPupil(learnerId);
                    PurgeLinkedData.DeleteLearnerEnrolmentForPupil(learnerId);
                    PurgeLinkedData.DeleteNcYearMembershipForPupil(learnerId);
                    PurgeLinkedData.DeleteYearGroupMembershipForPupil(learnerId);
                    PurgeLinkedData.DeleteAttendanceModelForLearner(learnerId);
                    PurgeLinkedData.DeleteBorderStatusForLearner(learnerId);
                    PurgeLinkedData.DeletePrimaryClassMembershipForLearner(learnerId);
                    PurgeLinkedData.DeletePupil(foreName, sureName);
                }
            }
            #endregion
        }