public void Test11()
 {
     try
     {
         LoginPageSteps.LoginUser(TestsData.user1_email, TestsData.user1_password);
         BaseSteps.SendMessage(TestsData.user1_email, TestsData.subject, TestsData.message);
         InboxPageSteps.Refresh();
         InboxPageSteps.ReportMessageAsSpam(TestsData.user1_email, TestsData.subject);
         Assert.IsTrue(SpamPageSteps.IsMessagePresentInSpam(TestsData.user1_email, TestsData.subject), "The message isn't moved from inbox to spam, but it should be");
         SpamPageSteps.MoveMessageToInbox(TestsData.user1_email, TestsData.subject);
         Assert.IsTrue(InboxPageSteps.IsMessagePresentInInbox(TestsData.user1_email, TestsData.subject), "The message isn't moved from spam to inbox, but it should be");
         log.Info($"{TestContext.CurrentContext.Test.Name} - {TestsData.Pass}");
     }
     catch (Exception ex) when(ex is NoSuchElementException || ex is TimeoutException)
     {
         log.Info($"{TestContext.CurrentContext.Test.Name} - {TestsData.Failed}");
         log.Error(ex);
     }
     catch (AssertionException ex)
     {
         log.Info($"{TestContext.CurrentContext.Test.Name} - {TestsData.Failed}");
         log.Error(ex.Message);
         throw;
     }
 }
示例#2
0
 public void Test1()
 {
     try
     {
         LoginPageSteps.LoginUser(TestsData.user2_email, TestsData.user2_password);
         BaseSteps.SendMessage(TestsData.user1_email, TestsData.subject, TestsData.message);
         LoginPageSteps.SwitchUser(TestsData.user1_email, TestsData.user1_password);
         InboxPageSteps.ReportMessageAsSpam(TestsData.user2_email, TestsData.subject);
         LoginPageSteps.SwitchUser(TestsData.user2_email, TestsData.user2_password);
         BaseSteps.SendMessage(TestsData.user1_email, TestsData.subject2, TestsData.message2);
         LoginPageSteps.SwitchUser(TestsData.user1_email, TestsData.user1_password);
         Assert.IsTrue(SpamPageSteps.IsMessagePresentInSpam(TestsData.user2_email, TestsData.subject2), "Second message isn't in spam, but it should be");
         log.Info($"{TestContext.CurrentContext.Test.Name} - {TestsData.Pass}");
     }
     catch (Exception ex) when(ex is NoSuchElementException || ex is TimeoutException)
     {
         log.Info($"{TestContext.CurrentContext.Test.Name} - {TestsData.Failed}");
         log.Error(ex);
     }
     catch (AssertionException ex)
     {
         log.Info($"{TestContext.CurrentContext.Test.Name} - {TestsData.Failed}");
         log.Error(ex.Message);
         throw;
     }
 }