public void WhenUserSearchesForItemsAndSelectsOne_ThenDetailsAreDisplayedForTheSelectedProduct() { var indexPage = new IndexPage(_webDriver, _baseUrl + "/index.html", "Sample App"); indexPage.SearchButton.Click(); Utility.WaitUpTo(5000, () => Utility.IsElementPresent(indexPage.SearchResultsTable) && indexPage.SearchResultsTable.Displayed, "Search results"); Assert.AreNotEqual(0, indexPage.GetNumberOfSearchResults()); indexPage.ClickSearchResults(0); Utility.WaitUpTo(5000, () => Utility.IsElementPresent(indexPage.ItemDetails) && indexPage.ItemDetails.Displayed, "Item Details"); Assert.AreEqual(indexPage.GetSelectedRowItemName(), indexPage.ItemDetailsName.Text); }
public void WhenUserSearchesForItemsAndClicksOneToViewDetailsAndAddsToCart_ThenTheItemAppearsInTheCart() { var indexPage = new IndexPage(_webDriver, _baseUrl + "/index.html", "Sample App"); indexPage.SearchButton.Click(); Utility.WaitUpTo(5000, () => Utility.IsElementPresent(indexPage.SearchResultsTable) && indexPage.SearchResultsTable.Displayed, "Search results"); Assert.AreNotEqual(0, indexPage.GetNumberOfSearchResults()); indexPage.ClickSearchResults(0); Utility.WaitUpTo(5000, () => Utility.IsElementPresent(indexPage.ItemDetails) && indexPage.ItemDetails.Displayed, "Item Details"); indexPage.ItemDetailsAddToCart.Click(); indexPage.LookAtCartDetails(); Assert.AreEqual("1", indexPage.CartCount.Text); Assert.AreEqual(1, indexPage.GetNumberOfCartDetailsRows()); }