示例#1
0
        public void LogInWithWrongDataTest(string login, string password)
        {
            GmailAboutPage aboutPage = null;

            try
            {
                aboutPage = new GmailAboutPage(AppDomain.CurrentDomain.BaseDirectory);
                var singInPage = aboutPage.GoToSingInPage();
                singInPage.InputLogin(login);
                singInPage.TypePassword(password);
                singInPage.PasswordInputElement.SendKeys(Keys.Enter);
                this.driver = singInPage.Driver;
                var wait = new WebDriverWait(this.driver, TimeSpan.FromSeconds(3.0));
                wait.Until(ExpectedConditions.ElementIsClickable(By.XPath("//div[contains(.,'Неверный')]")));
                Assert.IsTrue(this.driver.FindElement(
                                  By.XPath("//div[contains(.,'Неверный')]")).Displayed);
            }
            catch (WebDriverException e)
            {
                Console.WriteLine(e);
                throw;
            }
            finally
            {
                aboutPage.Driver.Quit();;
            }
        }
示例#2
0
        public void EnterEmptyPasswordTest(string login, string password)
        {
            GmailAboutPage aboutPage = null;

            try
            {
                aboutPage = new GmailAboutPage(AppDomain.CurrentDomain.BaseDirectory);
                var singInPage = aboutPage.GoToSingInPage();
                singInPage.InputLogin(login);
                singInPage.TypePassword(Keys.Enter);
                this.driver = singInPage.Driver;
                Assert.IsTrue(
                    this.driver.FindElement(By.XPath("//div[contains(.,'Введите')] | //div[contains(.,'Enter')]"))
                    .Enabled);
            }
            catch (WebDriverException e)
            {
                Console.WriteLine(e);
                throw;
            }
            finally
            {
                aboutPage.Driver.Quit();
            }
        }
        public void GivenUserIsSignedInIntoGmail(string userName, string password)
        {
            var googleSearchPage = new GoogleSearchPage();

            Browser.Instance.GoToUrl(AppSettings.Url);
            var signInPage = new SignInPage();

            signInPage.PopulateEmailAndClickEnter(userName);
            var gmailAboutPage = new GmailAboutPage();

            gmailAboutPage.ClickToSignIn();
            signInPage.PopulateEmailAndClickEnter(userName);
            signInPage.EnterPassword(password);
        }
示例#4
0
        public void LogInWithCorrectDataTest(string login, string password)
        {
            GmailAboutPage aboutPage = null;

            try
            {
                aboutPage = new GmailAboutPage(AppDomain.CurrentDomain.BaseDirectory);
                var singInPage = aboutPage.GoToSingInPage();
                singInPage.InputLogin(login);
                singInPage.TypePassword(password);
                Assert.IsTrue(singInPage.GoToHomePage().WriteANewLetterButton.Enabled);
            }
            catch (WebDriverException e)
            {
                Console.WriteLine(e);
                throw;
            }
            finally
            {
                aboutPage.Driver.Quit();;
            }
        }