public IBrandCategoryPage SelectBrandCategory(Type brandNamePage) { _brandCategory = (IBrandCategoryPage)brandNamePage; foreach (IWebElement brand in _brandLinks) { if (brand.Text == _brandCategory.brandCategoryName) { brand.Click(); } else { continue; } } return((IBrandCategoryPage)DynamicPageFactory.Create(brandNamePage)); }
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)); }