Beispiel #1
0
        public void MyData_ChangePassword_PasswordChanged(string email, string password, string newPassword)
        {
            LoginPageObject   loginPage  = new LoginPageObject();
            MySchedPageObject mSchedPage = loginPage.Login(email, password);
            MenuLayoutObject  menu       = new MenuLayoutObject();
            MyDataPageObject  mdataPage  = menu.EnterDataPage();

            mdataPage.changePassword(newPassword);

            loginPage  = menu.LogOut();
            mSchedPage = loginPage.Login(email, newPassword);
            mdataPage  = menu.EnterDataPage();

            mdataPage.changePassword(password);
        }
Beispiel #2
0
        public void MyData_ChangeToShortPassword_PopUpWrongPasswordAndCannotLoginWithNewPassword(string email, string password, string newPassword)
        {
            LoginPageObject   loginPage  = new LoginPageObject();
            MySchedPageObject mSchedPage = loginPage.Login(email, password);
            MenuLayoutObject  menu       = new MenuLayoutObject();
            MyDataPageObject  mdataPage  = menu.EnterDataPage();

            mdataPage.changePassword(newPassword);
            SeleniumUtilityMethods.WaitForJavascript();
            string txt = mdataPage.getPopUpText();

            loginPage = menu.LogOut();

            StringAssert.IsMatch("Hasło musi zawierać conajmniej 5 znaków.", txt);
            Assert.That(() => loginPage.Login(email, newPassword), Throws.Exception);
        }
Beispiel #3
0
        public void MyData_ByUser_UsersData(string email, string password, string name, string surname, string id, Boolean admin, string hours, string days)
        {
            LoginPageObject   loginPage  = new LoginPageObject();
            MySchedPageObject mSchedPage = loginPage.Login(email, password);
            MenuLayoutObject  menu       = new MenuLayoutObject();
            MyDataPageObject  mdataPage  = menu.EnterDataPage();

            string pname      = mdataPage.getName();
            string psurname   = mdataPage.getSurname();
            string pid        = mdataPage.getId();
            string pemail     = mdataPage.getEmail();
            string phours     = mdataPage.getHours();
            int    pdaysCount = mdataPage.getDaysCount();

            int daysCount = days.Count(c => c == '1');

            Assert.That(pdaysCount == daysCount);
            StringAssert.IsMatch(pname, name);
            StringAssert.IsMatch(psurname, surname);
            StringAssert.IsMatch(pid, id);
            StringAssert.IsMatch(pemail, email);
            StringAssert.IsMatch(phours, hours);
            if (admin)
            {
                string padmin = mdataPage.getAdmin();
                StringAssert.IsMatch(padmin, "Posiada Uprawnienia Administratora");
            }
            else
            {
                Assert.That(() => mdataPage.getAdmin(), Throws.Exception);
            }

            for (int i = 0; i < 7; i++)
            {
                if (days[i] == '1')
                {
                    StringAssert.IsMatch("(niedziela)|(poniedziałek)|(wtorek)|(środa)|(czwartek)|(piątek)|(sobota)", mdataPage.getDayName(i));
                    StringAssert.IsMatch("[0-2][0-9]:[0-6][0-9] - [0-2][0-9]:[0-6][0-9]", mdataPage.getWorkHours(i));
                }
            }
        }