コード例 #1
0
        public void InactivateJobRequisition(int jobId)
        {
            var mainMenu           = new MainMenu(Driver);
            var jobPostingsSubMenu = new SubMenuJobPostings(Driver);
            var jobPostingPages    = new JobPostingsPages(Driver);

            Console.WriteLine("Attemping to inactivate job posting with ID {0}", jobId);

            // prevent issue where the menu dissapears if you click it too fast
            Thread.Sleep(TimeSpan.FromSeconds(1));

            // Navigate to Job Postings > Click All Active Requisitions
            Driver.SwitchToDefaultFrame();
            mainMenu.ClickMainMenuTab();
            mainMenu.ClickJobPostings();
            jobPostingsSubMenu.ClickAllActiveRequisitions();

            // select the job posting in the list
            Driver.SwitchToFrameById("MainContentsIFrame");
            jobPostingPages.ListAllActivePostingsPage.MarkListingCheckbox(jobId);

            // inactivate the requisition
            Driver.SwitchToDefaultFrame();
            jobPostingPages.ListAllActivePostingsPage.ClickInactivatePostings();
            jobPostingPages.ListAllActivePostingsPage.ConfirmInactivation();
        }
        public void JobPostings_Route_EditJob()
        {
            // data
            var job = new JobPostingGenerator();

            // page objects
            var jobPages = new JobPostingsPages(_driver);

            try
            {
                job.CreateInDatabase();
                _test.Log(LogStatus.Info, $"Create job posting: {job.AdditionalTitle}");

                var jobUrl = $"{_driver.Url}?Destination=JobPostPage&Id={job.Id}";
                _driver.Navigate().GoToUrl(jobUrl);
                _test.Log(LogStatus.Info, $"Navigate to {jobUrl}");

                _driver.SwitchToFrameById("MainContentsIFrame");
                Assert.IsTrue(jobPages.EditAndCreateJobPostingPage.IsDisplayed(), "The Edit Job Posting page is not dispalyed");
                _test.Log(LogStatus.Pass, "The Edit Job Posting page is displayed");

                _driver.SwitchToFrameById("tabs_Panel");
                Assert.IsTrue(jobPages.EditAndCreateJobPostingPage.TitleFieldContains(job.AdditionalTitle), "The Title field does not contain the correct job title");
                _test.Log(LogStatus.Pass, "The job title in the Title field is correct");
            }
            catch (Exception e)
            {
                HandleException(e, _driver);
                throw;
            }
            finally
            {
                job.DeleteFromDatabase();
            }
        }
コード例 #3
0
        public void ManageUserAccessPage_LHN_JobPostings()
        {
            // page objects
            var mainMenu             = new MainMenu(_driver);
            var superSuitNav         = new SuperSuitNavigation(_driver);
            var manageUserAccessPage = new ManageUserAccessPage(_driver);
            var jobPostingPages      = new JobPostingsPages(_driver);

            var expectedMenuItems = new StringCollection
            {
                "Job Postings Dashboard",
                "List All Active Postings",
                "Create New Posting",
                "Open Postings By Category",
                "Active Postings By Category",
                "All Postings By Status",
                "Requisition Inbox",
                "Create New Requisition",
                "My Draft Requisitions",
                "My Requisitions In Process",
                "My Open Requisitions",
                "My Closed Requisitions",
                "My Denied Requisitions",
                "Approved By Me -Active",
                "Approved By Me -InActive",
                "Close An Approved Posting",
                "All Active Requisitions",
                "All Inactive Requisitions",
                "Create New Template",
                "List Existing"
            };

            try
            {
                _driver.Navigate().GoToUrl(_muapUrl);
                manageUserAccessPage.WaitForPageToLoad();
                _test.Log(LogStatus.Info, $"Navigate to the MUAP: {_muapUrl}");

                superSuitNav.ClickJobPostings();
                CollectionAssert.AreEqual(mainMenu.GetNavLinkText(), expectedMenuItems, "Job Postings menu did not load correctly.");
                _test.Log(LogStatus.Pass, "Job Postings Menu items loaded correctly.");

                Assert.IsTrue(jobPostingPages.DashboardPage.IsDisplayed(), "Employee dashboard did not load correctly.");
                _test.Log(LogStatus.Pass, "Job Postings dashboard loaded correctly.");
            }
            catch (Exception e)
            {
                HandleException(e, _driver);
                throw;
            }
        }
