コード例 #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 DeletaCliente()
        {
            //arrange
            var builder = new DbContextOptionsBuilder <WebCadastradorContext>()
                          .UseLazyLoadingProxies()
                          .UseSqlServer("Server=(localdb)\\mssqllocaldb;Database=WebCadastradorContext-dc88d854-cb2b-41f0-851e-fa57b037f7e8;Trusted_Connection=True;MultipleActiveResultSets=true");

            context = new WebCadastradorContext(builder.Options);
            context.Clientes.Clear();

            var c = Generator.ValidCliente();

            context.Clientes.Add(c);
            context.SaveChanges();

            var id   = context.Clientes.First().Id;
            var page = new DeleteClientPage();

            //act
            page.NavigateToDeletePage(id);
            page.DeletaCliente();
        }