public void PlaceOrderTest() { const string product = "Apple iPhone 4S 16GB SIM-Free – Black"; Tools tools = new Tools(driver); ProductCategory productCategory = tools.Product(); productCategory.SelectFromProductCategoryList("iPhones"); productCategory.AddProductToCart(product); YourCart yourCart = productCategory.GoToYourCart(true); Info info = yourCart.GoToInfo(); info.CalculateShipping("USA", "Texas"); info.EnterEmail("*****@*****.**"); info.EnterBillingContactInfo(billingContactInfo); info.EnterShippingAddress(null); Final final = info.ClickPurchase(); Dictionary <string, double> finalCosts = final.GetTransactionResults(product); // Verifying the total price. Assert.AreEqual(finalCosts["Price"] * finalCosts["Quantity"] + finalCosts["Total Shipping"], finalCosts["Total"]); }
public void EmptyCartTest() { const string product = "Apple iPhone 4S 16GB SIM-Free – Black"; Tools tools = new Tools(driver); ProductCategory productCategory = tools.Product(); productCategory.SelectFromProductCategoryList("iPhones"); productCategory.AddProductToCart(product); YourCart yourCart = productCategory.GoToYourCart(true); yourCart.RemoveItemsFromCart(product, "0"); string emptyCartMessage = driver.CustomFindElement("css; div.entry-content").Text.Trim(); Utilities.CustomStringAssert("Oops, there is nothing in your cart.", emptyCartMessage); }