public void Form_Delete_Unused()
        {
            Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString());

            var mainMenu  = new MainMenu(Driver);
            var formMenu  = new SubMenuForms(Driver);
            var formPages = new FormPages(Driver);

            var formWorkflow = new FormWorkflows(Driver, test);

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

                // create the form and get the id
                var newFormId = formWorkflow.CreateForm();
                test.Log(LogStatus.Pass, "Create the form");

                Console.WriteLine("Attemping to delete form with ID {0}", newFormId);
                // navigate to Forms > Design Forms and Packets > Edit Forms
                Driver.SwitchToDefaultFrame();
                mainMenu.ClickMainMenuTab();
                mainMenu.ClickForms();
                formMenu.ClickDesignFormsandPackets();
                formMenu.ClickEditForms();
                test.Log(LogStatus.Pass, "Navigate to Main Menu > Forms > Design Forms and Packets > Edit Forms");

                // select the form in the list
                Driver.SwitchToFrameById("MainContentsIFrame");
                formPages.EditFormsPage.SelectForm(newFormId);
                test.Log(LogStatus.Pass, "Select the form from the list");

                // delete the form
                Driver.SwitchToDefaultFrame();
                formMenu.ClickDeleteForms();
                test.Log(LogStatus.Pass, "Click Delete Forms");

                formPages.EditFormsPage.ConfirmDeletion();
                test.Log(LogStatus.Pass, "Confirm the deletion");

                // verify that the form was deleted
                Driver.SwitchToDefaultFrame();
                mainMenu.ClickMainMenuTab();
                mainMenu.ClickForms();
                formMenu.ClickDesignFormsandPackets();
                formMenu.ClickEditForms();
                Driver.SwitchToFrameById("MainContentsIFrame");
                Assert.IsFalse(formPages.EditFormsPage.FormExists(newFormId));
                test.Log(LogStatus.Pass, "Form deleted");

                Console.Out.WriteLineAsync("Form Deleted");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
        public void Form_Create_New_Blank()
        {
            Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString());

            var formData  = new FormData();
            var mainMenu  = new MainMenu(Driver);
            var formMenu  = new SubMenuForms(Driver);
            var formPages = new FormPages(Driver);

            var formWorkflow = new FormWorkflows(Driver, test);

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

                // navigate to Forms > Design Forms and Packets > Create New Form
                mainMenu.ClickForms();
                formMenu.ClickDesignFormsandPackets();
                formMenu.ClickCreateNewForm();
                test.Log(LogStatus.Pass, "Navigate to Forms > Design Forms and Packets > Create New Form");

                // click 'A blank form'
                Driver.SwitchToFrameById("MainContentsIFrame");
                formPages.CreateNewFormPage.ClickBlankForm();
                test.Log(LogStatus.Pass, "Click 'A blank form'");

                // enter form info
                Driver.SwitchToFrameById("tabs_Panel");
                formPages.EditAndCreateFormPage.PropertiesTab.ClickStandardFormRadioButton();
                test.Log(LogStatus.Pass, "Select the 'Standard Form' radio button");

                formPages.EditAndCreateFormPage.PropertiesTab.FillOutFormTitle(formData.FormTitle);
                test.Log(LogStatus.Pass, "Fill out the form title");

                // save
                Driver.SwitchToDefaultFrame();
                Driver.SwitchToFrameById("MainContentsIFrame");
                formPages.EditAndCreateFormPage.ClickSaveButton();
                test.Log(LogStatus.Pass, "Click the save button");
                var formId = formPages.EditAndCreateFormPage.GetFormId();
                Console.WriteLine("Form ID: {0}", formId);

                // verify that the form was created
                Driver.SwitchToDefaultFrame();
                mainMenu.ClickMainMenuTab();
                mainMenu.ClickForms();
                formMenu.ClickDesignFormsandPackets();
                formMenu.ClickEditForms();
                Driver.SwitchToFrameById("MainContentsIFrame");
                Assert.IsTrue(formPages.EditFormsPage.FormExists(formId));
                test.Log(LogStatus.Pass, "Verify the form exists");

                // delete the form
                formWorkflow.DeleteForm(formId);
                test.Log(LogStatus.Pass, "Delete the form");
            }
            catch (Exception e) //On Error Do
            {
                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;
            }
        }
Ejemplo n.º 4
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;
            }
        }
Ejemplo n.º 5
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;
            }
        }
Ejemplo n.º 6
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;
            }
        }