Exemple #1
0
 public static SveaPaymentFramePage PayWithAccount(this SveaPaymentFramePage page)
 {
     return(page
            .PaymentMethods.Account.IsVisible.WaitTo.BeTrue()
            .PaymentMethods.Account.Click()
            .Submit.Click());
 }
Exemple #2
0
        public static SveaPaymentFramePage IdentifyEntity(this SveaPaymentFramePage page, Checkout.Option checkout = Checkout.Option.Identification, Entity.Option entity = Entity.Option.Private)
        {
            page.Entity.IsVisible.WaitTo.BeTrue();

            switch (entity)
            {
            default:
            case Entity.Option.Private:

                switch (checkout)
                {
                default:
                case Checkout.Option.Identification:
                    return(page.ProceedWithPrivateIdentification().PaymentMethods.IsVisible.WaitTo.BeTrue());

                case Checkout.Option.Anonymous:
                    return(page.ProceedWithPrivateAnonymous().PaymentMethods.IsVisible.WaitTo.BeTrue());
                }

            case Entity.Option.Company:

                switch (checkout)
                {
                default:
                case Checkout.Option.Identification:
                    return(page.ProceedWithCompanyIdentification().PaymentMethods.IsVisible.WaitTo.BeTrue());

                case Checkout.Option.Anonymous:
                    return(page.ProceedWithCompanyAnonymous().PaymentMethods.IsVisible.WaitTo.BeTrue());
                }
            }
        }
Exemple #3
0
 public static SveaPaymentFramePage PayWithBlackFriday(this SveaPaymentFramePage page)
 {
     return(page
            .PaymentMethods.BlackFriday.IsVisible.WaitTo.BeTrue()
            .PaymentMethods.BlackFriday.Click()
            .Submit.Click());
 }
Exemple #4
0
 public static SveaPaymentFramePage PayWithTrustly(this SveaPaymentFramePage page, Checkout.Option checkout)
 {
     return(page
            .PaymentMethods.Trustly.IsVisible.WaitTo.BeTrue()
            .PaymentMethods.Trustly.Click()
            .Submit.ClickAndGo <TrustlyPaymentPage>()
            .Banks[0].IsVisible.WaitTo.BeTrue()
            .Banks[0].Click()
            .Next.Click()
            .Do(x => {
         if (checkout == Checkout.Option.Anonymous)
         {
             x.PersonalNumber.Set(TestDataService.PersonalNumber);
         }
     })
            .SecurityCodeOption.Click()
            .Next.Click()
            .MessageCode.StoreValue(out string code)
            .Code.Set(code)
            .Next.Click()
            .AccountOptions.IsVisible.WaitTo.Within(60).BeTrue()
            .Next.Click()
            .MessageCode.StoreValue(out code)
            .Code.Set(code)
            .Next.Click()
            .SwitchToRoot <SveaPaymentFramePage>());
 }
Exemple #5
0
 public static SveaPaymentFramePage PayWithInvoice(this SveaPaymentFramePage page)
 {
     return(page
            .PaymentMethods.Invoice.IsVisible.WaitTo.BeTrue()
            .PaymentMethods.Invoice.Click()
            .Submit.Click());
 }
Exemple #6
0
 public static SveaPaymentFramePage PayWithPaymentPlan(this SveaPaymentFramePage page)
 {
     return(page
            .PaymentMethods.PaymentPlan.IsVisible.WaitTo.BeTrue()
            .PaymentMethods.PaymentPlan.Click()
            .PaymentMethods.PaymentPlan.Options[1].Click()
            .Submit.Click());
 }
Exemple #7
0
 public static SveaPaymentFramePage PayWithDirektBank(this SveaPaymentFramePage page)
 {
     return(page
            .PaymentMethods.DirektBank.IsVisible.WaitTo.BeTrue()
            .PaymentMethods.DirektBank.Click()
            .PaymentMethods.DirektBank.Nordea.Click()
            .Submit.Click());
 }
Exemple #8
0
 public static SveaPaymentFramePage ProceedWithCompanyAnonymous(this SveaPaymentFramePage page)
 {
     return(page
            .Entity.IsCompany.Click()
            .Entity.ToggleIdentification.Click()
            .B2BAnonymous.IsVisible.WaitTo.BeTrue()
            .B2BAnonymous.OrganizationName.Set(TestDataService.CompanyName)
            .B2BAnonymous.Street.Set(TestDataService.Street)
            .B2BAnonymous.ZipCode.Set(TestDataService.ZipCode)
            .B2BAnonymous.City.Set(TestDataService.City)
            .B2BAnonymous.Email.Set(TestDataService.Email)
            .B2BAnonymous.PhoneNumber.Set(TestDataService.PhoneNumber)
            .Submit.Click());
 }
