Пример #1
0
 protected OrdersPage GoToOrdersPage(Product[] products, Checkout.Option checkout = Checkout.Option.Identification, Entity.Option entity = Entity.Option.Private, PaymentMethods.Option paymentMethod = PaymentMethods.Option.Card)
 {
     return(GoToThankYouPage(products, checkout, entity, paymentMethod)
            .RefreshPageUntil(x => x.Header.Orders.IsVisible.Value == true, timeout: 25, retryInterval: 3)
            .Header.Orders.ClickAndGo());
 }
Пример #2
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());
            }
        }
Пример #3
0
        protected ThankYouPage GoToThankYouPage(Product[] products, Checkout.Option checkout = Checkout.Option.Identification, Entity.Option entity = Entity.Option.Private, PaymentMethods.Option paymentMethod = PaymentMethods.Option.Card)
        {
            var page = GoToSveaPaymentFrame(products);

            try
            {
                page.IdentifyEntity(checkout, entity);
            }
            catch (StaleElementReferenceException)
            {
                page.RefreshPage()
                .SwitchToFrame <SveaPaymentFramePage>(By.Id("svea-checkout-iframe"))
                .IdentifyEntity(checkout, entity);
            }

            page.Pay(checkout, entity, paymentMethod, _amount);

            try
            {
                return(page
                       .PageUrl.Should.Within(TimeSpan.FromSeconds(60)).Contain("thankyou")
                       .SwitchToRoot <ThankYouPage>()
                       .ThankYou.IsVisible.WaitTo.BeTrue());
            }
            catch (StaleElementReferenceException)
            {
                return(Go.To <ThankYouPage>());
            }
        }