Skip to content

Commit

Permalink
Merge branch 'hotfix/0.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
zunkas committed Jul 8, 2020
2 parents 7fbd84b + dc06c58 commit 4d241c0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Sample.AspNetCore.SystemTests.PageObjectModels.Payment
{
[Wait(1, TriggerEvents.BeforeClick, AppliesTo = TriggerScope.Children)]
[ControlDefinition("form[@data-testid='confirm-form']", ComponentTypeName = "Payment Methods Block")]
public class PaymentMethodsBlock<TOwner> : Control<TOwner> where TOwner : PageObject<TOwner>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ namespace Sample.AspNetCore.SystemTests.PageObjectModels.Payment

public class CardPaymentPage : Page<_>
{
[FindById("CardNumber")]
[FindByDescendantAttribute("value", values: "credit")]
public Label<_> CreditCard { get; set; }

[FindByDescendantAttribute("value", values: "debit")]
public Label<_> DebitCard { get; set; }

[FindById("CardNumber")]
public TextInput<_> CardNumber { get; set; }

[FindById("Expiry")]
Expand All @@ -17,7 +23,7 @@ public class CardPaymentPage : Page<_>

[FindById("AmountDiv")]
public TextInput<_> TotalAmount { get; set; }

[FindById("submit-button")]
public Button<_> Submit { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Sample.AspNetCore.SystemTests.PageObjectModels;
using Sample.AspNetCore.SystemTests.PageObjectModels.Payment;
using Sample.AspNetCore.SystemTests.Services;
using System;

namespace Sample.AspNetCore.SystemTests.Test.Helpers
{
Expand All @@ -14,6 +15,13 @@ public static SveaPaymentFramePage PayWithCard(this SveaPaymentFramePage page)
.PaymentMethods.Card.Click()
.Submit.ClickAndGo<CardPaymentPage>()
.CardNumber.IsVisible.WaitTo.BeTrue()
.Do(x =>
{
if (x.DebitCard.Exists(new SearchOptions { IsSafely = true, Timeout = TimeSpan.FromSeconds(1) }))
{
x.DebitCard.Click();
}
})
.CardNumber.Set(TestDataService.CreditCardNumber)
.Expiry.Set(TestDataService.CreditCardExpiratioDate)
.Cvc.Set(TestDataService.CreditCardCvc)
Expand Down

0 comments on commit 4d241c0

Please sign in to comment.