Ejemplo n.º 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());
                }
            }
        }
Ejemplo n.º 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");
            }
        }