コード例 #1
0
        public void AddAndRemoveIssue()
        {
            IWebDriver driver = new ChromeDriver();

            driver.Navigate().GoToUrl(_loginPageUrl);
            LoginPage loginPage = new LoginPage(driver);

            loginPage.TypeUserLogin(_correctLogin);
            loginPage.TypeUserPassword(_correctPassword);
            loginPage.ClickLoginButton();

            ProjectsListPage projectsListPage = new ProjectsListPage(driver);

            driver.FindElement(By.CssSelector("a[title='ListBoxer']")).Click();

            driver.FindElement(By.Id("issue-name")).SendKeys("Unique issues name 78999");
            driver.FindElement(By.XPath("//button[text()='Add']")).Click();

            var         wait       = new WebDriverWait(driver, TimeSpan.FromSeconds(3));
            IWebElement addedIssue = wait.Until(ExpectedConditions.ElementExists(By.XPath("//div[text()='Unique issues name 78999']")));

            addedIssue.Click();
            Thread.Sleep(3000);

            wait = new WebDriverWait(driver, TimeSpan.FromSeconds(3));
            IWebElement deleteIcon = wait.Until(ExpectedConditions.ElementExists(By.XPath("//ul[@class='right']/li[@class='delete']/i[@class='icon-trash']")));

            deleteIcon.Click();
        }
コード例 #2
0
        public void CheckThatItIsNotPossibleToCreateMoreThan1Project()
        {
            IWebDriver driver = new ChromeDriver();

            driver.Navigate().GoToUrl(_loginPageUrl);
            LoginPage loginPage = new LoginPage(driver);

            loginPage.TypeUserLogin(_correctLogin);
            loginPage.TypeUserPassword(_correctPassword);
            loginPage.ClickLoginButton();
            ProjectsListPage projectsListPage = new ProjectsListPage(driver);

            projectsListPage.ClickCreateProjectButton();
            string actual = projectsListPage.GiveUpgradeSubsriptionText();

            driver.Quit();

            Assert.Contains("Your current subscription doesn't allow you to own more than 1 project.", actual);
        }
コード例 #3
0
        public void CheckThatItIsPossibleToLoginWithCorrectLoginAndPassword()
        {
            IWebDriver driver = new ChromeDriver();

            driver.Navigate().GoToUrl(_loginPageUrl);
            LoginPage loginPage = new LoginPage(driver);

            loginPage.TypeUserLogin(_correctLogin);
            loginPage.TypeUserPassword(_correctPassword);
            loginPage.ClickLoginButton();

            try
            {
                ProjectsListPage projectsListPage = new ProjectsListPage(driver);
            }
            catch
            {
                Assert.True(false, "Login wasn't successful.");
            }
            finally
            {
                driver.Quit();
            }
        }