Beispiel #1
0
        public void SubtractButtonCart()
        {
            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, 2);

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

            var   cart    = new CartPart(driver);
            Stock classic = cart.StepClassicCart("-");

            Assert.That(classic != null, Is.True);
            Stock ajax = cart.GetAjaxCart();

            Assert.That(ajax != null, Is.True);

            cart.EmptyAjaxCart();

            // check Classic Cart
            Assert.That((1 == classic.Quantity && price == classic.Value), Is.True);
            //check Ajax Cart
            Assert.That((1 == ajax.Quantity && price == ajax.Value), Is.True);
        } // SubtractButtonInCart
Beispiel #2
0
        public void ProductSummary_QuickView()
        {
            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);
            Product summary = offer.GetSummarytInfo(0);
            Product detail  = offer.GetQuickViewInfo(0);

            Assert.That(summary != null && detail != null && summary.Name == detail.Name && summary.Price == detail.Price, Is.True);
        } // ProductSummary_QuickView
Beispiel #3
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
Beispiel #4
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
Beispiel #5
0
        public void EmptyCartBySubtractButton()
        {
            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);

            var   cart    = new CartPart(driver);
            Stock classic = cart.StepClassicCart(".");

            Assert.That(classic == null, Is.True);

            Stock ajax = cart.GetAjaxCart();

            Assert.That(ajax == null, Is.True);
        } // EmptyCartBySubtractButton