Example #1
0
        public void Search_AdvancedSearch_for_Employees_Route_as_RoutingOnly()
        {
            // page objects
            var employeeAdvancedSearchPage = new EmployeeAdvancedSearchPage(Driver);

            // workflows
            var loginWorkflow = new LoginWorkflows(Driver);

            try
            {
                loginWorkflow.LoginAsRoutingUser();
                test.Log(LogStatus.Info, "Log in as routing user");

                var empSearchUrl = $"{Driver.Url}?Destination=AdvancedEmpSearch";
                Driver.Navigate().GoToUrl(empSearchUrl);
                test.Log(LogStatus.Info, $"Navigate to {empSearchUrl}");

                _commonActions.SwitchToMainContentsIFrame();

                Assert.IsTrue(employeeAdvancedSearchPage.IsDisplayed(), "The Employee Advanced Search page did not open");
                test.Log(LogStatus.Pass, "The Advanced Search page for Employees opens");
            }
            catch (Exception e)
            {
                HandleException(e, Driver);
                throw;
            }
        }
Example #2
0
        public void Search_SuperUser_Can_Search_for_Employees()
        {
            // page objects
            var toolbar = ToolbarFactory.Get(Driver);

            // workflows
            var loginWorkflow = new LoginWorkflows(Driver);

            try
            {
                loginWorkflow.LoginAsSuperUser();
                test.Log(LogStatus.Pass, "Log in as super user");

                toolbar.ClickSearch();
                test.Log(LogStatus.Pass, "Click inside the search box");

                Assert.IsTrue(toolbar.SearchPage.IsDisplayed(), "The search is not displayed");
                test.Log(LogStatus.Pass, "The search is displayed");

                // Enter in a search that should find something
                toolbar.SearchPage.EnterSearchText("1");

                Assert.IsTrue(toolbar.SearchPage.EmployeesAreDisplayed(), "The employee results are not displayed");
                test.Log(LogStatus.Pass, "The employee results are displayed");
            }
            catch (Exception e)
            {
                HandleException(e, Driver);
                throw;
            }
        }
Example #3
0
        public void Search_AdvancedSearch_for_Employees_Opens()
        {
            // page objects
            var toolbar = ToolbarFactory.Get(Driver);
            var employeeAdvancedSearchPage = new EmployeeAdvancedSearchPage(Driver);

            // workflows
            var loginWorkflow = new LoginWorkflows(Driver);

            try
            {
                loginWorkflow.LoginAsSuperUser();
                test.Log(LogStatus.Info, "Log in as super user");

                toolbar.ClickSearch();
                test.Log(LogStatus.Info, "Click inside the search box");

                toolbar.SearchPage.ClickEmployeesAdvancedSearch();
                test.Log(LogStatus.Info, "Click Advanced Search for Employees");

                _commonActions.SwitchToMainContentsIFrame();

                Assert.IsTrue(employeeAdvancedSearchPage.IsDisplayed(), "The Employee Advanced Search page did not open");
                test.Log(LogStatus.Pass, "The Advanced Search page for Employees opens");
            }
            catch (Exception e)
            {
                HandleException(e, Driver);
                throw;
            }
        }
Example #4
0
        public void Search_AdvancedSearch_for_Applicants_Route()
        {
            // page objects
            var applicantAdvancedSearchPage = new ApplicantAdvancedSearchPage(Driver);

            // workflows
            var loginWorkflow = new LoginWorkflows(Driver);

            try
            {
                loginWorkflow.LoginAsSuperUser();
                test.Log(LogStatus.Info, "Log in as super user");

                var appSearchUrl = $"{Driver.Url}?Destination=AdvancedAppSearch";
                Driver.Navigate().GoToUrl(appSearchUrl);
                test.Log(LogStatus.Info, $"Navigate to {appSearchUrl}");

                _commonActions.SwitchToMainContentsIFrame();

                Assert.IsTrue(applicantAdvancedSearchPage.IsDisplayed(), "The Applicant Advanced Search page did not open");
                test.Log(LogStatus.Pass, "The Advanced Search page for Applicants opens");
            }
            catch (Exception e)
            {
                HandleException(e, Driver);
                throw;
            }
        }
Example #5
0
        public void TestSetup()
        {
            // extent reports setup
            _test = ExtentTestManager.StartTest(TestContext.Properties["TestCaseName"].ToString(),
                                                TestContext.Properties["TestCaseDescription"].ToString())
                    .AssignCategory("Smoke");

            // browser setup
            _driver = SetUp(_BT);
            BrowseTo(BaseUrls["ApplitrackLoginPage"], _driver);

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

            // login
            var loginWorkflow = new LoginWorkflows(_driver);

            loginWorkflow.LoginAsSuperUser();
        }
        public void TestSetup()
        {
            // extent reports setup
            test = ExtentTestManager.StartTest(TestContext.Properties["TestCaseName"].ToString(),
                                               TestContext.Properties["TestCaseDescription"].ToString())
                   .AssignCategory("Regression");

            // browser setup
            Driver = SetUp(_BT);
            Driver.Manage().Window.Maximize();
            BrowseTo("https://phlaptweb7.applitrack.com/devmichaelf", Driver);
            //BrowseTo(BaseUrls["ApplitrackLoginPage"], Driver);

            var loginWorkflows = new LoginWorkflows(Driver);

            //loginWorkflows.LoginAsSuperUser();
            loginWorkflows.Login("admin", "27157");
        }
        public void Permissions_InterviewQuestionnaire_Button_Displayed()
        {
            Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString());

            // pages
            var applicantProfilePage = new ApplicantProfilePages(Driver);
            var applicantMenu        = new ApplicantAdminMenu(Driver);

            // workflows
            var searchWorkflows = new SearchWorkflows(Driver);
            var loginWorkflows  = new LoginWorkflows(Driver);

            // applicant data
            const string appNo   = "1";
            const string appName = "Sample Applicant";

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

                loginWorkflows.LoginAsSuperUser();
                test.Log(LogStatus.Pass, "Logging in as a superuser");

                searchWorkflows.OpenApplicantUsingSearch(appNo, appName);
                Driver.SwitchToFrameById("App" + appNo);
                test.Log(LogStatus.Pass, "Search for and open applicant: " + appNo + appName);

                applicantMenu.ClickInterviews();
                test.Log(LogStatus.Pass, "Click Interviews");

                Assert.IsTrue(applicantProfilePage.Interviews.IsFillOutInterviewQuestionnaireVisible());
                test.Log(LogStatus.Pass, "The 'Fill Out Interview Questionnaire' button is visible");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