Exemple #9
0
 public static SveaPaymentFramePage ProceedWithPrivateAnonymous(this SveaPaymentFramePage page)
 {
     return(page
            .Entity.IsPrivate.Click()
            .Entity.ToggleIdentification.Click()
            .B2CAnonymous.IsVisible.WaitTo.BeTrue()
            .B2CAnonymous.FirstName.Set(TestDataService.FirstName)
            .B2CAnonymous.LastName.Set(TestDataService.LastName)
            .B2CAnonymous.Street.Set(TestDataService.Street)
            .B2CAnonymous.CareOfToggle.Click()
            .B2CAnonymous.CareOf.Set(TestDataService.CareOf)
            .B2CAnonymous.ZipCode.Set(TestDataService.ZipCode)
            .B2CAnonymous.City.Set(TestDataService.City)
            .B2CAnonymous.Email.Set(TestDataService.Email)
            .B2CAnonymous.PhoneNumber.Set(TestDataService.PhoneNumber)
            .Submit.Click());
 }
Exemple #10
0
 public static SveaPaymentFramePage ProceedWithCompanyIdentification(this SveaPaymentFramePage page)
 {
     return(page
            .Entity.IsCompany.Click()
            .B2BIdentification.Email.Set(TestDataService.Email)
            .B2BIdentification.OrganizationNumber.Set(TestDataService.OrganizationNumber)
            .Submit.Click()
            .Do(x =>
     {
         if (x.B2BIdentification.Phone.Exists(new SearchOptions {
             IsSafely = true
         }))
         {
             x
             .B2BIdentification.Phone.Set(TestDataService.PhoneNumber)
             .Submit.Click();
         }
     }));
 }
Exemple #11
0
 public static SveaPaymentFramePage ProceedWithPrivateIdentification(this SveaPaymentFramePage page)
 {
     return(page
            .Entity.IsPrivate.Click()
            .B2CIdentification.Email.Set(TestDataService.Email)
            .B2CIdentification.ZipCode.Set(TestDataService.ZipCode)
            .Submit.Click()
            .Do(x =>
     {
         if (x.B2CIdentification.PersonalNumber.Exists(new SearchOptions {
             IsSafely = true
         }))
         {
             x
             .B2CIdentification.PersonalNumber.Set(TestDataService.PersonalNumber)
             .B2CIdentification.Phone.Set(TestDataService.PhoneNumber)
             .Submit.Click();
         }
     }));
 }
Exemple #12
0
        public static SveaPaymentFramePage Pay(this SveaPaymentFramePage page, Checkout.Option checkout = Checkout.Option.Identification, Entity.Option entity = Entity.Option.Private, PaymentMethods.Option paymentMethod = PaymentMethods.Option.Card, string amount = null)
        {
            page
            .PaymentMethods.TotalAmount.IsVisible.WaitTo.BeTrue()
            .PaymentMethods.TotalAmount.Should.ContainAmount(amount);

            if (entity == Entity.Option.Company && checkout == Checkout.Option.Identification)
            {
                page.PaymentMethods.Reference.Set(TestDataService.Reference);
            }

            switch (paymentMethod)
            {
            default:
            case PaymentMethods.Option.Card:
                return(page.PayWithCard());

            case PaymentMethods.Option.DirektBank:
                return(page.PayWithDirektBank());

            case PaymentMethods.Option.Invoice:
                return(page.PayWithInvoice());

            case PaymentMethods.Option.Trustly:
                return(page.PayWithTrustly(checkout));

            case PaymentMethods.Option.PaymentPlan:
                return(page.PayWithPaymentPlan());

            case PaymentMethods.Option.AccountCredit:
                return(page.PayWithAccount());

            case PaymentMethods.Option.BlackFriday:
                return(page.PayWithBlackFriday());

            case PaymentMethods.Option.Swish:
                return(page.PayWithSwish());
            }
        }
Exemple #13
0
 public static SveaPaymentFramePage PayWithCard(this SveaPaymentFramePage page)
 {
     return(page
            .PaymentMethods.Card.IsVisible.WaitTo.BeTrue()
            .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)
            .Submit.Click()
            .SwitchToRoot <SveaPaymentFramePage>());
 }