Exemple #1
0
        /// <summary>
        /// Navigates browser to the organizations list page
        /// </summary>
        public static void GoToOrganizations()
        {
            if (OrganizationsPage.IsAt)
            {
                OrganizationsPage.ResetFilters();
                Commands.ClearSearchbox();
                return;
            }

            try
            {
                var organizationsBtn = Driver.Instance.FindElement(By.CssSelector("#Companies"));
                Driver.MoveToElement(organizationsBtn);
                organizationsBtn.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 Organization Page but is not or page is not loaded properly", e);
                throw e;
            }
            catch (WebDriverTimeoutException e)
            {
                Report.Report.ToLogFile(MessageType.Exception, "Failed to load Organizations page on time.", e);
                throw e;
            }
        }
Exemple #2
0
        public void Filter_Using_Organization_Type()
        {
            LeftSideMenu.GoToOrganizations();
            OrganizationsPage.FilterBy().SelectingAccountType(AccountType.Consultant).Filter();
            int expectedResult1 = 0;

            VerifyThat.AreEqual(OrganizationsPage.TotalOrganizationsCountByLabel, expectedResult1, $"The sum of organizations being displayed with Account Type = {AccountType.Consultant} is different from the expected. OrganizationsDisplayed={OrganizationsPage.TotalOrganizationsCountByLabel}, Expected={expectedResult1}");

            OrganizationsPage.ResetFilters();
            OrganizationsPage.FilterBy().SelectingAccountType(AccountType.Reseller).Filter();
            int expectedResult2 = 10;

            VerifyThat.AreEqual(OrganizationsPage.TotalOrganizationsCountByLabel, expectedResult2, $"The sum of organizations being displayed with Account Type = {AccountType.Reseller} is different from the expected. OrganizationsDisplayed={OrganizationsPage.TotalOrganizationsCountByLabel}, Expected={expectedResult2}");

            OrganizationsPage.ResetFilters();
            OrganizationsPage.FilterBy().SelectingAccountType(AccountType.Customer).Filter();
            int expectedResult3 = 82;

            VerifyThat.AreEqual(OrganizationsPage.TotalOrganizationsCountByLabel, expectedResult3, $"The sum of organizations being displayed with Account Type = {AccountType.Customer} is different from the expected. OrganizationsDisplayed={OrganizationsPage.TotalOrganizationsCountByLabel}, Expected={expectedResult3}");

            OrganizationsPage.ResetFilters();
            OrganizationsPage.FilterBy().SelectingAccountType(AccountType.Supplier).Filter();
            int expectedResult4 = 7;

            VerifyThat.AreEqual(OrganizationsPage.TotalOrganizationsCountByLabel, expectedResult4, $"The sum of organizations being displayed with Account Type = {AccountType.Supplier} is different from the expected. OrganizationsDisplayed={OrganizationsPage.TotalOrganizationsCountByLabel}, Expected={expectedResult4}");

            OrganizationsPage.ResetFilters();
            OrganizationsPage.FilterBy().SelectingAccountType(AccountType.Partner).Filter();
            int expectedResult5 = 1;

            VerifyThat.AreEqual(OrganizationsPage.TotalOrganizationsCountByLabel, expectedResult5, $"The sum of organizations being displayed with Account Type = {AccountType.Partner} is different from the expected. OrganizationsDisplayed={OrganizationsPage.TotalOrganizationsCountByLabel}, Expected={expectedResult5}");
        }