コード例 #1
0
        public void ChangeItemsPerPageMin(IWebDriver driver)
        {
            if (myProfileInstance != null)
            {
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
                IReadOnlyCollection <IWebElement> auxiliaryCollection;

                myProfileInstance.ChangeNumberOfItems(driver, 25);
                wait.Until(ExpectedConditions.ElementToBeClickable(By.Id("jnotify-item-msg")));

                auxiliaryCollection = driver.FindElements(By.Id("jnotify-item-msg"));
                if (auxiliaryCollection.Count == 1)
                {
                    infoMessage = auxiliaryCollection.ElementAt(0);
                }
            }
        }
コード例 #2
0
        public void MyProfile_ChangeNumberOfItems_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.ProfileClick(driver);
                MyProfile myProfile = new MyProfile(driver);

                /* Set of assertions */

                myProfile.DropDownInitialization(driver);
                Assert.AreEqual(250, myProfile.ChosenItemsPerPage);

                myProfile.ChangeNumberOfItems(driver, 25);

                Assert.AreEqual(0, myProfile.MyProfileBodyIsDisplayed);

                driver.Navigate().Refresh();

                testPage = new ProjectsPage(driver, projectTitle);
                testPage.ClickChosenProject();

                testProjectPage = new ParticularProjectPage(driver);
                testProjectPage.ProfileClick(driver);

                myProfile = new MyProfile(driver);

                myProfile.DropDownInitialization(driver);
                Assert.AreEqual(25, myProfile.ChosenItemsPerPage);
            }
        }