Esempio n. 1
0
        public MainPage Add(String product, String unitptice, String quantityperunit,
                            String unitsinsrock, String unitsonorder, String reorderlevel)
        {
            loginField.SendKeys("user");
            passwordField.SendKeys("user");
            passwordField.Submit();

            All_Products.Click();
            Create_new.Click();
            Product_Name.SendKeys(product);
            Product_Name.Click();

            Category_Id.Click();
            Category_Id.FindElement(By.XPath("//option[. = 'Beverages']")).Click();
            Supplier_Id.Click();
            Supplier_Id.FindElement(By.XPath("//option[. = 'Tokyo Traders']")).Click();

            Unit_Price.SendKeys(unitptice);
            Unit_Price.Click();
            QuantityPer_Unit.SendKeys(quantityperunit);
            QuantityPer_Unit.Click();
            UnitsIn_Stock.SendKeys(unitsinsrock);
            Unit_Price.Click();
            UnitsOn_Order.SendKeys(unitsonorder);
            UnitsOn_Order.Click();
            Reorder_Level.SendKeys(reorderlevel);
            Reorder_Level.Click();
            Button_OK.Click();

            return(new MainPage(driver));
        }
Esempio n. 2
0
        public MainPage Exist()
        {
            loginField.SendKeys("user");
            passwordField.SendKeys("user");
            passwordField.Submit();

            All_Products.Click();
            Element.Click();

            Assert.AreEqual(Product_Name.GetAttribute("value"), "test");
            Assert.AreEqual(Category_Id.FindElement(By.CssSelector("#CategoryId > option:nth-child(2)")).GetAttribute("text"), "Beverages");
            Assert.AreEqual(Supplier_Id.FindElement(By.CssSelector("#SupplierId > option:nth-child(5)")).GetAttribute("text"), "Tokyo Traders");
            Assert.AreEqual(Unit_Price.GetAttribute("value"), "80,0000");
            Assert.AreEqual(QuantityPer_Unit.GetAttribute("value"), "30 in");
            Assert.AreEqual(UnitsIn_Stock.GetAttribute("value"), "40");
            Assert.AreEqual(UnitsOn_Order.GetAttribute("value"), "40");
            Assert.AreEqual(Reorder_Level.GetAttribute("value"), "5");

            Button_OK.Click();

            return(new MainPage(driver));
        }