public void EditClientPage() { using (var driver = DriverUtils.CreateWebDriver()) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); driver.Navigate().GoToUrl(Config.GetUrl()); var logInPage = new LogInPage(driver); logInPage.LogIn(LogInLogOut.Username(), LogInLogOut.Password()); logInPage.ClickAddClient(); var addClientPage = new AddClientPage(driver); addClientPage.SelectTeacherID(AddClient.TeacherID()); var client = new AddClient(); addClientPage.FilloutContactInformation(client); addClientPage.ClickSave(); var deleteClient = new ClientPage(driver); var IdNumber = deleteClient.GetClientID(); deleteClient.ClickClientID(); Thread.Sleep(1000); driver.Title.ShouldBe(EditClient.EditClientPage() + " " + IdNumber); var editClientPage = new EditClientPage(driver); editClientPage.ChangeFirstName(EditClient.FirstName()); editClientPage.ChangeLastName(EditClient.LastName()); editClientPage.ChangeEMail(EditClient.Email()); editClientPage.ClickSave(); var tableText = editClientPage.GetTableText(); Console.WriteLine(tableText); tableText.ShouldContain(EditClient.FirstName()); tableText.ShouldContain(EditClient.LastName()); tableText.ShouldContain(EditClient.Email()); } }
public void ClientPage() { using (var driver = DriverUtils.CreateWebDriver()) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); driver.Navigate().GoToUrl(Config.GetUrl()); var logInPage = new LogInPage(driver); logInPage.LogIn(LogInLogOut.Username(), LogInLogOut.Password()); logInPage.ClickAddClient(); var addClientPage = new AddClientPage(driver); addClientPage.SelectTeacherID(AddClient.TeacherID()); var client = new AddClient(); addClientPage.FilloutContactInformation(client); addClientPage.ClickSave(); Thread.Sleep(1000); var deleteClient = new ClientPage(driver); var IdNumber = deleteClient.GetClientID(); deleteClient.DeleteButton(); Thread.Sleep(1000); deleteClient.ConfirmButtonClick(); Thread.Sleep(1000); var clientSearchPage = new SearchClientPage(driver); clientSearchPage.SearchBy(IdNumber); clientSearchPage.ClickSearch(); Thread.Sleep(1000); deleteClient.DeleteConfirm().ShouldBe(DeleteClient.NoRecord()); } }
public void AddClientPage() { using (var driver = DriverUtils.CreateWebDriver()) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); driver.Navigate().GoToUrl(Config.GetUrl()); var logInPage = new LogInPage(driver); logInPage.LogIn(LogInLogOut.Username(), LogInLogOut.Password()); logInPage.ClickAddClient(); var addClientPage = new AddClientPage(driver); driver.Title.ShouldBe(AddClient.AddClientPage()); Console.WriteLine($"{AddClient.AddClientPage()} opens."); addClientPage.SelectTeacherID(AddClient.TeacherID()); var client = new AddClient(); addClientPage.FilloutContactInformation(client); addClientPage.SelectState(AddClient.State); addClientPage.FillZipCode(AddClient.zipCode); addClientPage.ClickSave(); Thread.Sleep(1000); var tableText = addClientPage.GetTableText(); Console.WriteLine(tableText); tableText.ShouldContain(client.FirstName); tableText.ShouldContain(client.LastName); tableText.ShouldContain(client.Email); } }