コード例 #1
0
        public IMainCategoryPage OpenCategoryMenuAndSelectCategory(Type categoryPageName)
        {
            _categoryPage = (IMainCategoryPage)categoryPageName;

            foreach (IWebElement category in _categoryLinks)
            {
                if (category.Text == _categoryPage.mainCategoryName)
                {
                    category.Click();
                }
                else
                {
                    continue;
                }
            }
            return((IMainCategoryPage)DynamicPageFactory.Create(categoryPageName));
        }
コード例 #2
0
        public void Search_And_Select_Item_To_Checkout(Type mainCategory, Type brandCategory, Type productType, Type product)
        {
            INavigationValidator topNavigationValidator = DynamicNavigationFactory.Create(typeof(TopNavigationValidator));

            SignInPage signInPage = (SignInPage)DynamicPageFactory.Create(typeof(SignInPage));

            signInPage.Load();

            HomePage homePage = (HomePage)signInPage.PerformSignIn(Config.Username, Config.Password);

            //Varify top navigation links when on Home page
            Assert.True(topNavigationValidator.Verify());

            IMainCategoryPage pcLaptopsNotebooksPage = homePage.OpenCategoryMenuAndSelectCategory(mainCategory);

            //Varify top navigation links when on Main catogory page
            Assert.True(topNavigationValidator.Verify());

            IBrandCategoryPage hpPage = pcLaptopsNotebooksPage.SelectBrandCategory(brandCategory);

            //Varify top navigation links when on Brand Category page
            Assert.True(topNavigationValidator.Verify());

            IProductTypePage ultraBookPage = hpPage.SelectProductType(productType);

            //Varify top navigation links when on Product Type page
            Assert.True(topNavigationValidator.Verify());

            IProductPage itemPage = ultraBookPage.SelectProduct(product);

            //Varify top navigation links when on Product page
            Assert.True(topNavigationValidator.Verify());

            ICheckOutPage checkOutPage = itemPage.BuyProduct(typeof(DefaultCheckoutPage));

            checkOutPage.PerformCheckout(typeof(HomePage));
        }