static void Main(string[] args) { LoginPageSteps loginPage = new LoginPageSteps(); LogoutPageSteps logoutPage = new LogoutPageSteps(); MainPageSteps mainPage = new MainPageSteps(); ThemesPageSteps themePage = new ThemesPageSteps(); SettingPageSteps settPage = new SettingPageSteps(); MailBoxPageSteps mailPage = new MailBoxPageSteps(); LetterPageSteps letterPage = new LetterPageSteps(); StarredPageSteps starredPage = new StarredPageSteps(); SpamPageSteps spamPage = new SpamPageSteps(); //MailBoxPageSteps mailPage = new MailBoxPageSteps(); //StarredPageSteps starredPage = new StarredPageSteps(); loginPage.Open(); loginPage.Authorize(D.user2, D.password); mailPage.WriteMessage(D.user3, "For starred", "XO"); logoutPage.CommonExit(); loginPage.Authorize(D.user3, D.password); Console.WriteLine(mainPage.CheckIfItIsStarred()); mainPage.GoToStarred(); Console.WriteLine(starredPage.CheckIfItIsStarredPage("https://mail.google.com/mail/u/0/#starred")); Console.WriteLine(starredPage.CheckTheTopic("For starred")); Console.ReadLine(); }
public void ErrorWhileTryingToAttachFileWithNotImageExtension() { string path = TestContext.CurrentContext.TestDirectory; ThemesPageSteps themePage = new ThemesPageSteps(); SettingPageSteps settPage = new SettingPageSteps(); loginPage.Authorize(Data.user1, Data.password); mainPage.GoToSettings(); settPage.GoToThemesPage(); themePage.SetTheme(); themePage.AddFileToThemes(path + Data.notImgFile); Assert.True(themePage.WrongExtensionError()); //**************** themePage.CloseWindows(); //**************** }
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; } }