Esempio n. 1
0
        public void ThenElementWithAliasContainsText(string elementAlias, string expectedText)
        {
            var element = BaseSteps.FindElement(GooglePageName, elementAlias);

            string actualText;

            using (element)
            {
                actualText = element.GetText();
            }

            Assert.IsTrue(actualText.Contains(expectedText));
        }
Esempio n. 2
0
        public void Test2()
        {
            try
            {
                string path = $@"{TestContext.CurrentContext.TestDirectory}\{TestsData.normal_attach_file}";
                LoginPageSteps.LoginUser(TestsData.user1_email, TestsData.user1_password);
                BaseSteps.GoToSettings();
                SettingPageSteps.GoToForwardingAndPOP();
                ForwardPageSteps.AddForwardingAddress(TestsData.user2_email);
                LoginPageSteps.SwitchUser(TestsData.user2_email, TestsData.user2_password);
                InboxPageSteps.GoToMessagePage(TestsData.google_forwarding_email);
                MessagePageSteps.ConfirmForwarding();
                LoginPageSteps.SwitchUser(TestsData.user1_email, TestsData.user1_password);
                BaseSteps.GoToSettings();
                SettingPageSteps.GoToForwardingAndPOP();
                ForwardPageSteps.ChooseForwardingVariant();
                BaseSteps.GoToSettings();
                SettingPageSteps.GoToFiltersAndBlockedAddresses();
                FiltersPageSteps.CreateNewFilter(TestsData.user3_email);
                LoginPageSteps.SwitchUser(TestsData.user3_email, TestsData.user3_password);
                BaseSteps.SendMessage(TestsData.user1_email, TestsData.no_attach_subject, TestsData.no_attach_message);
                BaseSteps.SendMesageWithAttachment(TestsData.user1_email, TestsData.attach_subject, TestsData.attach_message, path);
                LoginPageSteps.SwitchUser(TestsData.user1_email, TestsData.user1_password);

                Assert.IsTrue(InboxPageSteps.IsMessagePresentInInbox(TestsData.user3_email, TestsData.no_attach_subject));
                Assert.IsTrue(ImportantPageSteps.IsMessageMarkedAsImportant(TestsData.user3_email, TestsData.no_attach_subject));//IsFalse

                Assert.IsTrue(TrashPageSteps.IsMessagePresentInTrash(TestsData.user3_email, TestsData.attach_subject));
                Assert.IsFalse(ImportantPageSteps.IsMessageMarkedAsImportant(TestsData.user3_email, TestsData.attach_subject));//IsTrue

                LoginPageSteps.SwitchUser(TestsData.user2_email, TestsData.user2_password);
                Assert.IsTrue(InboxPageSteps.IsMessagePresentInInbox(TestsData.user3_email, TestsData.no_attach_subject));
                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;
            }
        }
Esempio n. 3
0
 public void TearDown()
 {
     try
     {
         log.Info("TearDown started");
         LoginPageSteps.SwitchUser(TestsData.user1_email, TestsData.user1_password);
         BaseSteps.CleanUserSettingsAndMessages();
         LoginPageSteps.SwitchUser(TestsData.user2_email, TestsData.user2_password);
         BaseSteps.CleanUserSettingsAndMessages();
         BaseSteps.SignOut();
     }
     catch (Exception)
     {
         log.Error("Error occured in TearDown");
     }
     finally
     {
         WebDriver.CloseWebDriver();
         log.Info("TearDown finished");
     }
 }
 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;
     }
 }
Esempio n. 5
0
 public void Test3()
 {
     try
     {
         string path = $@"{TestContext.CurrentContext.TestDirectory}\{TestsData.big_attach_file_path}";
         LoginPageSteps.LoginUser(TestsData.user1_email, TestsData.user1_password);
         BaseSteps.SendMesageWithAttachment(TestsData.user2_email, TestsData.attach_subject, TestsData.attach_message, path);
         Assert.IsTrue(BaseSteps.IsLargeFileAlertPresent(), "Large file alert isn't present, but it should be");
         log.Info($"{TestContext.CurrentContext.Test.Name} - {TestsData.Pass}");
         BaseSteps.CloseAlert();
     }
     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;
     }
 }
Esempio n. 6
0
 public void Test12()
 {
     try
     {
         LoginPageSteps.LoginUser(TestsData.user1_email, TestsData.user1_password);
         BaseSteps.GoToSettings();
         SettingPageSteps.SetSignature(TestsData.signature);
         Assert.IsTrue(InboxPageSteps.IsSignaturePresentInMessage(TestsData.signature), "The signature isn't present, but it should be");
         log.Info($"{TestContext.CurrentContext.Test.Name} - {TestsData.Pass}");
         SettingPageSteps.RemoveSignature();
     }
     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;
     }
 }
Esempio n. 7
0
 public void Test4()
 {
     try
     {
         string path = $@"{TestContext.CurrentContext.TestDirectory}\{TestsData.not_image_file}";
         LoginPageSteps.LoginUser(TestsData.user1_email, TestsData.user1_password);
         BaseSteps.GoToThemes();
         ThemesPageSteps.ChangeBackgroungImage(path);
         Assert.IsTrue(ThemesPageSteps.IsUploadErrorOccured(), "Upload error hasn't occured, but it should have");
         ThemesPageSteps.CloseThemesWindow();
         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 LoginFeatureDefinition()
 {
     _baseSteps  = new BaseSteps();
     _loginSteps = new LoginSteps();
 }
Esempio n. 9
0
        public static void ThenTheCurrentPageTitleIs(string pageTitle)
        {
            var actual = BaseSteps.GetAutomationBrowser().GetTitle();

            Assert.AreEqual(pageTitle, actual);
        }
Esempio n. 10
0
 public void GivenIHaveNavigatedToGoogle()
 {
     BaseSteps.GetAutomationBrowser().NavigateTo("http://www.google.com");
 }