public void SendEmail(string recipient, string message)
        {
            IWebDriver driver = Driver.Browser.GetDriver();

            _seleneDriver = new SeleneDriver(driver);

            MainEmailBoxPage mainPage = new MainEmailBoxPage();

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

            mainPage.ComposeButton.Click();

            EmailForm emailForm = new EmailForm();

            _seleneDriver.Find(emailForm.SendForm).Should(Be.Visible);

            _seleneDriver.SwitchTo().ActiveElement();

            emailForm.ToField.SendKeys(recipient);
            emailForm.ToField.SendKeys(Keys.Enter);
            emailForm.MessageArea.SendKeys(message);
            emailForm.MessageArea.SendKeys(Keys.Enter);

            _seleneDriver.Find(emailForm.MessageArea).ShouldNot(Be.Blank);
            emailForm.SendButton.Click();
        }
        public void DeleteEmail(string sender)
        {
            MainEmailBoxPage mainPage = new MainEmailBoxPage();

            string              emailName       = String.Format(_emailNameXPath, sender);
            IWebElement         emailTitle      = Driver.Browser.GetDriver().FindElement(By.XPath(emailName));
            MainNavigationPanel navigationPanel = new MainNavigationPanel();

            navigationPanel.MoreButton.Click();

            Actions Action = new Actions(Driver.Browser.GetDriver());

            Action.DragAndDrop(emailTitle, navigationPanel.TrashButton).Build().Perform();
        }
        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);
        }
예제 #4
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());
        }