示例#1
0
        /// <summary>
        /// Navigates browser to the Co-workers list page
        /// </summary>
        public static void GoToCoworkers()
        {
            if (CoworkersPage.IsAt)
            {
                CoworkersPage.ResetFilters();
                Commands.ClearSearchbox();
                return;
            }


            try
            {
                var coworkersBtn = Driver.Instance.FindElement(By.CssSelector("#Users"));
                Driver.MoveToElement(coworkersBtn);
                coworkersBtn.Click();

                // wait for organization list to load
                var wait = new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(10));
                wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("main-content")));
            }
            catch (NoSuchElementException e)
            {
                Report.Report.ToLogFile(MessageType.Exception,
                                        "Browser was expected to be in Co-workers Page but is not or page is not loaded properly", e);
                throw e;
            }
            catch (WebDriverTimeoutException e)
            {
                Report.Report.ToLogFile(MessageType.Exception, "Failed to load Co-workers page on time.", e);
                throw e;
            }
        }
示例#2
0
        public void Filter_Using_Department_Filter()
        {
            CoworkersPage.FilterBy().SelectingDepartment(Department.RnD).Filter();
            var expectedResult1 = 4;

            VerifyThat.AreEqual(CoworkersPage.TotalCoworkersCount, expectedResult1,
                                $"The sum of contacts being displayed, with Allow Emails = True, is different from the expected. ContactsDisplayed={CoworkersPage.TotalCoworkersCount}, Expected={expectedResult1}");
            CoworkersPage.ResetFilters();

            CoworkersPage.FilterBy().SelectingDepartment(Department.Administration).SelectingDepartment(Department.Consulting).Filter();
            var expectedResult2 = 5;

            VerifyThat.AreEqual(CoworkersPage.TotalCoworkersCount, expectedResult2,
                                $"The sum of contacts being displayed, with Allow Emails = True, is different from the expected. ContactsDisplayed={CoworkersPage.TotalCoworkersCount}, Expected={expectedResult2}");
            CoworkersPage.ResetFilters();
        }