Created
March 19, 2017 17:16
-
-
Save angelovstanton/73c51d66ed03d9b10d8c48bab0efddcd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ShoppingCart | |
{ | |
private readonly ItemPage itemPage; | |
private readonly PreviewShoppingCartPage previewShoppingCartPage; | |
private readonly SignInPage signInPage; | |
private readonly ShippingAddressPage shippingAddressPage; | |
private readonly ShippingPaymentPage shippingPaymentPage; | |
private readonly PlaceOrderPage placeOrderPage; | |
public ShoppingCart( | |
ItemPage itemPage, | |
PreviewShoppingCartPage previewShoppingCartPage, | |
SignInPage signInPage, | |
ShippingAddressPage shippingAddressPage, | |
ShippingPaymentPage shippingPaymentPage, | |
PlaceOrderPage placeOrderPage) | |
{ | |
this.itemPage = itemPage; | |
this.previewShoppingCartPage = previewShoppingCartPage; | |
this.signInPage = signInPage; | |
this.shippingAddressPage = shippingAddressPage; | |
this.shippingPaymentPage = shippingPaymentPage; | |
this.placeOrderPage = placeOrderPage; | |
} | |
public void PurchaseItem( | |
string itemUrl, | |
string itemPrice, | |
ClientLoginInfo clientLoginInfo, | |
ClientPurchaseInfo clientPurchaseInfo) | |
{ | |
this.itemPage.Navigate(itemUrl); | |
this.itemPage.ClickBuyNowButton(); | |
this.previewShoppingCartPage.ClickProceedToCheckoutButton(); | |
this.signInPage.Login(clientLoginInfo.Email, clientLoginInfo.Password); | |
this.shippingAddressPage.FillShippingInfo(clientPurchaseInfo); | |
this.shippingAddressPage.ClickDifferentBillingCheckBox(clientPurchaseInfo); | |
this.shippingAddressPage.ClickContinueButton(); | |
this.shippingPaymentPage.ClickBottomContinueButton(); | |
this.shippingAddressPage.FillBillingInfo(clientPurchaseInfo); | |
this.shippingAddressPage.ClickContinueButton(); | |
this.shippingPaymentPage.ClickTopContinueButton(); | |
double totalPrice = double.Parse(itemPrice); | |
this.placeOrderPage.AssertOrderTotalPrice(totalPrice); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment