Ejemplo n.º 1
0
        public void PurchaseRocket(string rocketName, int quantity, string coupon = null)
        {
            _shopPage.PurchaseRocket(rocketName);

            //on the Cart page
            _cartPage.Quantity(quantity);
            _cartPage.UpdateCart();
            _cartPage.ApplyCoupon(coupon);


            //could do an assert here on total??
            string total = _cartPage.GetTotal;

            Debug.WriteLine($"cart.GetTotal={total}");  //50.00€

            //click the checkout
            _cartPage.ProceedToCheckout();


            //on the Checkout page
            _checkoutPage.PopulateBillingInfo(_billinInfo);

            //could do an assert here on total??
            total = _checkoutPage.GetTotal;
            Debug.WriteLine($"checkoutPage.GetTotal={total}");  //150.00€

            _checkoutPage.PlaceOrder();
        }
 public void PurchaseItem(string rocketName, string couponName, int quantity, string expectedPrice, PurchaseInfo purchaseInfo)
 {
     _mainPage.Open();
     _mainPage.AddRocketToShoppingCart(rocketName);
     _cartPage.ApplyCoupon(couponName);
     _cartPage.Assertions.AssertCouponAppliedSuccessfully();
     _cartPage.IncreaseProductQuantity(quantity);
     _cartPage.Assertions.AssertTotalPrice(expectedPrice);
     _cartPage.ClickProceedToCheckout();
     _checkoutPage.FillBillingInfo(purchaseInfo);
     _checkoutPage.Assertions.AssertOrderReceived();
 }
 protected override void ApplyCoupon(string couponName)
 {
     _cartPage.ApplyCoupon(couponName);
 }