コード例 #1
0
        public void LogIn_SendEmail_DeleteViaRightMouseClick()
        {
            _homePage = new HomePage();

            IWebDriver driver = Browser.GetDriver();

            driver.Manage();

            _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.InboxLink.Displayed;

            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);

            _logInform = _mainEmailBoxPage.SignOut();
        }
コード例 #2
0
        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();
        }