コード例 #4
0
        public void LHN_JobPostings()
        {
            var mainMenu        = new MainMenu(_driver);
            var jobPostingPages = new JobPostingsPages(_driver);

            var expectedMenuItems = new StringCollection
            {
                "Job Postings Dashboard",
                "List All Active Postings",
                "Create New Posting",
                "Open Postings By Category",
                "Active Postings By Category",
                "All Postings By Status",
                "Requisition Inbox",
                "Create New Requisition",
                "My Draft Requisitions",
                "My Requisitions In Process",
                "My Open Requisitions",
                "My Closed Requisitions",
                "My Denied Requisitions",
                "Approved By Me -Active",
                "Approved By Me -InActive",
                "Close An Approved Posting",
                "All Active Requisitions",
                "All Inactive Requisitions",
                "Create New Template",
                "List Existing"
            };

            try
            {
                mainMenu.ClickJobPostings();
                _test.Log(LogStatus.Info, "Navigate to Job Postings");

                CollectionAssert.AreEqual(expectedMenuItems, mainMenu.GetNavLinkText(),
                                          "The Job Postings menu does not contain the correct items");
                _test.Log(LogStatus.Pass, "The Job Postings menu contains the correct items");

                Assert.IsTrue(jobPostingPages.DashboardPage.IsDisplayed(), "Employee dashboard did not load correctly.");
                _test.Log(LogStatus.Pass, "Job Postings dashboard loaded correctly.");
            }
            catch (Exception e)
            {
                HandleException(e, _driver);
                throw;
            }
        }
コード例 #5
0
        // TODO
        public void CreateJobRequisition()
        {
            var mainMenu            = new MainMenu(Driver);
            var jobPostingsSubMenu  = new SubMenuJobPostings(Driver);
            var jobPostingPages     = new JobPostingsPages(Driver);
            var jobPostingWorkflows = new JobPostingWorkflows(Driver);
            var jobData             = new JobData();

            Driver.SwitchToDefaultFrame();
            mainMenu.ClickMainMenuTab();
            // Navigate to Job Postings > Create New Requisition
            mainMenu.ClickJobPostings();
            jobPostingsSubMenu.ClickCreateNewRequisition();

            // Click 'A blank form'
            Driver.SwitchToFrameById("MainContentsIFrame");
            jobPostingPages.CreateNewPostingPage.ClickFromBlankForm();

            // Enter Title
            Driver.SwitchToFrameById("tabs_Panel");
            jobPostingPages.EditAndCreateJobRequisitionPage.MainTab.EnterJobTitle(jobData.JobTitle);

            // Enter other required data...
            jobPostingPages.EditAndCreateJobRequisitionPage.MainTab.SelectPositionType(jobData.PositionType);

            // Save
            Driver.SwitchToDefaultFrame();
            Driver.SwitchToFrameById("MainContentsIFrame");
            jobPostingPages.EditAndCreateJobRequisitionPage.ClickSaveButton();

            // Get the Requisition ID
            jobPostingPages.EditAndCreateJobRequisitionPage.GetJobId();

            // TODO figure out a more elegant way of doing this
            JobId = jobPostingPages.EditAndCreateJobRequisitionPage.JobId;

            // Go back o the main screen
            Driver.SwitchToDefaultFrame();
            mainMenu.ClickMainMenuTab();
        }
コード例 #6
0
        public void InactivateJobPosting(int jobId)
        {
            var mainMenu           = new MainMenu(Driver);
            var jobPostingsSubMenu = new SubMenuJobPostings(Driver);
            var jobPostingPages    = new JobPostingsPages(Driver);

            Console.WriteLine("Attemping to inactivate job posting with ID {0}", jobId);

            // navigate to Forms > Design Forms and Packets > Edit Forms
            Driver.SwitchToDefaultFrame();
            mainMenu.ClickMainMenuTab();
            mainMenu.ClickJobPostings();
            jobPostingsSubMenu.ClickListAllActivePostings();

            // select the job posting in the list
            Driver.SwitchToFrameById("MainContentsIFrame");
            jobPostingPages.ListAllActivePostingsPage.MarkListingCheckbox(jobId);

            // inactivate the posting
            Driver.SwitchToDefaultFrame();
            jobPostingPages.ListAllActivePostingsPage.ClickInactivatePostings();
            jobPostingPages.ListAllActivePostingsPage.ConfirmInactivation();
        }