public void Test5() { try { LoginPageSteps.LoginUser(TestsData.user1_email, TestsData.user1_password); string city = IpApiService.GetCityFromIp(TestsData.IP); BaseSteps.SendMessageWithEmoticons(TestsData.user1_email, TestsData.emoticon_subject, city, int.Parse(TestsData.emoticon_number_1), int.Parse(TestsData.emoticon_number_2)); InboxPageSteps.Refresh(); InboxPageSteps.GoToMessagePage(TestsData.user1_email, TestsData.emoticon_subject); Assert.AreEqual(2, MessagePageSteps.CountOfEmoticonsInMessage(), "The number of emoticons in the message is incorrect"); Assert.IsTrue(MessagePageSteps.IsMessageContainsText(TestsData.City), "The message doesn't contains right city name"); 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; } }
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; } }
public void Test14() { try { LoginPageSteps.LoginUser(TestsData.user1_email, TestsData.user1_password); BaseSteps.GoToSettings(); SettingPageSteps.SetOutOfOfficeAutoReplyOn(TestsData.vacation_subject, TestsData.vacation_message); LoginPageSteps.SwitchUser(TestsData.user2_email, TestsData.user2_password); BaseSteps.SendMessage(TestsData.user1_email, TestsData.subject, TestsData.message); BaseSteps.WaitForReply(); InboxPageSteps.Refresh(); Assert.IsTrue(InboxPageSteps.IsMessagePresentInInbox(TestsData.user1_email, $"{TestsData.vacation_subject} {TestsData.Re} {TestsData.subject}"), "Correct reply message isn't present in inbox, but it should be"); log.Info($"{TestContext.CurrentContext.Test.Name} - {TestsData.Pass}"); LoginPageSteps.SwitchUser(TestsData.user1_email, TestsData.user1_password); SettingPageSteps.SetOutOfOfficeAutoReplyOff(); } 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; } }
public void Test13() { try { LoginPageSteps.LoginUser(TestsData.user1_email, TestsData.user1_password); BaseSteps.SendMessage(TestsData.user1_email, TestsData.subject, TestsData.message); InboxPageSteps.Refresh(); InboxPageSteps.MarkMessageAsStarred(TestsData.user1_email, TestsData.subject); Assert.IsTrue(InboxPageSteps.IsMessagePresentInStarredFolder(TestsData.user1_email, TestsData.subject), "The message isn't marked as starred, 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; } }