コード例 #1
0
        public void LoginWithValidCredentialsTest()
        {
            LandingPage.OpenLoginForm();
            LandingPage.SubmitLoginForm(Dataset.FirstUser);

            Assert.True(LandingPage.WaitFindElement(LandingPage.UsernameLabel).Text == GetFromExcel(Dataset.FirstUser, Field.Username));

            LandingPage.Logout();
        }
コード例 #2
0
        public void SeveralLoginTests(string login, string password, string username)
        {
            LandingPage.OpenLoginForm();

            // Thread.Sleep. It's not generally a waiter in Selenium WebDriver context, but if imagine it is I would say it's an explicit waiter
            // Because it declared explicitly in specific chunk of test code
            System.Threading.Thread.Sleep(1000);

            LandingPage.WaitFindElement(LandingPage.LoginInput).SendKeys(login);
            LandingPage.WaitFindElement(LandingPage.PasswordInput).SendKeys(password);
            LandingPage.WaitFindElement(LandingPage.LoginButton).Click();

            Assert.True(LandingPage.WaitFindElement(LandingPage.UsernameLabel).Text == username);

            LandingPage.Logout();
        }