Exemple #1
0
 public void InitPages()
 {
     loginPage         = new LoginPage(Driver);
     homePage          = new HomePage(Driver);
     commonElements    = new CommonElements(Driver);
     productPage       = new ProductPage(Driver);
     searchPage        = new SearchPage(Driver);
     productFilterPage = new ProductFilterPage(Driver);
     shoppingCartPage  = new ShoppingCartPage(Driver);
     accountPage       = new AccountPage(Driver);
     userInfoPage      = new UserInfoPage(Driver);
 }
 public void TestChangeName()
 {
     UITest(() =>
     {
         logInPage.SignIn(Constants.USER_FOR_CHANGE_NAME, Constants.USER_PASSWORD);
         userInfo           = header.GoToUserAccountPage();
         var changeNamePage = userInfo.OpenChangeNamePage();
         var newName        = "NewName";
         changeNamePage.SetNewName(newName, Constants.USER_PASSWORD);
         var newUserNameFromHeader = header.GetHeaderUserName();
         var isEqual = String.Equals(newName, newUserNameFromHeader, StringComparison.InvariantCultureIgnoreCase);
         Assert.True(isEqual);
     });
 }
Exemple #3
0
        public void CheckResult()
        {
            SelectTheTicketPage selectTheTicketPage = new MainPage(driver).InputCity(SearchFormCreator.WithAllParameters())
                                                      .SetPassengers(SearchFormCreator.WithAllParameters())
                                                      .InputDateDefaultValues()
                                                      .SubmitValidValue();
            SelectSeatsPage selectSeatsPage = selectTheTicketPage.SelectClass()
                                              .Submit()
                                              .WaitModalWindow()
                                              .InputUserInfo(UserInfoCreator.WithDefaultParameters())
                                              .ContinueWithValidParameters();
            TicketLocationPage ticketLocationPage = selectSeatsPage.Submit();
            UserInfoPage       userInfoPage       = ticketLocationPage.Submit();
            PayPage            payPage            = userInfoPage.InputUserInfo(UserInfoCreator.WithDefaultParameters());

            Assert.AreEqual("10:46 | 27 Dec 2019", payPage.GetResult());
        }
        public void CheckContentUserInfoPageTest()
        {
            UITest(() =>
            {
                logInPage.SignIn(Constants.TEACHER_EMAIL, Constants.TEACHER_PASSWORD);
                userInfo     = header.GoToUserAccountPage();
                var isOpened = driver.GetCurrentUrl().EndsWith("/User");
                Assert.True(isOpened);

                var userInfoPage = ConstructPage <UserInfoPage>();
                Assert.True(userInfoPage.HasChangePasswordButton());
                Assert.True(userInfoPage.HasChangeNameButton());
                Assert.True(userInfoPage.HasChangeEmailButton());

                var userEmail = userInfoPage.GetEmail();
                var isEqual   = String.Equals(userEmail, Constants.TEACHER_EMAIL);
                Assert.True(isEqual);
            });
        }
        public void TestChangePassword()
        {
            UITest(() =>
            {
                logInPage.SignIn(Constants.USER_FOR_CHANGE_PASSWORD, Constants.USER_PASSWORD);
                userInfo = header.GoToUserAccountPage();
                var changePasswordPage = userInfo.OpenChangePasswordPage();
                var newPassword        = "******";
                var confirmNewPassword = newPassword;
                changePasswordPage.SetNewPassword(Constants.USER_PASSWORD, newPassword, confirmNewPassword);

                header.SignOut();

                header.GoToLogInPage().SignIn(Constants.USER_FOR_CHANGE_PASSWORD, newPassword);
                header.GoToUserAccountPage();

                var newUserName = header.GetHeaderUserName();
                var isEqual     = String.Equals(Constants.USER_FOR_CHANGE_PASSWORD, newUserName, StringComparison.InvariantCultureIgnoreCase);

                Assert.True(isEqual);
            });
        }
        public void TestChangeEmail()
        {
            UITest(() =>
            {
                logInPage.SignIn(Constants.USER_FOR_CHANGE_EMAIL, Constants.USER_PASSWORD);
                userInfo = header.GoToUserAccountPage();

                var changeEmailPage = userInfo.OpenChangeEmailPage();
                string newEmail     = "*****@*****.**";

                changeEmailPage.SetNewEmail(newEmail, Constants.USER_PASSWORD);
                var email   = header.GoToUserAccountPage().GetEmail();
                var isEqual = String.Equals(email, newEmail);
                Assert.True(isEqual);

                header.SignOut();
                header.GoToLogInPage().SignIn("*****@*****.**", Constants.USER_PASSWORD);
                var flag = header.GetCurrentUrl().Contains(Constants.LOGIN_URL_CONTAINS);
                Assert.False(flag, "Email was changed on UI but not in DB");
                header.GoToUserAccountPage();
                var isEqualAfterRepeatLogIn = string.Equals(userInfo.GetEmail(), newEmail, StringComparison.InvariantCulture);
                Assert.True(isEqualAfterRepeatLogIn);
            });
        }