Last active
December 11, 2017 10:34
-
-
Save angelovstanton/ea39584f8faa6e227d6e 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 partial class PlaceOrderPage : BasePage | |
{ | |
private readonly PurchaseTestInput purchaseTestInput; | |
private readonly PromotionalPurchaseSpecification promotionalPurchaseSpecification; | |
private readonly CreditCardSpecification creditCardSpecification; | |
private readonly WiretransferSpecification wiretransferSpecification; | |
private readonly FreePurchaseSpecification freePurchaseSpecification; | |
public PlaceOrderPage(IWebDriver driver, PurchaseTestInput purchaseTestInput) : base(driver) | |
{ | |
this.purchaseTestInput = purchaseTestInput; | |
this.promotionalPurchaseSpecification = new PromotionalPurchaseSpecification(purchaseTestInput); | |
this.wiretransferSpecification = new WiretransferSpecification(purchaseTestInput); | |
this.creditCardSpecification = new CreditCardSpecification(purchaseTestInput); | |
this.freePurchaseSpecification = new FreePurchaseSpecification(); | |
} | |
public override string Url | |
{ | |
get | |
{ | |
return @"yourSiteUrl"; | |
} | |
} | |
public void ChoosePaymentMethod() | |
{ | |
if (this.creditCardSpecification. | |
And(this.wiretransferSpecification.Not()). | |
And(this.freePurchaseSpecification.Not()). | |
And(this.promotionalPurchaseSpecification.Not()). | |
IsSatisfiedBy(this.purchaseTestInput)) | |
{ | |
this.CreditCard.SendKeys("371449635398431"); | |
this.SecurityNumber.SendKeys("1234"); | |
} | |
else | |
{ | |
this.Wiretransfer.SendKeys("pathToFile"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment