Пример #1
0
        public bool AutorizeAndCheckSpam()
        {
            string    login1     = ConfigurationManager.AppSettings["login1"];
            string    pass1      = ConfigurationManager.AppSettings["password1"];
            string    login2     = ConfigurationManager.AppSettings["login2"];
            string    pass2      = ConfigurationManager.AppSettings["password2"];
            string    ip         = ConfigurationManager.AppSettings["ip"];
            IPLocator ipl        = new IPLocator(ip);
            string    textToSend = $"Hello, Dear. \r\n I'm writing you from {ipl.GetCityByIP()}. Weather is perfect. I'm waiting for You.";
            LoginPage loginPage  = new LoginPage();

            loginPage.OpenPage();
            loginPage.SetLoginAndPassword(login1, pass1);
            EmailPage emailPage = new EmailPage();

            emailPage.SendEmail(login2, textToSend);
            emailPage.Logout();
            loginPage.SwitchUser();
            loginPage.SetLoginAndPassword(login2, pass2);
            emailPage.AddToSpam();
            emailPage.Logout();
            loginPage.SwitchUser();
            loginPage.SetLoginAndPassword(login1, pass1);
            emailPage.SendEmail(login2, $"new {textToSend}");
            emailPage.Logout();
            loginPage.SwitchUser();
            loginPage.SetLoginAndPassword(login2, pass2);
            emailPage.GoToSpam();
            return(emailPage.CheckSpam($"new {textToSend}"));
        }