Пример #1
0
        public void DeleteClient()
        {
            {
                using (var driver = new ChromeDriver())
                {
                    driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
                    URLs.OpenUrl(driver);
                    var loginPage          = new LoginPage(driver);
                    var navigationMenuPage = new NavigationMenuPage(driver);
                    var addClientPage      = new AddClientPage(driver);
                    var clientSearchPage   = new ClientSearchPage(driver);

                    loginPage.Login(userName, password);
                    navigationMenuPage.AddClientButtonClick();
                    addClientPage.FillOutContactInformation(customer);

                    string id = addClientPage.GetClientId();

                    addClientPage.GetClientId().ShouldContain(id);

                    addClientPage.DeleteButtonClick();



                    addClientPage.ConfirmDeleteButtonClick();

                    clientSearchPage.SearchInputId(id);

                    clientSearchPage.SearchInputClick();
                    clientSearchPage.GetAllSeargPage().ShouldContain(clientSearchPage.GetNoRecords());
                }
            }
        }
Пример #2
0
        public void ClientTestPage()
        {
            // TODO: think how to avoid duplicating the same username and password in each test. Also what if another environment the credentials are different?
            var userName = "******";
            var password = "******";
            var customer = new Customer();

            using (var driver = new ChromeDriver())
            {
                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);

                URLs.OpenUrl(driver);
                var loginPage          = new LoginPage(driver);
                var navigationMenuPage = new NavigationMenuPage(driver);
                var addClientPage      = new AddClientPage(driver);

                loginPage.Login(userName, password);

                navigationMenuPage.AddClientButtonClick();
                addClientPage.AddClientHeader().ShouldContain("Add Client");
                addClientPage.FillOutContactInformation(customer);

                addClientPage.GetClientHeader().ShouldContain("Client");
            }
        }
Пример #3
0
        public void EditClient()
        {
            var loginInfo = new LoginData();
            var person    = new Person();

            using (var driver = DriverUtils.CreateWebDriver())
            {
                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
                driver.Navigate().GoToUrl(Config.GetUrl());

                //Login to the application
                var accessLoginPage = new LoginPage(driver);
                accessLoginPage.FillOutLoginData(loginInfo);
                accessLoginPage.ClickLoginButton();
                accessLoginPage.GetClientPageTitle().ShouldBe("Clients");

                //Add a new client (as you did it in test case SST-002)
                var logClientPage = new AddClientPage(driver);
                logClientPage.ClickAddClient();
                logClientPage.SelectTeacher("9");
                logClientPage.TypeClientCompany("FoxNews");
                logClientPage.FillOutContactInformation(person);
                logClientPage.ChooseState("Iowa");
                logClientPage.AddressInfo(person);
                logClientPage.ZipInfo("60755");
                //logClientPage.UploadDoc();
                //logClientPage.FinisheUpl("C:\\Users\\Iryna Lemeha\\Desktop\\Chapter.txt");
                //Thread.Sleep(3000);
                logClientPage.ClickSaveButton();
                Thread.Sleep(3000);

                var saveId   = new DeleteClientPage(driver);
                var clientID = saveId.SaveID();

                //Edit client's first name, last name and email. Save your changes


                var    editClient  = new EditClientPage(driver);
                string changeFname = "Oksana";
                string changeLname = "Morozko";
                string changeEm    = "*****@*****.**";
                editClient.GetClientID();
                editClient.VerifyEditTitle().ShouldBe("Edit Client");
                editClient.ChangeClient(changeFname, changeLname, changeEm);
                editClient.ClickSaveButton();
                Thread.Sleep(3000);
                //Verify your changes are displayed on the Clients page
                editClient.VerifyFNameChnages().ShouldBe(changeFname);
                editClient.VerifyLNameChnages().ShouldBe(changeLname);


                //TODO: you need to add verification here - you have to verify "your changes are displayed on the Clients page"
            }
        }
Пример #4
0
        public void DeleteClient()
        {
            var loginInfo = new LoginData();
            var person    = new Person();

            using (var driver = DriverUtils.CreateWebDriver())
            {
                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
                driver.Navigate().GoToUrl(Config.GetUrl());

                //Login to the application
                var accessLoginPage = new LoginPage(driver);
                accessLoginPage.FillOutLoginData(loginInfo);
                accessLoginPage.ClickLoginButton();
                accessLoginPage.GetClientPageTitle().ShouldBe("Clients");

                //Add a new client (as you did it in test case SST-002)
                var logClientPage = new AddClientPage(driver);

                logClientPage.ClickAddClient();
                logClientPage.SelectTeacher("9");
                logClientPage.TypeClientCompany("FoxNews");
                logClientPage.FillOutContactInformation(person);
                logClientPage.ChooseState("Iowa");
                logClientPage.AddressInfo(person);
                logClientPage.ZipInfo("60755");
                //logClientPage.UploadDoc();
                //logClientPage.FinisheUpl("C:\\Users\\Iryna Lemeha\\Desktop\\Chapter.txt");

                //TODO: no need for this
                //Thread.Sleep(3000);

                logClientPage.ClickSaveButton();

                //TODO: no need for this
                //Thread.Sleep(3000);

                var deleteClient = new DeleteClientPage(driver);
                var clientID     = deleteClient.SaveID();
                deleteClient.GetDeleteLink();
                deleteClient.VerifyPopupText().ShouldBe("Are you sure?");
                Thread.Sleep(3000);
                deleteClient.ClickConfirm();
                Thread.Sleep(5000);

                deleteClient.ClientInputBox(clientID);
                Thread.Sleep(5000);
                deleteClient.SearchButton();
            }
        }
Пример #5
0
        public void AddClientTest()
        {
            var loginInfo = new LoginData();
            var person    = new Person();

            using (var driver = DriverUtils.CreateWebDriver())
            {
                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(50);
                driver.Navigate().GoToUrl(Config.GetUrl());

                var accessLoginPage = new LoginPage(driver);
                accessLoginPage.FillOutLoginData(loginInfo);
                accessLoginPage.ClickLoginButton();
                accessLoginPage.GetClientPageTitle().ShouldBe("Clients");

                var logClientPage = new AddClientPage(driver);
                logClientPage.ClickAddClient();
                logClientPage.SelectTeacher("9");
                logClientPage.TypeClientCompany("FoxNews");
                logClientPage.FillOutContactInformation(person);
                logClientPage.ChooseState("Iowa");
                logClientPage.AddressInfo(person);
                logClientPage.ZipInfo("60755");

                logClientPage.ClickBrowseButton();
                Thread.Sleep(2000);
                logClientPage.GetFileUrlUploaded(@"C:\Users\Iryna Lemeha\Desktop\Chapter.txt");
                Thread.Sleep(10000);

                logClientPage.ClickSaveButton();
                Thread.Sleep(5000);

                logClientPage.GetFirstName().ShouldBe(person.FirstName);
                logClientPage.GetLastName().ShouldBe(person.LastName);

                Thread.Sleep(5000);
            }
        }