Example #8
0
        [Ignore] // TODO figure out how to handle this test for both standard and IDM logins
        public void Login_with_Invalid_UserID_and_Invalid_PW()
        {
            // page objects
            var toolbar = ToolbarFactory.Get(Driver);

            // workflows
            var loginWorkflow = new LoginWorkflows(Driver);

            try  // Contents of the test
            {
                loginWorkflow.Login("INVALID", "INVALID");

                // Assert that the login failed
                Assert.IsFalse(toolbar.IsDisplayed(), "The invalid login was successful");
                test.Log(LogStatus.Pass, "Login was unsuccessful");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
Example #9
0
        public void Logout_Verify()
        {
            // page objects
            var loginPage = new LoginPage(Driver);
            var toolbar   = ToolbarFactory.Get(Driver);

            // workflows
            var loginWorkflow = new LoginWorkflows(Driver);

            try  //Contains Contents of Test
            {
                //ScreenshotHelper.TakeScreenShot(TestContext.Properties["TestCaseName"].ToString(), Driver);
                loginWorkflow.LoginAsSuperUser();
                test.Log(LogStatus.Pass, "Login as a super user");

                // Logout
                toolbar.Logout();

                test.Log(LogStatus.Pass, "Log out");

                // Assert that the logout was successful
                if (_idmEnabled)
                {
                    Assert.IsTrue(loginPage.IsTextOnScreen(Driver, "You are signed out."));
                }
                else
                {
                    Assert.IsTrue(loginPage.IsTextOnScreen(Driver, "Enter Your UserID And Password To Begin"));
                }

                test.Log(LogStatus.Pass, "Log out was successful");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
Example #10
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'");
        }
        public void Applicant_Login_Count()
        {
            Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString());

            // page objects
            var mainMenu       = new MainMenu(Driver);
            var applicantMenu  = new SubMenuApplicants(Driver);
            var applicantPages = new ApplicantAdminPages(Driver);
            var toolbar        = ToolbarFactory.Get(Driver);

            var applicantProfilePage = new ApplicantProfilePages(Driver);

            // workflows
            var searchWorkflow = new SearchWorkflows(Driver);
            var loginWorkflow  = new LoginWorkflows(Driver);

            // applicant data
            const string appNo   = "1";
            const string appName = "Sample Applicant";

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

                // Navigate to Applicants > Applicant Dashboard
                mainMenu.ClickApplicants();
                applicantMenu.ClickApplicantDashboard();
                test.Log(LogStatus.Pass, "Navigate to Applicants > Applicant Dashboard");

                // Navigate to 'Overall Statistics' and get the value from 'Applicant Logins in Last 24 Hours'
                applicantPages.Dashboard.ClickOverallStatistics();
                test.Log(LogStatus.Pass, "Click 'Overall Statistics'");
                var actualCount = applicantPages.Dashboard.GetLoginCount();
                test.Log(LogStatus.Info, "Current login count: " + actualCount);

                // Login as an applicant
                searchWorkflow.OpenApplicantUsingSearch(appNo, appName);
                Driver.SwitchToFrameById("App" + appNo);
                applicantProfilePage.Toolbar.LoginAsApplicant();
                test.Log(LogStatus.Pass, "Log in as applicant");
                Driver.SwitchToPopup();
                Driver.ClosePopup();
                test.Log(LogStatus.Pass, "Login as " + appName);

                // The count should incease by 1 after logging in
                var expectedCount = actualCount + 1;

                // Go back to the applicant dashboard to get the new count
                // The count will NOT refresh unless the user logs out and logs back in again.
                toolbar.Logout();
                BrowseTo(BaseUrls["ApplitrackLoginPage"], Driver); // go back to the login page
                loginWorkflow.LoginAsSuperUser();
                mainMenu.ClickApplicants();
                applicantMenu.ClickApplicantDashboard();
                applicantPages.Dashboard.ClickOverallStatistics();
                actualCount = applicantPages.Dashboard.GetLoginCount(); // get the new count
                test.Log(LogStatus.Info, "New login count: " + actualCount);

                // Assert that the count was increased
                Assert.AreEqual(expectedCount, actualCount, "The expected count: " + expectedCount + " does not match the actual count: " + actualCount);
            }
            catch (Exception e)
            {
                HandleException(e, Driver);
                throw;
            }
        }