public void ThenIShouldSeeTheTargetedItem() { string actual = "Faded short sleeve t-shirt with high neckline. Soft and stretchy material for a comfortable fit. Accessorize with a straw hat and you're ready for summer!"; string expected = "Faded short sleeve t-shirt with high neckline. Soft and stretchy material for a comfortable fit. Accessorize with a straw hat and you're ready for summer!"; Assert.AreEqual(expected, _detailPage.GetItemDetail(globaldriver, actual), "Wrong item"); globaldriver.Quit(); }
public void POM_SeleniumTest() { _homepage.GotoURL(globaldriver); _detailPage.ClickMore(globaldriver); Assert.AreEqual("Faded short sleeve t-shirt with high neckline. Soft and stretchy material for a comfortable fit. Accessorize with a straw hat and you're ready for summer!", _detailPage.GetItemDetail(globaldriver, "Faded short sleeve t-shirt with high neckline. Sof"), "Wrong item"); globaldriver.Quit(); }
public void SearchForItemIDTest(string searchBoxID, string searchedItem, string itemExpectedResult, string itemDesc, string id_itemDesc) { driver.Navigate().GoToUrl("http://automationpractice.com/index.php"); driver.FindElement(By.Id(searchBoxID)).Click(); driver.FindElement(By.Id(searchBoxID)).SendKeys(searchedItem); By foundItem = By.LinkText(itemExpectedResult); driver.FindElement(foundItem).Click(); Assert.AreEqual(itemDesc, _detailPage.GetItemDetail(driver, id_itemDesc), "Wrong item"); }
public void RemovesItemsFromCart() { //searchbox ID and items are set //searchbox Item parameters set string searchBoxID = "search_query_top"; //Item parameters********************************************************** //whats searched string Item1 = "Blouse"; //whats found string Item1result = "Blouse"; string blouseDesc = "Short sleeved blouse with feminine draped sleeve detail."; string id_blouseDesc = "Short sleeved blouse with feminine draped sleeve d"; //********************************************************************************************************* //Searching to Item driver.Navigate().GoToUrl(homeURL); driver.FindElement(By.Id(searchBoxID)).Click(); driver.FindElement(By.Id(searchBoxID)).SendKeys(Item1); By foundItem = By.LinkText(Item1result); driver.FindElement(foundItem).Click(); Assert.AreEqual(blouseDesc, _detailPage.GetItemDetail(driver, id_blouseDesc), "Wrong item"); //********************************************************************************************************** //Adding to Cart driver.FindElement(By.XPath(XPathbyText("Add to cart"))).Click(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3); driver.FindElement(By.XPath(XPathbyText("Proceed to checkout"))).Click(); //Checking Item is in Cart Assert.AreEqual(Item1, _InCartCheck.InCartCheck(driver, Item1), "Item not in Cart"); //********************************************************************************************************** //Deleting from Cart driver.FindElement(By.XPath("//i[@class='icon-trash']")).Click(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3); //Checking Item has been removed driver.FindElement(By.XPath("//p[@class='alert alert-warning']")); }