public void AddAfrikaansLanguageTest(User admin, string languageToAdd, string windowTitle, string windowMessage)
        {
            // --- Precondition --- //

            admin.SetEmail("*****@*****.**");
            admin.SetPassword("qwerty");

            // Login
            LoginPage     loginPage     = Application.Get(ApplicationSourcesRepository.ChromeByIP()).Login();
            UsersPage     usersPage     = loginPage.SuccessAdminLogin(admin);
            LanguagesPage languagesPage = usersPage.GotoLanguagesPage();

            Assert.IsNotNull(languagesPage.GetLanguagePageDescription());

            // --- Test Steps --- //

            // 1. Check if language is not presented on the list of existing languages
            Assert.IsFalse(languagesPage.IsLanguageInExistingList(languageToAdd));

            // 2. Add Language
            languagesPage.AddNewLanguage(languageToAdd);
            Assert.IsTrue(languagesPage.IsAddLanguageDialogWindowAppear(windowTitle, windowMessage));
            languagesPage.CloseAddLanguageDialogWindow();

            // 3. Check if added language is presented in the list as last language
            Assert.AreEqual(languageToAdd, languagesPage.GetLastLanguageRowFromExistingList().InnerText);

            // --- Return to a previous state --- //
            languagesPage.DeleteLastAddedLanguage();

            // --- Logout --- //
            loginPage = languagesPage.GotoLogOut();

            Console.WriteLine("Test Done!");
        }
예제 #2
0
        public void CancelButtonTest(User admin, string newName, string newPassword)
        {
            // --- Precondition --- //

            admin.SetEmail("*****@*****.**");
            admin.SetPassword("blackstar");

            // Login
            LoginPage loginPage = Application.Get(ApplicationSourcesRepository.ChromeByIP()).Login();
            UsersPage usersPage = loginPage.SuccessAdminLogin(admin);

            // --- Test Steps --- //

            // 1. Go to 'Edit Profile' page
            YourProfilePage yourProfilePage = usersPage.GotoEditProfile();

            Assert.IsNotNull(yourProfilePage.YourProfileLabel);
            admin.SetName(yourProfilePage.GetNameValue());  // Get Current Name

            // 2. Go to 'Edit Name' form
            yourProfilePage.ClickEditName();
            Assert.IsNotNull(yourProfilePage.GetNewNameField());

            // 3. Set new name
            yourProfilePage.SetNewName(newName);

            // 4. Press 'Cancel' and check if information wasn't saved.
            yourProfilePage.ClickCancel();
            Assert.AreNotEqual(admin.GetName(), newName);

            // 5. Go to 'Edit Password' form
            yourProfilePage.ClickEditPassword();
            Assert.IsNotNull(yourProfilePage.YourProfileLabel);

            // 6. Set new password
            yourProfilePage.SetCurrentPassword(admin.GetPassword());
            yourProfilePage.SetNewPassword(newPassword);
            yourProfilePage.SetConfirmPassword(newPassword);

            // 7. Press 'Cancel' and check if information wasn't saved.
            yourProfilePage.ClickCancelPassword();
            Assert.AreNotEqual(admin.GetPassword(), newPassword);

            // --- Logout --- //
            loginPage = yourProfilePage.GotoLogOut();

            Console.WriteLine("Test Done!");
        }
예제 #3
0
        public void UserSearchTest(string userName)
        {
            const string DEFAULT_SEARCHBOX_PLACEHOLDER_VALUE = "Search users";

            // Preconditions
            LoginPage loginPage = Application.Get(ApplicationSourcesRepository.ChromeByIP()).Login();
            UsersPage usersPage = loginPage.SuccessAdminLogin(UserRepository.Get().Admin());

            // Test Steps
            // Step 1: Check default value of search box Input users name into search field
            Assert.AreEqual(DEFAULT_SEARCHBOX_PLACEHOLDER_VALUE, usersPage.GetUserSearchBoxText());

            // Step 2: Enter user name into search box
            usersPage.SetValueToSearch(userName);

            // Step 3: Check if user name from test data are equal with user from table
            IList <User> actual   = usersPage.GetUsersDataForTable();
            IList <User> expected = actual.Where(item => item.GetName().Contains(userName)).ToList();

            Assert.AreEqual(expected, actual);

            // Return to previous state
            loginPage = usersPage.GotoLogOut();
        }
예제 #4
0
 public void Init()
 {
     Application.Get(ApplicationSourcesRepository.ChromeByIP());
 }