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_LogInCheckThatEmailIsSent() { _homePage = new HomePage(); _logInform = _homePage.OpenLoginForm(); //Log in as first user _logInform.LogInToEmailBox(Constants.Sender, Constants.Password); _mainEmailBoxPage = new MainEmailBoxPage(); //Write and send an email _mainEmailBoxPage.SendEmail(Constants.Recipient, Constants.Message); _navigationPanel = new MainNavigationPanel(); //Verify that email is in sent mail box _sentMailPage = _navigationPanel.OpenSentMailPage(); bool isEmailInSentBox = _sentMailPage.RecipientName.Displayed; 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.SenderName.Displayed; 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 trashPage = new TrashPage(); bool isEmailInTrash = trashPage.SenderName.Displayed; Assert.IsTrue(isEmailInTrash, $"Email is not displayed in Trash"); _logInform = _mainEmailBoxPage.SignOut(); }
public void GivenISignOut() { By signOutButtonBy = By.XPath("//a[text()='Sign out']"); MainEmailBoxPage mainPage = new MainEmailBoxPage(); mainPage.LinkToAccountPopUp.Click(); mainPage.WaitTillElementIsVisible(signOutButtonBy); mainPage.SignOutButton.Click(); LogInForm logInForm = new LogInForm(); Logger.Configure(); Log.Information($"I sign out"); }
public void WhenIMoveTheEmailToTrash(string sender) { string _emailNameXPath = "//span[contains(@name,'{0}')]"; string emailName = String.Format(_emailNameXPath, sender); IWebElement emailTitle = Browser.GetDriver().FindElement(By.XPath(emailName)); MainEmailBoxPage mainPage = new MainEmailBoxPage(); Actions Action = new Actions(Browser.GetDriver()); Actions RightClickAction = new Actions(Browser.GetDriver()).ContextClick(emailTitle); RightClickAction.Build().Perform(); mainPage.DeleteICon.Click(); Logger.Configure(); Log.Information($"I move email from '{sender}' to trash."); }