public void GivenIThenClickViewCartCheckout() { MKProductPage productPage = (MKProductPage)ScenarioContext.Current["productPage"]; productPage.popupViewCartCheckoutButton.Click(); MKShoppingCartPage shoppingCartPage = new MKShoppingCartPage(driver); IWebElement shoppingCartCheckoutButtonWait = wait.Until(ExpectedConditions.ElementToBeClickable(By.Id(shoppingCartPage.checkoutButton.GetAttribute("id")))); Assert.IsTrue(shoppingCartCheckoutButtonWait.Displayed); ScenarioContext.Current["shoppingCartPage"] = shoppingCartPage; }
public void GivenIAmOnTheShoppingCartPage() { MKProductPage productPage = (MKProductPage)ScenarioContext.Current["productPage"]; wait.Until(ExpectedConditions.ElementToBeClickable(By.Id(productPage.addToCartButton.GetAttribute("id")))).Click(); System.Threading.Thread.Sleep(2000); IWebElement popupViewCartProductButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.Id(productPage.popupViewCartCheckoutButton.GetAttribute("id")))); popupViewCartProductButton.Click(); MKShoppingCartPage shoppingCartPage = new MKShoppingCartPage(driver); IWebElement shoppingCartCheckoutButton = wait.Until(ExpectedConditions.ElementIsVisible(By.Id(shoppingCartPage.checkoutButton.GetAttribute("id")))); Assert.IsTrue(shoppingCartCheckoutButton.Displayed); ScenarioContext.Current["shoppingCartPage"] = shoppingCartPage; }