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); }
public void GivenISentAnEmailToWithText(string email, string text) { MainEmailBoxPage _mainEmailBoxPage = new MainEmailBoxPage(); _mainEmailBoxPage.SendEmail(email, text); Logger.Configure(); Log.Information($"I send message with text '{text}': to '{email}'"); }
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"); }