public void CompleteFitAssessment()
        {
            while (true)
            {
                var applicantPages = new ApplicantPages(_driver);

                if (applicantPages.EmploymentApplicationPages.FitPages.QuestionPageDisplayed())
                {
                    applicantPages.EmploymentApplicationPages.FitPages.SelectRandomOptions();

                    _driver.SwitchToDefaultFrame();

                    applicantPages.EmploymentApplicationPages.ClickNextPage();

                    continue;
                }
                else if (applicantPages.EmploymentApplicationPages.FitPages.MultipleChoicePageDisplayed())
                {
                    applicantPages.EmploymentApplicationPages.FitPages.SelectRandomMultipleChoice();

                    _driver.SwitchToDefaultFrame();

                    applicantPages.EmploymentApplicationPages.ClickNextPage();

                    continue;
                }
                else if (applicantPages.EmploymentApplicationPages.FitPages.OkNextDisplayed())
                {
                    applicantPages.EmploymentApplicationPages.FitPages.ClickOkNext();

                    continue;
                }
                break;
            }
        }
        public void Setup_ApplicantSettings_Edit_Section_Title()
        {
            // page objects
            var mainMenu       = new MainMenu(Driver);
            var setupMenu      = new SubMenuSetup(Driver);
            var applicantPages = new ApplicantPages(Driver);
            var setupPages     = new SetupPages(Driver);

            // test data
            const string pageName             = "Education";
            var          originalSectionTitle = "Colleges, Universities, and Technical Schools Attended";
            var          applicationPageData  = new ApplicationPageData();
            var          expectedSectionTitle = originalSectionTitle + applicationPageData.SectionTitle;

            try
            {
                // Navigate to Setup > Applicant Settings > Manage Application Pages > Manage Internal Pages
                mainMenu.ClickSetup();
                setupMenu.ClickApplicantSettings();
                setupMenu.ClickManageApplicationPages();
                setupMenu.ClickManageInternalPages();
                test.Log(LogStatus.Pass, "Navigate to Setup > Applicant Settings > Manage Application Pages > Manage Internal Pages");

                // Click 'Edit' for the 'Education' page
                Driver.SwitchToFrameById("MainContentsIFrame");
                setupPages.ApplicantSettingsPages.ManageInternalPages.ClickEdit(pageName);
                test.Log(LogStatus.Pass, "Click on the edit link for " + pageName);

                // Under 'Higher Education', change the 'Section Title'
                setupPages.ApplicantSettingsPages.EditPage.EnterHigherEducationTitle(expectedSectionTitle);
                test.Log(LogStatus.Pass, "Enter: '" + expectedSectionTitle + "' into the Section Title for Higher Education");

                setupPages.ApplicantSettingsPages.EditPage.ClickSaveChanges();
                test.Log(LogStatus.Pass, "Click 'Save Changes'");

                // View the page and assert that the title changed
                setupPages.ApplicantSettingsPages.EditPage.ClickPreviewPage();
                test.Log(LogStatus.Pass, "Click 'Preview Page'");

                Driver.SwitchToPopup();

                Assert.IsTrue(applicantPages.EmploymentApplicationPages.SectionTitleIsOnScreen(expectedSectionTitle),
                              expectedSectionTitle + " was not on the screen");
                test.Log(LogStatus.Pass, expectedSectionTitle + " was on the screen.");

                // Change the section title back to the original
                Driver.ClosePopup();
                Driver.SwitchToFrameById("MainContentsIFrame");
                setupPages.ApplicantSettingsPages.EditPage.EnterHigherEducationTitle(originalSectionTitle);
                setupPages.ApplicantSettingsPages.EditPage.ClickSaveChanges();
                test.Log(LogStatus.Info, "Changed section title back to: " + originalSectionTitle);
            }
            catch (Exception e)
            {
                HandleException(e, Driver);
                throw;
            }
        }
        public void TeacherFit_Displayed_for_New_Applicant()
        {
            // page objects
            var landingPage    = new DefaultLandingPage(Driver);
            var applicantPages = new ApplicantPages(Driver);

            // workflows
            var applicationWorkflows = new ApplicationWorkflows(Driver, test);

            // applicant data
            var applicantData = new ApplicantGenerator();

            try
            {
                // create new applicant
                landingPage.ClickExternalLogin();
                test.Log(LogStatus.Pass, "Click 'External Login'");

                Driver.SwitchToPopup();
                applicantPages.ClickEmploymentApplicationTab();
                test.Log(LogStatus.Pass, "Click the 'Employment Application' tab");

                applicationWorkflows.FillOutPersonalInfo(applicantData);

                applicantPages.EmploymentApplicationPages.ClickNextPage();
                test.Log(LogStatus.Pass, "Click 'Next Page'");

                applicantPages.EmploymentApplicationPages.ClickVacancyDesired();
                test.Log(LogStatus.Pass, "Click 'Vacancy Desired'");

                applicantPages.EmploymentApplicationPages.VacancyDesiredPage.SelectVacancy(vacancyDesired);
                test.Log(LogStatus.Pass, "Select job: " + vacancyDesired);

                applicantPages.EmploymentApplicationPages.ClickSaveAsDraft();
                test.Log(LogStatus.Pass, "Click 'Save as Draft'");

                // navigate to Teacher Fit
                applicantPages.EmploymentApplicationPages.ClickTeacherFit();
                test.Log(LogStatus.Pass, "Click 'TeacherFit'");

                // Assert that the page is displayed
                Assert.IsTrue(applicantPages.EmploymentApplicationPages.FitPages.IsDisplayed(), "The Teacher Fit starting page is not displayed");
                test.Log(LogStatus.Pass, "The teacher fit starting page is displayed");
            }
            catch (Exception e)
            {
                HandleException(e, Driver);
                throw;
            }
        }
        public void FillOutPersonalInfo(IApplicant applicantData)
        {
            var applicantPages = new ApplicantPages(_driver);

            _driver.SwitchToDefaultFrame();
            _driver.SwitchToFrameById("AppDataPage");

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterFirstName(applicantData.FirstName);
            _test.Log(LogStatus.Info, "Enter into the 'First' name field: " + applicantData.FirstName);

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterLastName(applicantData.LastName);
            _test.Log(LogStatus.Info, "Enter into the 'Last' name field: " + applicantData.LastName);

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterEmailAddress(applicantData.Email);
            _test.Log(LogStatus.Info, "Enter into the 'Email Address' field: " + applicantData.Email);

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterConfirmEmail(applicantData.Email);
            _test.Log(LogStatus.Info, "Enter into the 'Confirm Email' field: " + applicantData.Email);

            if (FeatureFlags.PersonalInfo.CollectSSN)
            {
                applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterSocialSecurityNumber(applicantData.SocialSecurityNumber);
                _test.Log(LogStatus.Info, "Enter into the 'Social Security Number' field: " + applicantData.SocialSecurityNumber);

                applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterConfirmSsn(applicantData.SocialSecurityNumber);
                _test.Log(LogStatus.Info, "Enter into the 'Confirm SSN' field: " + applicantData.SocialSecurityNumber);
            }

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterPassword(applicantData.Password);
            _test.Log(LogStatus.Info, "Enter into the 'Password' field: " + applicantData.Password);

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterConfirmPassword(applicantData.Password);
            _test.Log(LogStatus.Info, "Enter into the 'Confirm Password' field: " + applicantData.Password);

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.SelectSecretQuestion();
            _test.Log(LogStatus.Info, "Select a secret question");

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterSecretAnswer(applicantData.SecretAnswer);
            _test.Log(LogStatus.Info, "Enter into the 'Secret Answer' field: " + applicantData.SecretAnswer);

            _driver.SwitchToDefaultFrame();
        }
        public void LandingPage_Start_As_Internal_Applicant()
        {
            Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString());

            var landingPage    = new DefaultLandingPage(Driver);
            var applicantPages = new ApplicantPages(Driver);

            try  //Contains Contents of Test
            {
                landingPage.ClickInternalLogin();
                test.Log(LogStatus.Pass, "Click Internal Login");

                applicantPages.SwitchWindows();
                Driver.SwitchToFrameById("HomeDataPage");
                applicantPages.ClickStart();
                test.Log(LogStatus.Pass, "Clicking Start");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
        public void TeacherFit_New_Applicant()
        {
            // page objects
            var landingPage    = new DefaultLandingPage(Driver);
            var applicantPages = new ApplicantPages(Driver);

            // workflows
            var applicationWorkflows = new ApplicationWorkflows(Driver, test);

            // data
            var applicantData  = new ApplicantGenerator();
            var vacancyDesired = 1171;

            try
            {
                // create new applicant
                landingPage.ClickExternalLogin();
                test.Log(LogStatus.Pass, "Click 'External Login'");

                Driver.SwitchToPopup();
                applicantPages.ClickEmploymentApplicationTab();
                test.Log(LogStatus.Pass, "Click the 'Employment Application' tab");

                applicationWorkflows.FillOutPersonalInfo(applicantData);

                applicantPages.EmploymentApplicationPages.ClickNextPage();
                test.Log(LogStatus.Pass, "Click 'Next Page'");

                applicantPages.EmploymentApplicationPages.ClickVacancyDesired();
                test.Log(LogStatus.Pass, "Click 'Vacancy Desired'");

                applicantPages.EmploymentApplicationPages.VacancyDesiredPage.SelectVacancy(vacancyDesired);
                test.Log(LogStatus.Pass, "Select vacancy: " + vacancyDesired);

                applicantPages.EmploymentApplicationPages.ClickSaveAsDraft();
                test.Log(LogStatus.Pass, "Click 'Save As Draft'");

                // take teacherfit
                applicantPages.EmploymentApplicationPages.ClickTeacherFit();
                test.Log(LogStatus.Pass, "Click 'TeacherFit'");

                Assert.IsTrue(applicantPages.EmploymentApplicationPages.FitPages.IsDisplayed(), "The Teacher Fit starting page is not displayed");
                test.Log(LogStatus.Pass, "The teacher fit starting page is displayed");

                applicationWorkflows.CompleteFitAssessment();

                // assert that the assessment has been completed
                Assert.IsTrue(applicantPages.EmploymentApplicationPages.FitPages.AssessmentCompleted(), "The fit assessment has not been completed");
                test.Log(LogStatus.Pass, "The fit assessment has been completed successfully");

                // submit the application
                applicantPages.EmploymentApplicationPages.ClickFinishAndSubmit();
                test.Log(LogStatus.Pass, "Click 'Finish and Submit'");

                // assert that the screen does not indicate that the teacherfit assessment needs to be completed
                Assert.IsTrue(applicantPages.EmploymentApplicationPages.ConfirmationPage.StepIsCompleted("TeacherFit"),
                              "The confirmation page indicates the TeacherFit assessment was not completed");
                test.Log(LogStatus.Pass, "The confirmation page indicates that the TeacherFit assessment was completed");
            }
            catch (Exception e)
            {
                HandleException(e, Driver);
                throw;
            }
        }
        public void Form_SendTo_Applicant_Approve()
        {
            Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString());

            var mainMenu              = new MainMenu(Driver);
            var formMenu              = new SubMenuForms(Driver);
            var formPages             = new FormPages(Driver);
            var applicantProfilePages = new ApplicantProfilePages(Driver);
            var applicantPage         = new ApplicantPages(Driver);
            var applicantMenu         = new ApplicantAdminMenu(Driver);

            var searchWorkflows = new SearchWorkflows(Driver);
            var formWorkflows   = new FormWorkflows(Driver, test);

            try //Contains Contents of Test
            {
                const int    formId     = 895;
                const string formName   = "Approve Form Automated Testing";
                const string appNo      = "435";
                const string appName    = "Raj email";
                const string employeeNo = "484";

                //test.Log(LogStatus.Info, "Starting test at URL: " + BaseUrls["ApplitrackLoginPage"]);

                // Navigate to Forms > Send a Form
                mainMenu.ClickForms();
                formMenu.ClickSendForm();
                test.Log(LogStatus.Pass, "Navigate to Forms > Send a Form");

                // Select "Approval and Deny Form for testing"
                Driver.SwitchToFrameById("MainContentsIFrame");
                formPages.SendFormPage.SelectFormToSendById(formId);
                test.Log(LogStatus.Pass, "Select form: " + formId);
                formPages.SendFormPage.ClickContinueWithSelectedForms();
                test.Log(LogStatus.Pass, "Click 'Continue with Selected Forms'");

                // Assign the form to appno1
                formPages.SendFormPage.SelectAssociatedApplicant(appNo);
                test.Log(LogStatus.Pass, "Select Applicant Number: " + appNo);

                // Assign the form to an employee
                formPages.SendFormPage.SelectAssociatedEmployee(employeeNo);
                test.Log(LogStatus.Pass, "Select Employee Number: " + employeeNo);

                formPages.SendFormPage.ClickNext();
                test.Log(LogStatus.Pass, "Click 'Next'");

                // Send the form
                formPages.SendFormPage.ClickFinishAndDeliver();
                test.Log(LogStatus.Pass, "Click 'Finish and Deliver'");

                // Open the applicant page
                searchWorkflows.OpenApplicantUsingSearch(appNo, appName);
                test.Log(LogStatus.Pass, "Opened applicant page for: " + appNo + " " + appName);

                // Login as applicant
                Driver.SwitchToFrameById("App" + appNo);
                applicantProfilePages.Toolbar.LoginAsApplicant();
                test.Log(LogStatus.Pass, "Log in as applicant");

                // Click on the forms tab and select the "Approval and Deny Form for testing"
                applicantPage.ClickFormsTab();
                test.Log(LogStatus.Pass, "Clicking the 'Forms' tab");
                Driver.SwitchToFrameById("FormsDataPage");
                // TODO: refactor SelectForm() in order to use GetFormKey() instead
                var formGuid = applicantPage.SelectForm(formName);
                test.Log(LogStatus.Pass, "Selecting " + formName);

                // Fill out an answer and click Next
                Driver.SwitchToDefaultFrame();
                applicantPage.ClickNextPage();
                test.Log(LogStatus.Pass, "Click Next Page");
                // the Next Page button must be clicked twice in order to go to the next page
                // TODO work with developers to fix
                applicantPage.ClickNextPage();
                test.Log(LogStatus.Pass, "Click Next Page again");

                // The IFrames are nested so we need to switch to both
                Driver.SwitchToFrameById("FormsDataPage");
                Driver.SwitchToFrameById("IFrameFormSent");

                // Verify the 'Approve' button exists
                Assert.IsTrue(applicantPage.ApproveButtonExists(), "The 'Approve' button does not appear on the screen");
                test.Log(LogStatus.Pass, "The 'Approve' button exists");

                // Digitally sign and approve the form
                applicantPage.EnterDigitalSignature(appName);
                test.Log(LogStatus.Pass, "Digitally sign the form");

                applicantPage.ClickApprove();
                test.Log(LogStatus.Pass, "Approve the form");

                // switch back to the main window
                Driver.ClosePopup();

                // Navigate to 'List All Forms'
                Driver.SwitchToFrameById("App" + appNo);
                applicantMenu.ClickListAllForms();
                Driver.SwitchToFrameById("MainContentsIFrame");
                test.Log(LogStatus.Pass, "Navigate to 'List All Forms' from the applicant menu");

                // Verify form has been approved
                Assert.IsTrue(applicantProfilePages.ListAllForms.FormIsApproved(formGuid), "The form was not approved");
                test.Log(LogStatus.Pass, "Form was approved");

                // Cleanup - delete the form
                test.Log(LogStatus.Info, "Beginning cleanup");
                formWorkflows.DeleteSentForm(formGuid);
                test.Log(LogStatus.Pass, "Delete sent form");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
Пример #8
0
        public void Applicant_Send_Email()
        {
            // pages
            var applicantProfilePage = new ApplicantProfilePages(_driver);
            var applicantMenu        = new ApplicantAdminMenu(_driver);
            var email          = new EmailPage(_driver);
            var landingPage    = new DefaultLandingPage(_driver);
            var applicantPages = new ApplicantPages(_driver);

            // workflows
            var searchWorkflows      = new SearchWorkflows(_driver);
            var applicationWorkflows = new ApplicationWorkflows(_driver, test);

            // test data
            var applicantData = new ApplicantGenerator();
            var emailBody     = Faker.TextFaker.Sentence();

            try
            {
                // create applicant
                BrowseTo(BaseUrls["ApplitrackLandingPage"], _driver);
                landingPage.ClickExternalLogin();
                _driver.SwitchToPopup();
                applicantPages.ClickEmploymentApplicationTab();
                applicationWorkflows.FillOutPersonalInfo(applicantData);
                applicantPages.EmploymentApplicationPages.ClickNextPage();
                applicantPages.EmploymentApplicationPages.ClickPostalAddress();
                applicationWorkflows.FillOutPermanentAddress(applicantData.Address);
                _driver.SwitchToDefaultFrame();
                _driver.SwitchToFrameById("AppDataPage");
                applicantData.AppNo = applicantPages.EmploymentApplicationPages.GetAppNo();
                test.Log(LogStatus.Info, "AppNo is: " + applicantData.AppNo);
                _driver.SwitchToDefaultFrame();
                applicantPages.EmploymentApplicationPages.ClickSaveAsDraft();
                _driver.ClosePopup();

                // login
                BrowseTo(BaseUrls["ApplitrackLoginPage"], _driver);
                test.Log(LogStatus.Info, "Starting test at URL: " + BaseUrls["ApplitrackLoginPage"]);
                var loginWorkflow = new LoginWorkflows(_driver);
                loginWorkflow.LoginAsSuperUser();

                // Open the applicant page
                BrowseTo($"{_driver.Url}?AppNo={applicantData.AppNo}", _driver);
                _driver.SwitchToFrameById("App" + applicantData.AppNo);

                // Click the Email button
                applicantProfilePage.Toolbar.ClickEmailButton();
                test.Log(LogStatus.Pass, "Click the Email button");

                // Send the email
                _driver.SwitchToPopup();
                _driver.SwitchToFrameByClass("cke_wysiwyg_frame");
                email.EnterEmailBody(emailBody);
                _driver.SwitchToDefaultFrame();
                email.ClickSendMessageButton();
                test.Log(LogStatus.Pass, "Click the Send Message button");

                // Assert that the email address is displayed on the page
                Assert.IsTrue(email.IsEmailAddressDisplayed(applicantData.Email), "Expected email: " + applicantData.Email + " is not on the screen");
                test.Log(LogStatus.Pass, "The email address: " + applicantData.Email + " appears on the page");
                _driver.ClosePopup();

                _driver.SwitchToDefaultFrame();
                _driver.SwitchToFrameById("App" + applicantData.AppNo);
                applicantMenu.ClickCommuncationLog();

                _driver.SwitchToFrameById("MainContentsIFrame");

                Assert.IsTrue(applicantProfilePage.CommunicationLogPage.IsCommunicationDisplayed(emailBody), "Email is not displayed on the Communication Log page");
                test.Log(LogStatus.Pass, "Email is displayed on the Communication Log page");
            }
            catch (Exception e)
            {
                HandleException(e, _driver);
                throw;
            }
        }
        public void TestSetup()
        {
            // extent reports setup
            _test = ExtentTestManager.StartTest(TestContext.Properties["TestCaseName"].ToString(),
                                                TestContext.Properties["TestCaseDescription"].ToString())
                    .AssignCategory("Smoke");

            // browser setup
            _driver = SetUp(_BT);
            _driver.Manage().Window.Maximize();

            _test.Log(LogStatus.Info, "Begin applicant creation");

            // create applicant
            BrowseTo(BaseUrls["ApplitrackLandingPage"], _driver);
            _test.Log(LogStatus.Info, "Starting test at URL: " + BaseUrls["ApplitrackLandingPage"]);
            var landingPage          = new DefaultLandingPage(_driver);
            var applicantPages       = new ApplicantPages(_driver);
            var applicationWorkflows = new ApplicationWorkflows(_driver, _test);
            var applicantProfile     = new ApplicantProfilePages(_driver);
            var hireWizard           = new HireWizardPage(_driver);

            _applicantData = new ApplicantGenerator();

            landingPage.ClickExternalLogin();

            _driver.SwitchToPopup();

            applicantPages.ClickEmploymentApplicationTab();

            applicationWorkflows.FillOutPersonalInfo(_applicantData);

            applicantPages.EmploymentApplicationPages.ClickNextPage();

            applicantPages.EmploymentApplicationPages.ClickPostalAddress();

            applicationWorkflows.FillOutPermanentAddress(_applicantData.Address);

            _driver.SwitchToDefaultFrame();
            _driver.SwitchToFrameById("AppDataPage");
            _applicantData.AppNo = applicantPages.EmploymentApplicationPages.GetAppNo();
            _test.Log(LogStatus.Info, "AppNo is: " + _applicantData.AppNo);

            _driver.SwitchToDefaultFrame();
            applicantPages.EmploymentApplicationPages.ClickSaveAsDraft();

            _driver.ClosePopup();

            _isApplicantCreated = true;

            // login to admin
            BrowseTo(BaseUrls["ApplitrackLoginPage"], _driver);
            _test.Log(LogStatus.Info, "Logging into system at URL: " + BaseUrls["ApplitrackLoginPage"]);
            var loginWorkflow = new LoginWorkflows(_driver);

            loginWorkflow.LoginAsSuperUser();

            // Navigate to the Notes page because selenium has trouble interacting with the window
            BrowseTo(BaseUrls["ApplitrackLoginPage"] + @"/onlineapp/admin/Action-LeaveNote.aspx?AppNo=" + _applicantData.AppNo + @"&HideSaveAndClose=1", _driver);

            // Hire the applicant
            applicantProfile.ApplicantNotesPages.ApplicantNotesTab.SelectHiredYes();
            _test.Log(LogStatus.Info, "Select 'Yes' for hired.");

            applicantProfile.ApplicantNotesPages.ApplicantNotesTab.ClickSave();
            _test.Log(LogStatus.Info, "Click 'Save'");

            hireWizard.ClickNext();
            _test.Log(LogStatus.Info, "Click 'Next'");

            // Select 'No' for Aesop
            if (FeatureFlags.ThirdParty.Aesop.Enabled)
            {
                hireWizard.SelectNo();
                _test.Log(LogStatus.Info, "Select 'No' for Aesop");
                hireWizard.ClickNext();
                _test.Log(LogStatus.Info, "Click 'Next'");
            }

            // Select 'No' for HR Files
            if (FeatureFlags.Employees.UsesEmployees)
            {
                hireWizard.SelectNo();
                _test.Log(LogStatus.Info, "Select 'No' for HR Files");
                hireWizard.ClickNext();
                _test.Log(LogStatus.Info, "Click 'Next'");
            }

            // Select 'Yes' for FC
            hireWizard.SelectYes();
            _test.Log(LogStatus.Info, "Select 'Yes' for FC");
            hireWizard.ClickNext();
            _test.Log(LogStatus.Info, "Click 'Next'");
        }
Пример #10
0
        public void Form_Blank_Form_Deletion()
        {
            Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString());

            var mainMenu              = new MainMenu(Driver);
            var formPages             = new FormPages(Driver);
            var applicantProfilePages = new ApplicantProfilePages(Driver);
            var applicantPage         = new ApplicantPages(Driver);
            var applicantMenu         = new ApplicantAdminMenu(Driver);

            var searchWorkflows = new SearchWorkflows(Driver);
            var formWorkflows   = new FormWorkflows(Driver, test);

            var formData = new FormData();
            var formName = formData.FormTitle;

            var windowHelpers = new WindowHelpers(Driver);

            try //Contains Contents of Test
            {
                const string appNo   = "1";
                const string appName = "Sample Applicant";

                //test.Log(LogStatus.Info, "Starting test at URL: " + BaseUrls["ApplitrackLoginPage"]);

                // create a new form
                var formId = formWorkflows.CreateForm();
                test.Log(LogStatus.Info, "Created new form: " + formId + ": " + formName);

                // Open the applicant page
                searchWorkflows.OpenApplicantUsingSearch(appNo, appName);
                test.Log(LogStatus.Pass, "Opened applicant page for: " + appNo + " " + appName);

                // Click the 'New Form' button and switch to the new window
                Driver.SwitchToFrameById("App" + appNo);
                applicantProfilePages.Toolbar.ClickNewFormButton();
                Driver.SwitchToPopup();

                formPages.SendFormPage.SelectFormToSendById(formId);
                test.Log(LogStatus.Pass, "Select form: " + formId);

                formPages.SendFormPage.ClickContinueWithSelectedForms();
                test.Log(LogStatus.Pass, "Click 'Continue with Selected Forms'");

                // TODO create method(s) to select other radio buttons
                // This page should automatically select the 'Applicant' radio button
                // Therefore we can just click next...
                formPages.SendFormPage.ClickNext();
                test.Log(LogStatus.Pass, "Click 'Next Page'");

                // Send the form
                formPages.SendFormPage.ClickFinishAndDeliver();
                test.Log(LogStatus.Pass, "Click 'Finish and Deliver'");

                // Close the window and switch back to the main window
                //formPages.ClickCloseWindow();
                Driver.ClosePopup();

                // Login as applicant
                Driver.SwitchToFrameById("App" + appNo);
                applicantProfilePages.Toolbar.LoginAsApplicant();
                test.Log(LogStatus.Pass, "Log in as applicant");

                // Click on the forms tab and select the "Approval and Deny Form for testing"
                applicantPage.ClickFormsTab();
                test.Log(LogStatus.Pass, "Clicking the 'Forms' tab");
                Driver.SwitchToFrameById("FormsDataPage");

                var formGuid = applicantPage.GetFormGuid(formName);

                // switch back to the main window
                Driver.ClosePopup();

                // Navigate to 'List All Forms'
                Driver.SwitchToFrameById("App" + appNo);
                applicantMenu.ClickListAllForms();
                Driver.SwitchToFrameById("MainContentsIFrame");

                // Verify the form was sent
                Assert.IsTrue(applicantProfilePages.ListAllForms.FormWasSent(formGuid), "The form was not sent.");

                // click 'Edit Form'
                applicantProfilePages.ListAllForms.EditForm(formGuid);
                Driver.SwitchToPopup();
                //formPages.ClickSaveAsDraft();
                Driver.ClosePopup();

                BrowseTo(BaseUrls["ApplitrackLoginPage"] + "/onlineapp/admin/maintenance/deleteunansweredformssent.aspx", Driver);

                /*
                 * // Cleanup - delete the form
                 * Driver.SwitchToDefaultFrame();
                 * Driver.SwitchToFrameById("App"+appNo);
                 * Driver.SwitchToFrameById("MainContentsIFrame");
                 * applicantAdminPages.DeleteForm(formGuid);
                 * AlertAccept(Driver);
                 * AlertAccept(Driver);
                 * test.Log(LogStatus.Pass, "Form was deleted");
                 */
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
Пример #11
0
        [Ignore] // TODO figure out why this is flaky
        public void Form_SendTo_Applicant_using_New_Form()
        {
            // pages
            var mainMenu              = new MainMenu(Driver);
            var formPages             = new FormPages(Driver);
            var applicantProfilePage  = new ApplicantProfilePages(Driver);
            var applicantPage         = new ApplicantPages(Driver);
            var applicantMenu         = new ApplicantAdminMenu(Driver);
            var applicantProfilePages = new ApplicantProfilePages(Driver);

            // workflows
            var searchWorkflows = new SearchWorkflows(Driver);
            var formWorkflows   = new FormWorkflows(Driver, test);

            // data
            var          formData = new FormData();
            var          formName = formData.FormTitle;
            const string appNo    = "2593";
            const string appName  = "Kevin Pavao";

            try //Contains Contents of Test
            {
                // create a new form
                var formId = formWorkflows.CreateForm();
                test.Log(LogStatus.Info, "Created new form: " + formId + ": " + formName);

                // Open the applicant page
                searchWorkflows.OpenApplicantUsingSearch(appNo, appName);
                test.Log(LogStatus.Pass, "Opened applicant page for: " + appNo + " " + appName);

                // Click the 'New Form' button and switch to the new window
                Driver.SwitchToFrameById("App" + appNo);
                applicantProfilePage.Toolbar.ClickNewFormButton();
                Driver.SwitchToPopup();

                formPages.SendFormPage.SelectFormToSendById(formId);
                test.Log(LogStatus.Pass, "Select form: " + formId);

                formPages.SendFormPage.ClickContinueWithSelectedForms();
                test.Log(LogStatus.Pass, "Click 'Continue with Selected Forms'");

                // TODO create method(s) to select other radio buttons
                // This page should automatically select the 'Applicant' radio button
                // Therefore we can just click next...
                formPages.SendFormPage.ClickNext();
                test.Log(LogStatus.Pass, "Click 'Next Page'");

                // Send the form
                formPages.SendFormPage.ClickFinishAndDeliver();
                test.Log(LogStatus.Pass, "Click 'Finish and Deliver'");

                // Close the window and switch back to the main window
                Driver.ClosePopup();

                // Login as applicant
                Driver.SwitchToFrameById("App" + appNo);
                applicantProfilePage.Toolbar.LoginAsApplicant();
                test.Log(LogStatus.Pass, "Log in as applicant");

                // Click on the forms tab and select the "Approval and Deny Form for testing"
                applicantPage.ClickFormsTab();
                test.Log(LogStatus.Pass, "Clicking the 'Forms' tab");
                Driver.SwitchToFrameById("FormsDataPage");

                var formGuid = applicantPage.GetFormGuid(formName);

                // switch back to the main window
                Driver.ClosePopup();

                // Navigate to 'List All Forms'
                Driver.SwitchToFrameById("App" + appNo);
                applicantMenu.ClickListAllForms();
                Driver.SwitchToFrameById("MainContentsIFrame");
                test.Log(LogStatus.Pass, "Navigate to 'List All Forms' from the applicant menu");

                // Verify the form was sent
                Assert.IsTrue(applicantProfilePages.ListAllForms.FormWasSent(formGuid), "The form was not sent.");
                test.Log(LogStatus.Pass, "Check the list to verify that the form was sent");

                // Cleanup - delete the form
                test.Log(LogStatus.Info, "Beginning cleanup");
                formWorkflows.DeleteSentForm(formGuid);
                test.Log(LogStatus.Pass, "Delete sent form");

                Driver.SwitchToDefaultFrame();
                mainMenu.ClickMainMenuTab();
                formWorkflows.DeleteForm(formId);
                test.Log(LogStatus.Pass, "Delete created form");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
Пример #12
0
        public void Form_SendTo_Applicant_using_Main_Menu()
        {
            // pages
            var mainMenu              = new MainMenu(Driver);
            var formMenu              = new SubMenuForms(Driver);
            var formPages             = new FormPages(Driver);
            var applicantPage         = new ApplicantPages(Driver);
            var applicantMenu         = new ApplicantAdminMenu(Driver);
            var applicantProfilePages = new ApplicantProfilePages(Driver);

            // workflows
            var searchWorkflows = new SearchWorkflows(Driver);
            var formWorkflows   = new FormWorkflows(Driver, test);

            // data
            var          formData = new FormData();
            var          formName = formData.FormTitle;
            const string appNo    = "2593";
            const string appName  = "Kevin Pavao";

            try //Contains Contents of Test
            {
                //test.Log(LogStatus.Info, "Starting test at URL: " + BaseUrls["ApplitrackLoginPage"]);

                // create a new form
                var formId = formWorkflows.CreateForm();
                test.Log(LogStatus.Info, "Created new form: " + formId + ": " + formName);

                // navigate back to the main menu
                Driver.SwitchToDefaultFrame();
                mainMenu.ClickMainMenuTab();

                // Navigate to Forms > Send a Form
                mainMenu.ClickForms();
                formMenu.ClickSendForm();
                test.Log(LogStatus.Pass, "Navigate to Forms > Send a Form");

                // Select "Approval and Deny Form for testing"
                Driver.SwitchToFrameById("MainContentsIFrame");
                formPages.SendFormPage.SelectFormToSendById(formId);
                test.Log(LogStatus.Pass, "Select form: " + formId);

                formPages.SendFormPage.ClickContinueWithSelectedForms();
                test.Log(LogStatus.Pass, "Click 'Continue with Selected Forms'");

                formPages.SendFormPage.ClickNext();
                test.Log(LogStatus.Pass, "Click 'Next'");

                // Assign the form to appno1
                formPages.SendFormPage.SelectAssociatedApplicant(appNo);
                test.Log(LogStatus.Pass, "Select Applicant Number: " + appNo);

                formPages.SendFormPage.ClickNext();
                test.Log(LogStatus.Pass, "Click 'Next'");

                // Send the form
                formPages.SendFormPage.ClickFinishAndDeliver();
                test.Log(LogStatus.Pass, "Click 'Finish and Deliver'");

                // Open the applicant page
                searchWorkflows.OpenApplicantUsingSearch(appNo, appName);
                test.Log(LogStatus.Pass, "Opened applicant page for: " + appNo + " " + appName);

                // Login as applicant
                Driver.SwitchToFrameById("App" + appNo);
                applicantProfilePages.Toolbar.LoginAsApplicant();
                test.Log(LogStatus.Pass, "Log in as applicant");

                // Click on the forms tab and select the "Approval and Deny Form for testing"
                applicantPage.ClickFormsTab();
                test.Log(LogStatus.Pass, "Clicking the 'Forms' tab");
                Driver.SwitchToFrameById("FormsDataPage");

                var formGuid = applicantPage.GetFormGuid(formName);
                // switch back to the main window
                Driver.ClosePopup();

                // Navigate to 'List All Forms'
                Driver.SwitchToFrameById("App" + appNo);
                applicantMenu.ClickListAllForms();
                Driver.SwitchToFrameById("MainContentsIFrame");
                test.Log(LogStatus.Pass, "Navigate to 'List All Forms' from the applicant menu");

                // Verify the form was sent
                Assert.IsTrue(applicantProfilePages.ListAllForms.FormWasSent(formGuid), "The form was not sent.");
                test.Log(LogStatus.Pass, "Check the list to verify that the form was sent");

                // Cleanup - delete the form
                test.Log(LogStatus.Info, "Beginning cleanup");
                formWorkflows.DeleteSentForm(formGuid);
                test.Log(LogStatus.Pass, "Delete sent form");

                Driver.SwitchToDefaultFrame();
                mainMenu.ClickMainMenuTab();
                formWorkflows.DeleteForm(formId);
                test.Log(LogStatus.Pass, "Delete created form");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }