예제 #1
0
        public void Toolbar_Inbox_FormNotification_Appears()
        {
            var dataGenerator = new FormInboxNotificationGenerator();

            try  //Contains Contents of Test
            {
                //Set up notification
                Console.WriteLine("Setting up data");
                dataGenerator.CreateNotificationData();
                Console.WriteLine("Data setup succeeded");

                // page objects
                new LoginWorkflows(Driver).LoginAsSuperUser();
                var toolbar = ToolbarFactory.Get(Driver);

                toolbar.WaitForLoad();
                VerifyUnreadItemPresent(toolbar, dataGenerator.ExpectedResult);
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
            finally
            {
                dataGenerator.DeleteNotificationData();
            }
        }
        public void Federated_Logout()
        {
            var loginPage       = new FederatedLoginPage(Driver);
            var toolbar         = ToolbarFactory.Get(Driver);
            var appSelectorPage = new AppSelectorPage(Driver);

            // In order to fully logout of a system using the federated login, this URL must be hit
            var federatedLogoutUrl = "https://federateoidcawsstage.flqa.net/core/logout";

            try  //Contains Contents of Test
            {
                loginPage.Login(LoginData.SuperUserName, LoginData.SuperUserPassword);

                appSelectorPage.SelectApp(@"Recruiting & Hiring");

                // the BaseFramework waits are not enough to stop this from failing...
                Thread.Sleep(TimeSpan.FromSeconds(3));

                // Logout
                toolbar.Logout();
                BrowseTo(federatedLogoutUrl, Driver);

                // Navigate back to the login page, check that the login page is displayed
                BrowseTo(BaseUrls["ApplitrackLoginPage"], Driver);
                Assert.IsTrue(loginPage.IsDisplayed(), "Logout failed");
                test.Log(LogStatus.Pass, "Logout was successful");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
예제 #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;
            }
        }
예제 #4
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;
            }
        }
예제 #5
0
        public void ManageUserAccessPage_SignOut()
        {
            // page objects
            var manageUserAccessPage = new ManageUserAccessPage(_driver);
            var toolbar    = ToolbarFactory.Get(_driver);
            var logoutPage = new IdmLogoutPage(_driver);

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

                manageUserAccessPage.WaitForPageToLoad();

                toolbar.Logout();
                _test.Log(LogStatus.Info, "Log out using Sidekick");

                Assert.IsTrue(logoutPage.IsDisplayed());
                _test.Log(LogStatus.Pass, "Log out was successful");
            }
            catch (Exception e)
            {
                HandleException(e, _driver);
                throw;
            }
        }
        private void ValidateNotificationWorkflow(INotificationGenerator dataGenerator)
        {
            try //Contains Contents of Test
            {
                //Set up notification
                test.Log(LogStatus.Info, "Setting up data");
                dataGenerator.CreateNotificationData();
                test.Log(LogStatus.Info, "Setting up data complete");

                new LoginWorkflows(Driver).LoginAsSuperUser();
                var toolbar = ToolbarFactory.Get(Driver);

                toolbar.WaitForLoad();
                VerifyUnreadItemPresent(toolbar, dataGenerator.ExpectedResult);
                VerifyMarkAsRead(toolbar, dataGenerator.ExpectedResult);
                ValidatePopupContent(toolbar, dataGenerator.ExpectedResult);
                VerifyMarkAsReadPersisted(toolbar, dataGenerator.ExpectedResult);
                VerifyDeleteItem(toolbar, dataGenerator.ExpectedResult);
                VerifyDeletePersisted(toolbar, dataGenerator.ExpectedResult);
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
            finally
            {
                dataGenerator.DeleteNotificationData();
            }
        }
예제 #7
0
        public void OpenEmployeeUsingSearch(string empNo, string empName)
        {
            // page objects
            var toolbar = ToolbarFactory.Get(_driver);

            _driver.SwitchToDefaultFrame();
            toolbar.ClickSearch();
            toolbar.SearchPage.EnterSearchText(empNo);

            // Open the employeepage
            toolbar.SearchPage.OpenEmployee(empName);
        }
예제 #8
0
        /// <summary>
        /// Open the applicant page using the search functionality.
        /// </summary>
        /// <param name="appNo">The applicant's number</param>
        /// <param name="appName">The applicant's name</param>
        public void OpenApplicantUsingSearch(string appNo, string appName)
        {
            // page objects
            var toolbar = ToolbarFactory.Get(_driver);

            // Search for the applicant
            _driver.SwitchToDefaultFrame();
            toolbar.ClickSearch();
            toolbar.SearchPage.EnterSearchText(appNo);

            // Open the applicant page
            toolbar.SearchPage.SelectSearchResult(appNo);
        }
예제 #9
0
        [Ignore] // TODO fix for zendesk functionality
        public void Toolbar_Help_Opens()
        {
            // page objects
            var toolbar = ToolbarFactory.Get(Driver);

            try  //Contains Contents of Test
            {
                new LoginWorkflows(Driver).LoginAsSuperUser();
                toolbar.ClickHelp();
                test.Log(LogStatus.Pass, "Click the Help button");

                Assert.IsTrue(toolbar.HelpMenuIsDisplayed(), "The help menu did not open");
                test.Log(LogStatus.Pass, "The help menu opened");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
예제 #10
0
        public void Toolbar_UserMenu_Opens()
        {
            // page objects
            var toolbar = ToolbarFactory.Get(Driver);

            try
            {
                new LoginWorkflows(Driver).LoginAsSuperUser();
                toolbar.ClickUserMenu();
                test.Log(LogStatus.Pass, "Click the Search button");

                Assert.IsTrue(toolbar.UserMenuIsDisplayed());
                test.Log(LogStatus.Pass, "The user menu opened");
            }
            catch (Exception e)
            {
                HandleException(e, Driver);
                throw;
            }
        }
예제 #11
0
        public void Toolbar_Inbox_Opens()
        {
            try  //Contains Contents of Test
            {
                // page objects
                new LoginWorkflows(Driver).LoginAsSuperUser();

                var toolbar = ToolbarFactory.Get(Driver);
                toolbar.ClickInbox();
                test.Log(LogStatus.Pass, "Click the Inbox button");

                Assert.IsTrue(toolbar.InboxIsDisplayed(), "The inbox did not open");
                test.Log(LogStatus.Pass, "The inbox opened");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
예제 #12
0
        public void Toolbar_Search_Opens()
        {
            // page objects
            var toolbar = ToolbarFactory.Get(Driver);

            try  //Contains Contents of Test
            {
                new LoginWorkflows(Driver).LoginAsSuperUser();
                toolbar.ClickSearch();
                test.Log(LogStatus.Pass, "Click the Search button");

                Assert.IsTrue(toolbar.SearchIsDisplayed());
                test.Log(LogStatus.Pass, "The news feed opened");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
예제 #13
0
        public void ManageUserAccessPage_Search()
        {
            // page objects
            var manageUserAccessPage = new ManageUserAccessPage(_driver);
            var toolbar = ToolbarFactory.Get(_driver);

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

                manageUserAccessPage.WaitForPageToLoad();

                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, "Search is displayed");

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

                Assert.IsTrue(toolbar.SearchPage.ApplicantsAreDisplayed(), "The applicant results are not displayed");
                _test.Log(LogStatus.Pass, "The applicant results are displayed");

                Assert.IsTrue(toolbar.SearchPage.EmployeesAreDisplayed(), "The employee results are not displayed");
                _test.Log(LogStatus.Pass, "The employee results are displayed");

                Assert.IsTrue(toolbar.SearchPage.JobPostingsAreDisplayed(), "The job posting results are not displayed");
                _test.Log(LogStatus.Pass, "The job posting results are displayed");

                Assert.IsTrue(toolbar.SearchPage.UsersAreDisplayed(), "The user results are not displayed");
                _test.Log(LogStatus.Pass, "The user results are displayed");
            }
            catch (Exception e)
            {
                HandleException(e, _driver);
                throw;
            }
        }
예제 #14
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;
            }
        }
예제 #15
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;
            }
        }
        public void Federated_Login_with_Valid_Credentials()
        {
            var loginPage       = new FederatedLoginPage(Driver);
            var toolbar         = ToolbarFactory.Get(Driver);
            var appSelectorPage = new AppSelectorPage(Driver);

            try  //Contains Contents of Test
            {
                loginPage.Login(LoginData.SuperUserName, LoginData.SuperUserPassword);

                appSelectorPage.SelectApp(@"Recruiting & Hiring");

                // the BaseFramework waits are not enough to stop this from failing...
                Thread.Sleep(TimeSpan.FromSeconds(3));

                Assert.IsTrue(toolbar.IsDisplayed(), "Login failed");
                test.Log(LogStatus.Pass, "Login was successful");
            }
            catch (Exception e) //On Error Do
            {
                HandleException(e, Driver);
                throw;
            }
        }
        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;
            }
        }