예제 #1
0
        public void ClientSearchPage()
        {
            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());

                var clientSearchPage = new SearchClientPage(driver);
                clientSearchPage.ClickSearchClient();
                clientSearchPage.SearchBy(SearchClient.Email());
                clientSearchPage.ClickSearch();

                var tableText = clientSearchPage.GetTableText();
                Console.WriteLine(tableText);

                clientSearchPage.GetFirstName().ShouldBe(SearchClient.Iryna());
                Console.WriteLine($"First Name: {clientSearchPage.GetFirstName()}");

                clientSearchPage.GetLastName().ShouldBe(SearchClient.Shch());
                Console.WriteLine($"Last Name: {clientSearchPage.GetLastName()}");
            }
        }
예제 #2
0
        public static void LogInPage()
        {
            using (var driver = DriverUtils.CreateWebDriver())
            {
                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
                driver.Navigate().GoToUrl(Config.GetUrl());

                Thread.Sleep(1000);
                driver.Title.ShouldBe(LogInLogOut.LogInPage());
                Console.WriteLine($"{LogInLogOut.LogInPage()} opens.");

                var logInPage = new LogInPage(driver);

                logInPage.LogIn(LogInLogOut.Username(), LogInLogOut.Password());

                Thread.Sleep(1000);

                driver.Title.ShouldBe(LogInLogOut.ClientPage());
                Console.WriteLine($"{LogInLogOut.ClientPage()} opens.");

                logInPage.GetAdminURL().ShouldBe(LogInLogOut.AdminURL());
                Console.WriteLine($"'admin' link is {LogInLogOut.AdminURL()}");

                logInPage.ClickLogOut();

                Thread.Sleep(1000);

                driver.Title.ShouldBe(LogInLogOut.LogInPage());
                Console.WriteLine($"{LogInLogOut.LogInPage()} opens again.");
            }
        }
        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());
            }
        }
예제 #4
0
        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());
            }
        }
예제 #5
0
        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);
            }
        }