Exemplo n.º 1
0
        public void AddNewProductTest()
        {
            HomePage.ProductsPage();
            ProductsPage = new ProductsPage(driver);
            ProductsPage.OpenNewProduct();
            NewProductPage newProductPage1 = new NewProductPage(driver);

            newProductPage1.CreateNewProduct("Fish", "Seafood", "Tokyo Traders", "7", "1", "10", "3", "1");

            Assert.AreEqual("All Products", ProductsPage.CurrentHead());
        }
Exemplo n.º 2
0
        public static string AddNewProduct(Product product, IWebDriver driver)
        {
            HomePage HomePage = new HomePage(driver);

            HomePage.ProductsPage();
            ProductsPage ProductsPage = new ProductsPage(driver);

            ProductsPage.OpenNewProduct();
            NewProductPage NewProductPage = new NewProductPage(driver);

            NewProductPage.CreateNewProduct(product);
            return(ProductsPage.CurrentHead());
        }
Exemplo n.º 3
0
 public void Test2LoginAddNewProduct()
 {
     mainPage = new MainPage(driver);
     mainPage.LoginNW(login, login);
     Assert.AreEqual("Home page", driver.FindElement(By.XPath("//h2")).Text);
     mainPage.ClickOnProducts();
     Thread.Sleep(2000);
     productsPage = new ProductsPage(driver);
     productsPage.ClickOnCreateNewBut();
     newProductPage = new NewProductPage(driver);
     newProductPage.CreateNewProduct(Ekzo, Ekzo, Ekzo, Ekzo, Ekzo, Ekzo);
     Assert.AreEqual("All Products", productsPage.TitleAllProducts());
     productsPage.DeleteProduct();
 }
Exemplo n.º 4
0
        public static ProductsPage AddNewProduct(Product product, IWebDriver driver)
        {
            HomePage HomePage = new HomePage(driver);

            HomePage.ProductsPage();
            ProductsPage ProductsPage = new ProductsPage(driver);

            ProductsPage.OpenNewProduct();
            NewProductPage NewProductPage = new NewProductPage(driver);

            NewProductPage.CreateNewProduct(product);
            ProductsPage ProductsPage1 = new ProductsPage(driver);

            return(ProductsPage1);
        }
Exemplo n.º 5
0
 public void Test3OpenNewProduct()
 {
     mainPage = new MainPage(driver);
     mainPage.LoginNW(login, login);
     mainPage.ClickOnProducts();
     productsPage = new ProductsPage(driver);
     productsPage.ClickOnCreateNewBut();
     newProductPage = new NewProductPage(driver);
     newProductPage.CreateNewProduct(Ekzo, Ekzo, Ekzo, Ekzo, Ekzo, Ekzo);
     Thread.Sleep(2000);
     Assert.AreEqual("Ekzo", driver.FindElement(By.XPath("//a[text()='Ekzo']")).Text);
     Assert.AreEqual("Confections", driver.FindElement(By.XPath("//a[text()='Ekzo']/parent::td/following-sibling::td[text()='Confections']")).Text);
     Assert.AreEqual("Pavlova, Ltd.", driver.FindElement(By.XPath("//a[text()='Ekzo']/parent::td/following-sibling::td[text()='Pavlova, Ltd.']")).Text);
     Assert.AreEqual("68,0000", driver.FindElement(By.XPath("//a[text()='Ekzo']/parent::td/following-sibling::td[text()='68,0000']")).Text);
     Assert.AreEqual("50 - 1kg box", driver.FindElement(By.XPath("//a[text()='Ekzo']/parent::td/following-sibling::td[text()='50 - 1kg box']")).Text);
     Assert.AreEqual("40", driver.FindElement(By.XPath("//a[text()='Ekzo']/parent::td/following-sibling::td[text()='40']")).Text);
     Assert.AreEqual("30", driver.FindElement(By.XPath("//a[text()='Ekzo']/parent::td/following-sibling::td[text()='30']")).Text);
     Assert.AreEqual("0", driver.FindElement(By.XPath("//a[text()='Ekzo']/parent::td/following-sibling::td[text()='0']")).Text);
     Assert.AreEqual("True", driver.FindElement(By.XPath("//a[text()='Ekzo']/parent::td/following-sibling::td[text()='True']")).Text);
     productsPage.DeleteProduct();
 }