Example #1
0
 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;
     }
 }
Example #2
0
        public async Task GetCountryByIp()
        {
            var lookupService = new IpApiService(_configuration);

            var c = await lookupService.GetByApiAsync("178.9.118.185");

            Assert.NotNull(c);
        }