public void TestBrowseProducts_FindStore2() { WFMUtils.LoadWebPage(driver, WFMMainPageURL); Assert.That(driver.Url, Is.EqualTo(WFMMainPageURL)); WFMMainPage WFMMainPageObj = new WFMMainPage(driver); WFMMainPageObj.ClickToBrowseProductsMenu(); BrowseProductsPage BrowseProductsPageObj = new BrowseProductsPage(driver); BrowseProductsPageObj.SetFindStoreSearchBoxText("FindStore", "78758"); BrowseProductsPageObj.ClickStoreFromSearch("FindStoreSearchResult", "Domain — 11920 Domain Dr, Austin, TX 78758"); Assert.That(driver.FindElement(BrowseProductsPageObj.PageElements["SavedStoreLocation"]).GetAttribute("innerText"), Is.EqualTo("Domain")); WFMUtils.ScreenshotToFilepath(driver, "jeffshot.png"); Thread.Sleep(2000); }
public void TestSearchProducts() { WFMUtils.LoadWebPage(this.driver, "https://products.wholefoodsmarket.com/"); BrowseProductsPage BrowseProductsPageObj = new BrowseProductsPage(driver); BrowseProductsPageObj.SetFindStoreSearchBoxText("FindStore", "78758"); BrowseProductsPageObj.ClickElementAfterSearch("FindStoreSearchResult", "Domain — 11920 Domain Dr, Austin, TX 78758"); Thread.Sleep(2000); Assert.AreEqual(this.driver.FindElement(BrowseProductsPageObj.PageElements["SavedStoreLocation"]).GetAttribute("innerText"), "Domain"); Thread.Sleep(2000); BrowseProductsPageObj.SetProductSearchBoxText("ProductSearchBox", "Apple"); Thread.Sleep(2000); Assert.That(this.driver.FindElement(BrowseProductsPageObj.PageElements["ProductCardName"]).GetAttribute("innerText"), Contains.Substring("Apple")); BrowseProductsPageObj.DoMenuHoverThenClickProductCard(BrowseProductsPageObj.PageElements["ProductCard"]); Thread.Sleep(3000); Assert.That(this.driver.FindElement(BrowseProductsPageObj.PageElements["ProductHeader"]).GetAttribute("innerText"), Contains.Substring("Apple")); }