public void TestChangeName(User admin, string[] names) { LoginPage loginPage = Application.Get().Login(); UsersPage usersPage = loginPage.SuccessAdminLogin(admin); // Test steps // Go to EditProfile page and check if this page is really opened YourProfilePage yourProfilePage = usersPage.GotoEditProfile(); Assert.IsNotNull(yourProfilePage.YourProfileLabel); yourProfilePage.ClickEditName(); Assert.IsNotNull(yourProfilePage.GetNewNameField()); // Set name with digits and try to change it. Check if appropriate message appears yourProfilePage.SetNewName(names[0]); yourProfilePage.ChangeName(admin); Assert.AreEqual(YourProfilePage.ErrorMessageForNameWithDigits, yourProfilePage.GetMessageText()); // Set name with specific symbols and try to change it. Check if appropriate message appears yourProfilePage.SetNewName(names[1]); yourProfilePage.ChangeName(admin); Assert.AreEqual(YourProfilePage.ErrorMessageForNameWithSymbols, yourProfilePage.GetMessageText()); // Set correct name try to change it. Check if name is really changed yourProfilePage.SetNewName(names[2]); yourProfilePage.ChangeName(admin); Assert.AreEqual(names[2], admin.GetName()); // Return to previous state loginPage = yourProfilePage.GotoLogOut(); }
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!"); }
public IUsersPage GetUsersPage(int skip, int take) { var usersCount = _userManager.Users.Count(); var users = _userManager.Users.Skip(skip).Take(take).ToList(); var resut = new UsersPage(usersCount, users); return(resut); }
private void DeleteUser() { UserPage.DeleteUser() .WithEmail("*****@*****.**") .Delete(); Assert.IsFalse(UsersPage.IsUserPresent("*****@*****.**")); }
public override void TestInitialize() { this.usersPage = new UsersPage(); LoginSteps.LoginAdmin(); NavigateTo.Page(this.usersPage); this.Browser.WaitUntilReady(); }
public void Can_View_Admin_User() { LoginPage.LoginAs("*****@*****.**").WithPassword("abc123").Login(); Assert.IsTrue(UsersPage.IsPresentAdmin); UsersPage.ViewAdmin(); Assert.IsTrue(UserPage.IsAdmin); }
public async Task <UsersPage <User> > GetUsersList(int pageNumber, int pageSize) { IEnumerable <User> users = await _accountRepository.GetListAsync(pageNumber, pageSize); int countOfUser = await _accountRepository.GetUsersCount(); UsersPage <User> pagedList = new UsersPage <User>(users, pageNumber, pageSize, countOfUser); return(pagedList); }
public App(IUserRepository usersRepository) { InitializeComponent(); var usersPage = new UsersPage() { BindingContext = new UsersViewModel(usersRepository) }; MainPage = new NavigationPage(usersPage); }
public void SearchUserTest() { homepage = Host.Instance.NavigateToInitialPage <HomePage>(); LoginToSourcebox(); UsersPage usersPage = homepage.GotoUsersPage(); usersPage.WaitForPageToLoad(); usersPage.FindText("fakeuser1"); homepage.GotoLogoutPage(); }
public MainWindow() { InitializeComponent(); Title = "Project Management"; CommandQueryDispatcher = new CommandQueryDispatcher(); ProjectsPage = new ProjectsPage(this); MainFrame.Content = ProjectsPage; AddProjectPage = new AddProjectPage(this); UsersPage = new UsersPage(this); CreateUserPage = new CreateUserPage(this); }
private void EditUser() { UserPage.EditUser() .WithEmail("*****@*****.**") .WithFirstName("Maria1") .WithLastName("Rossi1") .WithOffice("Tokio") .WithGender(UserGender.Female) .WithBirthDay(new DateTime(2000, 2, 4)) .WithNotes("Update Maria Rossi") .Edit(); Assert.IsTrue(UsersPage.IsUserPresent("*****@*****.**", "Maria1", "Rossi1", "Tokio")); }
private void AddNewUser() { UserPage.AddNewUser() .WithFirstName("Maria") .WithLastName("Rossi") .WithEmail("*****@*****.**") .WithOffice("London") .WithGender(UserGender.Female) .WithBirthDay(new DateTime(2000, 2, 3)) .WithNotes("Notes Maria Rossi") .Create(); Assert.IsTrue(UsersPage.IsUserPresent("*****@*****.**")); }
/* * PARTIAL CLASS - ZÁLOŽKA MANAGEMENT */ private void InitializeManagement() { UsersPage usersPage = new UsersPage(); frManagementUsers.Navigate(usersPage); SummaryMangPage summaryPage = new SummaryMangPage(); frManagementSummary.Navigate(summaryPage); CompanyInfoPage coInfoPage = new CompanyInfoPage(); frManagementCoInfo.Navigate(coInfoPage); }
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!"); }
public void TestSignin(User admin) { // Precondition // Test Steps LoginPage loginPage = Application.Get().Login(); UsersPage usersPage = loginPage.SuccessAdminLogin(admin); //UsersPage usersPage = Application.Get().Login().SuccessAdminLogin(admin); // // Check Assert.AreEqual(admin.GetName(), usersPage.GetUsernameText()); // // Return to previous state loginPage = usersPage.GotoLogOut(); // // Check Assert.AreEqual("SoftServe Language School", loginPage.GetLoginDescriptionText()); }
public void TestPagination(User admin, IList <User> usersFromDb, int countOfUsers) { // Preconditions LoginPage loginPage = Application.Get().Login(); UsersPage usersPage = loginPage.SuccessAdminLogin(admin); usersPage.ClickAdminTab(); // Check if First and StepBack are disabled Assert.IsFalse(usersPage.IsFirstItemEnabled()); Assert.IsFalse(usersPage.IsStepBackItemEnabled()); usersPage.ClickStepForward(); // Check if First, StepBack, StepForward, Last are enabled Assert.IsTrue(usersPage.AreAllPaginationElementsEnabled()); // Check if second page of table is displayed CheckUsersAtTable(usersFromDb, usersPage); usersPage.ClickLast(); // Check if Last and StepForward are disabled Assert.IsFalse(usersPage.IsStepForwardItemEnabled()); Assert.IsFalse(usersPage.IsLastItemEnabled()); // Check if last page of table is displayed CheckUsersAtTable(usersFromDb, usersPage); //Check count of users Assert.AreEqual(countOfUsers, CalcCountOfAllUsers(usersPage)); usersPage.ClickStepBack(); //Check if First, StepBack, StepForward, Last are enabled Assert.IsTrue(usersPage.AreAllPaginationElementsEnabled()); //Check if last minus one page of table is displayed CheckUsersAtTable(usersFromDb, usersPage); // Return to previous state usersPage.GotoLogOut(); }
void OnClickToInviteButton(object sender, System.EventArgs e) { UsersPage usersPage = new UsersPage(); Detail = usersPage; usersPage.ListView.ItemTapped += async(listView, elements) => { UserListViewModel selectedViewModel = (UserListViewModel)elements.Item; bool answer = await DisplayAlert("", $"Invite {selectedViewModel.Name} to the conversation?", "Yes", "No"); if (answer) { string route = $"/participants/user/{selectedViewModel.UserId}/conversation/{this.conversationId}"; HttpRequest.MakePostRequest(ServerVariables.URL + route, "", null); } ((ListView)listView).SelectedItem = null; }; }
public void TestUsersTable(User user, string[] columnNames) { // Test steps LoginPage loginPage = Application.Get().Login(); UsersPage usersPage = loginPage.SuccessAdminLogin(user); // Check whether column names are presented in user table foreach (var columnName in columnNames) { Assert.IsTrue(usersPage.GetHeadColumnsText().Contains(columnName)); } // Check whether users in appropriate columns in user table are checked Assert.IsTrue(usersPage.IsUserCheckedAsAdmin()); Assert.IsTrue(usersPage.IsUserCheckedAsTeacher()); Assert.IsTrue(usersPage.IsUserCheckedAsStudent()); // Return to previous state usersPage.GotoLogOut(); }
// Aktualizace stránek při přepnutí private void tabControlManagement_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (tabManagementUsers.IsSelected && e.Source is TabControl) { UsersPage usersPage = new UsersPage(); frManagementUsers.Navigate(usersPage); } if (tabManagementSummary.IsSelected && e.Source is TabControl) { SummaryMangPage summaryPage = new SummaryMangPage(); frManagementSummary.Navigate(summaryPage); } if (tabManagementCoInfo.IsSelected && e.Source is TabControl) { CompanyInfoPage coInfoPage = new CompanyInfoPage(); frManagementCoInfo.Navigate(coInfoPage); } }
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(); }
public override void TestInitialize() { this.usersPage = new UsersPage(); this.registrationPage = new RegistrationPage(); }
public void TestSignin(User admin) { // Precondition // Test Steps LoginPage loginPage = Pages.Application.Get().Login(); UsersPage usersPage = loginPage.SuccessAdminLogin(admin); //UsersPage usersPage = Application.Get().Login().SuccessAdminLogin(admin); // // Check Assert.AreEqual("LV-204 ISTQB", usersPage.GetUsernameText()); // // Return to previous state loginPage = usersPage.GotoLogOut(); // // Check Assert.AreEqual("SoftServe Language School", loginPage.GetLoginDescriptionText()); //-------------------------------------------------------------- //[Test] Manager manager; Settings mySettings = new Settings(); // // Precondition mySettings.Web.DefaultBrowser = BrowserType.Chrome; manager = new Manager(mySettings); manager.Start(); manager.LaunchNewBrowser(); manager.ActiveBrowser.NavigateTo("https://wow.training.local/Index#/Home"); // IList <HtmlControl> description = manager.ActiveBrowser.Find.AllByXPath <HtmlControl>("//div[@class='text-primary']/h2/small"); Console.WriteLine("description = " + description.Count); if ((description.Count == 0) && (manager.ActiveBrowser.BrowserType == BrowserType.Chrome)) { for (int i = 0; i < 5; i++) { manager.ActiveBrowser.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Tab); } manager.ActiveBrowser.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Space); manager.ActiveBrowser.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Tab); manager.ActiveBrowser.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Tab); manager.ActiveBrowser.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter); } Thread.Sleep(1000); HtmlButton loginButton = manager.ActiveBrowser.Find.ByAttributes <HtmlButton>("class=btn btn-success"); loginButton.Click(); HtmlInputEmail loginInput = manager.ActiveBrowser.Find.ByAttributes <HtmlInputEmail>("ng-model=email"); loginInput.Text = "*****@*****.**"; Thread.Sleep(1000); HtmlInputPassword passwordInput = manager.ActiveBrowser.Find.ByAttributes <HtmlInputPassword>("ng-model=password"); passwordInput.Text = "q2w3e4r5"; Thread.Sleep(1000); HtmlInputSubmit submitInput = manager.ActiveBrowser.Find.ByName <HtmlInputSubmit>("loginButton"); submitInput.Click(); Thread.Sleep(2000); // Check HtmlSpan userAccount = manager.ActiveBrowser.Find.ByAttributes <HtmlSpan>("ng-bind=userName"); Assert.AreEqual("Mariana Medynska", userAccount.TextContent); //Steps--------------------------------------------------------------------------------------------- HtmlSpan managerButton = manager.ActiveBrowser.Find.ByContent <HtmlSpan>("p:Manager"); managerButton.Click(); //# cursorStyle > span:nth-child(2) // //*[@id="cursorStyle"]/span[1] HtmlSpan groupsButton = manager.ActiveBrowser.Find.ByContent <HtmlSpan>("l:Groups"); managerButton.Click(); // //*[@id="teaching-tools"]/li/ul/li[4]/a/span //#teaching-tools > li > ul > li:nth-child(4) > a > span var myGroupsText = manager.ActiveBrowser.Find.ByXPath("//h2['My Groups']"); Assert.AreEqual("My Groups", myGroupsText.TextContent); // #myJum > div > div.container.ng-scope > div:nth-child(1) > div > h2 // //*[@id="myJum"]/div/div[3]/div[1]/div/h2 // //h2["My Groups"] HtmlButton editPencilButton = manager.ActiveBrowser.Find.ByAttributes <HtmlButton>("//*[@id='myJum']/div/div[3]/div[4]/table/tbody/tr[2]/td[3]/a"); editPencilButton.Click(); //#myJum > div > div.container.ng-scope > div.panel.panel-default > table > tbody > tr:nth-child(2) > td:nth-child(3) > a // //*[@id="myJum"]/div/div[3]/div[4]/table/tbody/tr[2]/td[3]/a //Check if Test_M //var testMGroup = manager.ActiveBrowser.Find.ByAttributes<HtmlDiv>("class=col-md-4 text-left blod-text ng-binding"); //testMGroup.Get //class = col-md-4 text-left blod-text ng-binding //# myJum > div > div.container.ng-scope > div:nth-child(2) > h3.col-md-4.text-left.blod-text.ng-binding // //*[@id="myJum"]/div/div[3]/div[2]/h3[1] HtmlButton selectDropdown = manager.ActiveBrowser.Find.ByAttributes <HtmlButton>("class=dropdown-toggle ng-binding btn btn-default"); selectDropdown.Click(); HtmlControl selectDropDownDialog = manager.ActiveBrowser.Find.ByAttributes <HtmlControl>("class=dropdown-menu dropdown-menu-form"); //selectDropDownDialog. - check names in the lists at least five HtmlAnchor checkAll = manager.ActiveBrowser.Find.ByContent <HtmlAnchor>("p:Check All"); checkAll.Click(); // how to check if names are checked/unchecked HtmlAnchor UnCheckAll = manager.ActiveBrowser.Find.ByAttributes <HtmlAnchor>("class=glyphicon glyphicon-remove"); UnCheckAll.Click(); HtmlInputSearch studentSearchByName = manager.ActiveBrowser.Find.ByAttributes <HtmlInputSearch>("class=form-control ng-pristine ng-valid ng-touched"); HtmlButton submitChangesButton = manager.ActiveBrowser.Find.ByAttributes <HtmlButton>("class=btn btn-default center- block"); manager.Dispose(); Console.WriteLine("done"); }
private void ShowAllCompanyUsers() { UsersPage usersPage = new UsersPage(ReturnCompany()); usersPage.ShowDialog(); }
public void Setup() { driver = new ChromeDriver(); driver.Manage().Window.Maximize(); users = new UsersPage(driver); }
private int CalcCountOfAllUsers(UsersPage usersPage) { return(usersPage.GetCountOfUsersAtPage() + (UsersPage.MaxUsersPerPage * (int.Parse(usersPage.GetTextFromActiveItem()) - 1))); }
public UsersPageViewModel(UsersPage model) { this.Model = model; }
void WhenINavigateToUsersManagerPage() { _usersPage = _homePage.TopMenu.GoToUsersPage(); }