Example #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 BuyRocket(string rocketName, int quantity, string coupon = null)
        {
            Assert.IsNotNull(rocketName);
            Assert.AreNotEqual <int>(0, quantity);

            ShopPage page = new ShopPage(_driver);

            page.PurchaseRocket(rocketName);
        }