public IProductTypePage SelectProductType(Type typeName) { _productType = (IProductTypePage)typeName; foreach (IWebElement type in _typeLinks) { if (type.Text == _productType.productTypeName) { type.Click(); } else { continue; } } return((IProductTypePage)DynamicPageFactory.Create(typeName)); }
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)); }