public void Should_Fail_When_ThankYouMessageIsNotDisplayed() { //Arrange string expectedResult = "Thank you for your purchase!"; OrderBO customerDetails = new OrderBO(); //Act var cart = menu.NavigateToCart(); var orderPage = cart.NavigateToOrderPage(); var thankYouPage = orderPage.SubmitDetails(customerDetails); var actualResult = thankYouPage.LblThankYou.Text; //Assert Assert.AreEqual(expectedResult, actualResult); }
public void Should_Fail_When_CalculatedTotalNotEqualWithDisplayedTotal() { //Two random products added to the cart (based on their order on the homepage) //Arrange var firstProduct = homePage.GoToSpecificProduct(3); firstProduct.addPhoneToCart(); homePage = menu.NavigateToHomePage(); var secondProduct = homePage.GoToSpecificProduct(6); secondProduct.addPhoneToCart(); //Act cart = menu.NavigateToCart(); Thread.Sleep(1000); //Haven't found a method to wait for table to fully load var actualTotal = cart.CalculateTotal(); var expectedTotal = cart.GetTotalPrice(); //Assert Assert.AreEqual(actualTotal, expectedTotal); }