Пример #1
0
        public void LoginHomeLoginRegister()
        {
            LoginPage loginPage = new LoginPage(_driver);
            User      user      = User.GetValidUserForLogin();

            Assert.True(loginPage.Navigate().FillUser(user).Submit().ToLogin().ToRegister().FillUser(user).AreEqual());
        }
Пример #2
0
        public void SuccessLogin()
        {
            LoginPage loginPage = new LoginPage(_driver);
            User      user      = User.GetValidUserForLogin();
            HomePage  homePage  = loginPage.Navigate().FillUser(user).Submit();

            Assert.True(homePage.AreEqual());
            homePage.ToLogin();
        }
Пример #3
0
        public void SuccessSettings()
        {
            LoginPage loginPage = new LoginPage(_driver);
            User      user      = User.GetValidUserForLogin();

            user.FilePath =
                @"/Users/halloween/Downloads/white_mountains_peaks_lake_reflection_nature-wallpaper-1440x2560.jpg";

            Assert.True(loginPage.Navigate().FillUser(user).Submit().ToSettings().FillUser(user).Submit().ToHome()
                        .ToLogin().AreEqual());
        }
Пример #4
0
        public void SuccessFindPosts()
        {
            LoginPage loginPage = new LoginPage(_driver);
            User      user      = User.GetValidUserForLogin();

            HomePage    homePage = loginPage.Navigate().FillUser(user).Submit();
            List <Post> posts    = homePage.Follow("apple").GetPosts();

            homePage.Unfollow("apple");
            homePage.ToLogin();

            Assert.True(posts.Count > 0);
        }
Пример #5
0
        public void TransitionBetweenLoginAndRegisterPages()
        {
            LoginPage    loginPage    = new LoginPage(_driver);
            RegisterPage registerPage = loginPage.Navigate().ToRegister();
            User         user         = User.GetRandomUser();

            registerPage.FillUser(user);
            Assert.True(registerPage.AreEqual());
            loginPage = registerPage.ToLogin();
            Assert.True(loginPage.AreEqual());
            user = User.GetValidUserForLogin();
            HomePage homePage = loginPage.FillUser(user).Submit();

            Assert.True(homePage.AreEqual());
        }
Пример #6
0
        public void SuccessFollow()
        {
            LoginPage loginPage = new LoginPage(_driver);
            User      user      = User.GetValidUserForLogin();
            HomePage  homePage  = loginPage.Navigate().FillUser(user).Submit();

            homePage.Follow("anubeloredelana").Follow("wylsacom").Follow("apple");
            List <FollowUser> users = homePage.GetFollows();

            homePage.Navigate();
            homePage.ToLogin();
            Assert.AreEqual("anubeloredelana", users[0].Name);
            Assert.AreEqual("wylsacom", users[1].Name);
            Assert.AreEqual("apple", users[2].Name);
        }
Пример #7
0
        public void FailedLogin()
        {
            LoginPage loginPage = new LoginPage(_driver);
            User      user      = User.GetValidUserForLogin();

            try
            {
                user.Email = "";
                loginPage.Navigate().FillUser(user).Submit();
            }
            catch (MessageException e)
            {
                Assert.AreEqual("Email is empty", e.Message);
            }

            user = User.GetValidUserForLogin();
            try
            {
                user.Email = "*****@*****.**";
                loginPage.Navigate().FillUser(user).Submit();
            }
            catch (MessageException e)
            {
                Assert.AreEqual("Email is incorrect", e.Message);
            }

            user = User.GetValidUserForLogin();
            try
            {
                user.Password = "";
                loginPage.Navigate().FillUser(user).Submit();
            }
            catch (MessageException e)
            {
                Assert.AreEqual("Password is empty", e.Message);
            }

            user = User.GetValidUserForLogin();
            try
            {
                user.Password = "******";
                loginPage.Navigate().FillUser(user).Submit();
            }
            catch (MessageException e)
            {
                Assert.AreEqual("Password is incorrect", e.Message);
            }
        }
Пример #8
0
        public void FailedFindPosts()
        {
            LoginPage loginPage = new LoginPage(_driver);
            User      user      = User.GetValidUserForLogin();

            HomePage homePage = loginPage.Navigate().FillUser(user).Submit();

            try
            {
                List <Post> posts = homePage.GetPosts();
            }
            catch (MessageException exception)
            {
                Assert.AreEqual("No follows", exception.Message);
            }
            finally
            {
                homePage.ToLogin();
            }
        }
Пример #9
0
        public void SuccessUnfollow()
        {
            LoginPage loginPage = new LoginPage(_driver);
            User      user      = User.GetValidUserForLogin();
            HomePage  homePage  = loginPage.Navigate().FillUser(user).Submit();

            homePage.Unfollow("apple").Unfollow("wylsacom").Unfollow("anubeloredelana");
            try
            {
                homePage.GetFollows();
            }
            catch (MessageException exception)
            {
                Assert.AreEqual("Follow is empty", exception.Message);
            }
            finally
            {
                homePage.Navigate();
                homePage.ToLogin();
            }
        }