public void LogInSendEmail_DeleteViaRightMouseClick()
        {
            _homePage = new HomePage();

            _logInform = _homePage.OpenLoginForm();

            //Log in as first user
            _mainEmailBoxPage = _logInform.LogInToEmailBox(Constants.Sender, Constants.Password);

            _navigationPanel = new MainNavigationPanel();

            //Verify that login is successful

            bool isFirstLoginSuccessfull = _navigationPanel.IsElementVisible(_navigationPanel.InboxLink);

            Assert.IsTrue(isFirstLoginSuccessfull, $"Login of first user '{Constants.Sender}' was not successful");

            //Write and send an email
            _mainEmailBoxPage.SendEmail(Constants.Recipient, Constants.Message);

            _logInform = _mainEmailBoxPage.SignOut();

            _logInform.LogInToEmailBox(Constants.Recipient, Constants.Password);

            //Delete an email
            _mainEmailBoxPage.DeleteEmailViaRightClick(Constants.SenderName);
        }
Exemplo n.º 2
0
        public void LogInSendEmailLogOut_LogInChechThatEmailIsSent()
        {
            // IHomePage _homePage = new HomePageDecorator(new HomePage());

            _logInform = _homePage.OpenLoginForm();

            //Log in as first user
            _logInform.LogInToEmailBox(Constants.Sender, Constants.Password);

            //Verify that login is successful
            _navigationPanel = new MainNavigationPanel();

            bool isFirstLoginSuccessfull = _navigationPanel.IsElementVisible(_navigationPanel.InboxLink);

            Assert.IsTrue(isFirstLoginSuccessfull, $"Login of first user '{Constants.Sender}' was not successful");

            //Write and send an email
            _mainEmailBoxPage.SendEmail(Constants.Recipient, Constants.Message);

            //Verify that email is in sent mail box
            _navigationPanel.SentMailLink.Click();

            _sentMailPage = new SentMailPage();

            bool isEmailInSentBox = _sentMailPage.IsElementVisible(_sentMailPage.RecipientName);

            Assert.IsTrue(isEmailInSentBox, "Email was not sent and is not resent in Sent Mail box");

            _logInform = _mainEmailBoxPage.SignOut();

            _logInform.LogInToEmailBox(Constants.Recipient, Constants.Password);

            //Verify that login is successful
            bool isSecondLoginSuccessfull = _navigationPanel.InboxLink.Displayed;

            Assert.IsTrue(isSecondLoginSuccessfull, $"Login of second user '{Constants.Recipient}' was not successful");

            //Verify that email is in Inbox
            bool isEmailInInbox = _sentMailPage.IsElementVisible(_sentMailPage.SenderName);

            Assert.IsTrue(isEmailInInbox, $"Email is not displayed in Inbox");

            //Drag&drop email to trash
            _mainEmailBoxPage.DeleteEmail(Constants.SenderName);

            //Verify that email is in the trash
            _navigationPanel.TrashButton.Click();

            _trashPage = new TrashPage();

            bool isEmailInTrash = _trashPage.IsElementVisible(_trashPage.SenderName);

            Assert.IsTrue(isEmailInInbox, $"Email is not displayed in Trash");
        }
        public void ThenISeeThatTheEmailIsPresentInSentFolder(string email)
        {
            string bodyXpath = "//*[contains(@email,'{0}')]/../..";
            string emailText = String.Format(bodyXpath, email);

            MainNavigationPanel navigationPanel = new MainNavigationPanel();

            navigationPanel.SentMailLink.Click();
            SentMailPage sentMailPage = new SentMailPage();

            IWebElement toField = Browser.GetDriver().FindElement(By.XPath(emailText));

            bool isEmailInSentBox = toField.Displayed;

            Assert.IsTrue(isEmailInSentBox, $"Email '{email}' was not sent and is not present in Sent Mail box");

            Logger.Configure();
            Log.Information($"I check that email from '{email}' is present in the Sent folder.");
        }
        public void ThenISeeThatEmailWithRecipientIsInTrash(string sender)
        {
            MainNavigationPanel navigationPanel = new MainNavigationPanel();

            navigationPanel.TrashButton.Click();

            TrashPage trashPage = new TrashPage();

            string      _emailNameXPath = "//span[contains(@name,'{0}')]";
            string      emailName       = String.Format(_emailNameXPath, sender);
            IWebElement emailTitle      = Browser.GetDriver().FindElement(By.XPath(emailName));

            bool isEmailInTrash = trashPage.SenderName.Displayed;

            Assert.IsTrue(isEmailInTrash, $"Email from '{sender}' is not displayed in Trash");

            Logger.Configure();
            Log.Information($"I check that email from '{sender}' is present in the trash.");
        }