public LogInForm SignOut()
        {
            IWebDriver driver = Driver.Browser.GetDriver();

            _seleneDriver = new SeleneDriver(driver);

            MainEmailBoxPage mainPage = new MainEmailBoxPage();

            mainPage.LinkToAccountPopUp.Click();

            _seleneDriver.Find(SignOutButton).Should(Be.Visible);
            mainPage.SignOutButton.Click();

            LogInForm logInForm = new LogInForm();

            return(logInForm);
        }
Пример #2
0
        public MainEmailBoxPage LogInToEmailBox(string email, string password)
        {
            HomePage   homePage = new HomePage();
            IWebDriver driver   = Driver.Browser.GetDriver();

            _seleneDriver = new SeleneDriver(driver);

            LogInForm logInForm = new LogInForm();

            _seleneDriver.Find(LoginForm).Should(Be.Visible);

            if (driver.IsElementDisplayed(_changeUserButton))
            {
                ChangeUserButton.Click();
            }
            if (driver.IsElementDisplayed(_useAnotherAccountBy))
            {
                logInForm.UseAnotherAccountButton.Click();
            }

            //Enter credentials
            _seleneDriver.Find(LogInInput).Should(Be.Visible);

            logInForm.LogInInput.SendKeys(email);
            logInForm.NextEmailButton.Click();

            _seleneDriver.Find(PasswordInput).Should(Be.Visible);

            logInForm.PasswordInput.HighlightElement(_passwordInputBy);
            logInForm.PasswordInput.SendKeys(password);
            logInForm.NextPasswordButton.Click();

            //Wait till main mail box page is loaded
            MainEmailBoxPage mainEmailBoxPage = new MainEmailBoxPage();

            _seleneDriver.Find(mainEmailBoxPage.ComposeButton).Should(Be.Visible);

            return(new MainEmailBoxPage());
        }