public BasePage PerformSignIn(string Username, string Password) { _username.SendKeys(Username); _password.SendKeys(Password); _signInButton.Click(); return(DynamicPageFactory.Create(typeof(HomePage))); }
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 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)); }
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)); }
public BasePage PerformCheckout(Type ReturnPageName) { //Add checkout logic here return(DynamicPageFactory.Create(ReturnPageName)); }
public ICheckOutPage BuyProduct(Type checkOutMethodPage) { _buyNowButton.Click(); return((ICheckOutPage)DynamicPageFactory.Create(checkOutMethodPage)); }
public BasePage SelectFirstListing() { _firstListingLinks.Click(); return(DynamicPageFactory.Create(typeof(ProductPage))); }
public IProductPage SelectProduct(Type productPage) { _firstListingLinks.Click(); return((IProductPage)DynamicPageFactory.Create(productPage)); }