Пример #1
0
        public static /*bool*/ void CheckLetternTrash(string email, string text)
        {
            TrashPage tp = new TrashPage();

            InBoxPage inp    = new InBoxPage();
            bool      result = inp.CheckLetter(email, text);
        }
Пример #2
0
        public void TestSendAndDeleteMail()
        {
            // Login to the mail box.
            HomePage homePage = Login();

            // Send a mail.
            EmailPage emailPage = homePage.ClickWriteBtn();

            emailPage.CreateDraft(this.mailTo, this.subject, this.text);
            emailPage.SendDraft();

            // Delete sent mail.
            SentPage sentPage = homePage.OpenSent();

            sentPage.SelectMailBySubject(this.subject);
            sentPage.DeleteSelectedMail();

            // Verify, that the mail disappeared from ‘Sent’ folder.
            sentPage.RefreshPage();
            bool isMailDisplayed = sentPage.IsMailDisplayed(this.subject);

            Assert.IsFalse(isMailDisplayed);

            // Verify, that the mail is in ‘Trash’ folder
            TrashPage trashPage            = sentPage.OpenTrash();
            string    subjectOfDeletedMail = trashPage.GetMailSubjectText(this.subject);

            Assert.AreEqual(this.subject, subjectOfDeletedMail, "The mail wasn't deleted");

            // Log out.
            trashPage.Logout();
        }
Пример #3
0
        public static bool IsMessagePresentInTrash(string email, string subject)
        {
            TrashPage page = new TrashPage();

            page.WaitForPageToLoad();
            return(page.IsMessageExists(email, subject, 7));
        }
Пример #4
0
        public static void DeleteAllMail()
        {
            Thread.Sleep(5000);
            TrashPage tp = new TrashPage();

            tp.SelectAllMail();
            tp.ButtonDelete.Click();
        }
Пример #5
0
        public void TestSearchAndDeleteDraftMailWithContextMenu()
        {
            // Login to the mail box.
            HomePage homePage = Login();

            EmailPage emailPage;
            int       lengthOfSubject = subject.Length;
            int       num             = 5;

            // Create a new mail.
            // Save the mail as a draft.
            // Repeat steps 2-3 4 times.
            do
            {
                string sub = subject.Substring(0, lengthOfSubject);
                emailPage = homePage.ClickWriteBtn();
                emailPage.CreateDraft(this.mailTo, sub, this.text);
                emailPage.SaveAndCloseDraft();
                lengthOfSubject--;
                num--;
            } while (num != 0);


            // Perform search in drafts by clicking Enter key.
            DraftsPage draftsPage = homePage.JsOpenDrafts(); // JsExecutor

            draftsPage.TypeInSearchBox(this.subject);
            draftsPage.ClickEnterKey();                      // Action
            draftsPage.HighlightMailBySubject(this.subject); // JsExecutor
            string subjectOfFoundMail = draftsPage.GetMailSubjectText(this.subject);
            int    numberOfFoundMails = draftsPage.GetNumberOfMailsDisplayed();

            // Verify, that found draft matches searched term
            Assert.AreEqual(1, numberOfFoundMails, "The wrong number of mails was found");
            Assert.AreEqual(this.subject, subjectOfFoundMail, "The wrong mail was found");

            // Delete searched draft.
            homePage.DeleteMailWithContextMenu(this.subject); // Action

            // Verify, that the mail disappeared from ‘Drafts’ folder.
            draftsPage.RefreshPage();
            bool isMailDisplayed = draftsPage.IsMailDisplayed(this.subject);

            Assert.IsFalse(isMailDisplayed);

            // Verify, that the mail is in ‘Trash’ folder
            TrashPage trashPage            = draftsPage.OpenTrash();
            string    subjectOfDeletedMail = trashPage.GetMailSubjectText(this.subject);

            Assert.AreEqual(this.subject, subjectOfDeletedMail, "The mail wasn't deleted");

            // Log out.
            trashPage.Logout();
        }
Пример #6
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");
        }
Пример #7
0
        public static void CleanTrash()
        {
            TrashPage page = new TrashPage();

            page.WaitForPageToLoad();
            if (page.SelectAllMessages())
            {
                page.WaitForPageToLoad();
                page.BtnDeleteForever.Click(7);
                page.WaitForPageToLoad();
            }
        }
Пример #8
0
        private async void OnOpenTrash()
        {
            if (FileManager.GetTrashImages().Photos.Count == 0)
            {
                await DisplayAlert("Empty Trash", "Swipe a photo UP to put into trash first.", "Ok");

                return;
            }

            var trashPage = new TrashPage();

            trashPage.OperationCompleted += TrashPage_OperationCompleted;
            await Navigation.PushModalAsync(trashPage);
        }
        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.");
        }
Пример #10
0
        public static bool CheckLetterInTrash(string email, string text)
        {
            TrashPage tp = new TrashPage();

            return(tp.CheckLetter(email, text));
        }