示例#1
0
        public void Login()
        {
            Login_page login = new Login_page(driver);
            Home_page  home  = login.ExecuteLogin();

            Assert.AreEqual("Logout", home.logout.Text);
        }
 public BuscaCateg_model(IWebDriver _driver)
 {
     driver  = _driver;
     home    = new Home_page(driver);
     busca   = new BuscaCateg_page(driver);
     product = new Product_page(driver);
 }
示例#3
0
        public static Home_page LoginService(IWebDriver driver)
        {
            Login_page login = new Login_page(driver);
            Home_page  home  = login.ExecuteLogin();

            return(new Home_page(driver));
        }
示例#4
0
文件: Program.cs 项目: Horfik/Flickr
        public void Test_3_RootItem()
        {
            iTestNumCurrent = "3-RootItem";
            Home_page home = new Home_page();

            Assert.AreEqual(4, home.Item());
        }
示例#5
0
        public void Logout()
        {
            Login_page login  = new Login_page(driver);
            Home_page  home   = login.ExecuteLogin();
            Login_page logout = home.ExecuteLogout();

            Assert.IsFalse(driver.PageSource.Contains("Logout"));
        }
示例#6
0
        public void Logout()
        {
            Home_page home = UserService.LoginService(driver);

            Login_page logout = home.ExecuteLogout();

            Assert.IsFalse(driver.PageSource.Contains("Logout"));
        }
示例#7
0
        public void DeleteProduct()
        {
            Login_page        login         = new Login_page(driver);
            Home_page         home          = login.ExecuteLogin();
            All_products_page allproducts   = home.ExecuteAllProducts();
            All_products_page allporoducts1 = allproducts.ExecuteDelete();

            Assert.IsFalse(driver.PageSource.Contains("Chocolate cupcake with cherry"));
        }
示例#8
0
        private void home_page(object sender, RoutedEventArgs e)
        {
            Home_page page1 = new Home_page();

            Page_Change.Content = new Frame()
            {
                Content = page1
            };
        }
        public static All_products_page CreateProduct(IWebDriver driver)
        {
            Home_page         home          = UserService.LoginService(driver);
            All_products_page allproducts1  = home.ExecuteAllProducts();
            ProductPage       createproduct = allproducts1.ExecuteCreate();
            All_products_page allproducts2  = createproduct.ExecuteCreateProduct();

            return(new All_products_page(driver));
        }
示例#10
0
文件: Program.cs 项目: Horfik/Flickr
        public void Test_4_Linc()
        {
            iTestNumCurrent = "4-Linc";
            Check     check = new Check();
            Home_page home  = new Home_page();

            System.Threading.Thread.Sleep(2000);
            Assert.True(home.ElementsConteinLinc());
        }
示例#11
0
        public MainView()
        {
            InitializeComponent();
            Home_page page1 = new Home_page();

            Page_Change.Content = new Frame()
            {
                Content = page1
            };
            this.MaxHeight = SystemParameters.PrimaryScreenHeight;
        }
示例#12
0
        public void DeleteProduct()
        {
            Home_page home = UserService.LoginService(driver);

            Product product = new Product();

            All_products_page allproducts   = home.ExecuteAllProducts();
            All_products_page allporoducts1 = allproducts.ExecuteDelete();

            Assert.IsFalse(driver.PageSource.Contains("$product.ProductName"));
        }
示例#13
0
        public void AddProduct()
        {
            Login_page        login           = new Login_page(driver);
            Home_page         home            = login.ExecuteLogin();
            All_products_page allproducts     = home.ExecuteAllProducts();
            ProductPage       createproduct   = allproducts.ExecuteCreate();
            All_products_page allproducts1    = createproduct.ExecuteCreateProduct();
            IWebElement       buttonCreateNew = driver.FindElement(By.XPath("//a[contains(text(),'Create new')]"));

            Assert.AreEqual("Create new", buttonCreateNew.Text);
        }
示例#14
0
        public void ViewProduct()
        {
            Login_page        login       = new Login_page(driver);
            Home_page         home        = login.ExecuteLogin();
            All_products_page allproducts = home.ExecuteAllProducts();
            ProductPage       page        = allproducts.ViewSelected();

            Assert.AreEqual("Chocolate cupcake with cherry", driver.FindElement(By.XPath("//input[@id='ProductName']")).GetAttribute("value"));
            Assert.IsTrue(driver.FindElement(By.XPath("//select[@id='CategoryId']")).Text.Contains("Confections"));
            Assert.IsTrue(driver.FindElement(By.XPath("//select[@id='SupplierId']")).Text.Contains("Pavlova, Ltd."));
            Assert.AreEqual("15,0000", driver.FindElement(By.XPath("//input[@id='UnitPrice']")).GetAttribute("value"));
            Assert.AreEqual("10 - 150 g boxes", driver.FindElement(By.XPath("//input[@id='QuantityPerUnit']")).GetAttribute("value"));
            Assert.AreEqual("20", driver.FindElement(By.XPath("//input[@id='UnitsInStock']")).GetAttribute("value"));
            Assert.AreEqual("0", driver.FindElement(By.XPath("//input[@id='UnitsOnOrder']")).GetAttribute("value"));
            Assert.AreEqual("5", driver.FindElement(By.XPath("//input[@id='ReorderLevel']")).GetAttribute("value"));
        }
示例#15
0
        public void ViewProduct()
        {
            Home_page home = UserService.LoginService(driver);

            All_products_page allproducts = home.ExecuteAllProducts();
            ProductPage       page        = allproducts.ViewSelected();

            Product product = new Product();

            Assert.AreEqual(product.ProductName, driver.FindElement(By.XPath("//input[@id='ProductName']")).GetAttribute("value"));
            Assert.AreEqual(product.Category, driver.FindElement(By.XPath("//select[@id='CategoryId']//option[@selected='selected']")).Text);
            Assert.AreEqual(product.Supplier, driver.FindElement(By.XPath("//select[@id='SupplierId']//option[@selected='selected']")).Text);
            Assert.AreEqual(product.UnitPrice + ",0000", driver.FindElement(By.XPath("//input[@id='UnitPrice']")).GetAttribute("value"));
            Assert.AreEqual(product.QuanityPerUnit, driver.FindElement(By.XPath("//input[@id='QuantityPerUnit']")).GetAttribute("value"));
            Assert.AreEqual(product.UnitsInStock, driver.FindElement(By.XPath("//input[@id='UnitsInStock']")).GetAttribute("value"));
            Assert.AreEqual(product.UnitsOnOrder, driver.FindElement(By.XPath("//input[@id='UnitsOnOrder']")).GetAttribute("value"));
            Assert.AreEqual(product.ReorderLevel, driver.FindElement(By.XPath("//input[@id='ReorderLevel']")).GetAttribute("value"));
        }
示例#16
0
        public void Login()
        {
            Home_page home = UserService.LoginService(driver);

            Assert.AreEqual("Logout", home.logout.Text);
        }
 public Home_model(IWebDriver _driver)
 {
     driver  = _driver;
     home    = new Home_page(driver);
     product = new Product_page(driver);
 }