Пример #1
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"
            }
        }
Пример #2
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();
            }
        }
Пример #3
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);
            }
        }