Exemplo n.º 1
0
        public void CheckoutWithoutTerms()
        {
            var menu = new MenuPart(driver);

            // hitting the menu should return at least one result
            Assert.That(menu.BringTshirts(), Is.True);

            var    offer = new OfferPart(driver);
            double price = offer.PutProductInCart(0, 1);

            Assert.That(price >= 0, Is.True);

            Order myOrder = new Order();

            var cart = new CartPart(driver);

            myOrder.Value = cart.CheckoutCart();

            var address = new CheckoutAddressPart(driver);

            address.NextPage();

            var modal   = new AlertPart(driver);
            var carrier = new CheckoutCarrierPart(driver);

            // trying to go to the Payment Page without checking Terms & Conditions
            carrier.NextPage();
            // verifying if I'm getting the expected alert message
            // NULL is returned when the message is not the same
            bool?alert = modal.IsAlert("You must agree to the terms of service before continuing.");

            if (alert != false)
            {
                modal.Close();
            }
            // are we on the Payment page?
            bool payment = carrier.IsPaymentPage();

            cart.EmptyAjaxCart();

            Assert.That(payment == false && alert != false, Is.True);
        } // CheckoutWithoutTerms
Exemplo n.º 2
0
        public void CheckoutAndVerifyHistory()
        {
            var menu = new MenuPart(driver);

            // hitting the menu should return at least one result
            Assert.That(menu.BringDresses(), Is.True);

            var offer = new OfferPart(driver);

            Assert.That(offer.PutDifferentProductsInCart(3), Is.True);

            Order myOrder = new Order();

            var cart = new CartPart(driver);

            myOrder.Value = cart.CheckoutCart();

            var address = new CheckoutAddressPart(driver);

            address.NextPage();

            var carrier = new CheckoutCarrierPart(driver);

            carrier.CheckTerms();
            carrier.NextPage();

            var payment = new CheckoutPaymentPart(driver);

            payment.SelectCheque();

            var order = new OrderConfirmationPart(driver);

            myOrder.Id = order.Confirm();
            order.NextPage();

            var   history     = new HistoryPart(driver);
            Order latestOrder = history.GetLatest();

            cart.EmptyAjaxCart();

            Assert.That((myOrder.Id == latestOrder.Id && myOrder.Value == latestOrder.Value), Is.True);
        } // CheckoutAndVerifyHistory