public void PurchaseItem(string itemUrl, string itemPrice, ClientLoginInfo clientLoginInfo, ClientPurchaseInfo clientPurchaseInfo)
        {
            _itemPage.Navigate(itemUrl);
            _itemPage.ClickBuyNowButton();
            _previewShoppingCartPage.ClickProceedToCheckoutButton();
            _signInPage.Login(clientLoginInfo.Email, clientLoginInfo.Password);
            _shippingAddressPage.FillShippingInfo(clientPurchaseInfo);
            _shippingAddressPage.ClickDifferentBillingCheckBox(clientPurchaseInfo);
            _shippingAddressPage.ClickContinueButton();
            _shippingPaymentPage.ClickBottomContinueButton();
            _shippingAddressPage.FillBillingInfo(clientPurchaseInfo);
            _shippingAddressPage.ClickContinueButton();
            _shippingPaymentPage.ClickTopContinueButton();
            double couponDiscount = 0;

            if (_purchasePromotionalCodeStrategy != null)
            {
                _purchasePromotionalCodeStrategy.AssertPromotionalCodeDiscount();
                couponDiscount = _purchasePromotionalCodeStrategy.GetPromotionalCodeDiscountAmount();
            }
            var totalPrice = double.Parse(itemPrice);

            _placeOrderPage.AssertOrderTotalPrice(totalPrice, couponDiscount);
            // Some other actions...
            if (_purchasePromotionalCodeStrategy != null)
            {
                _purchasePromotionalCodeStrategy.AssertPromotionalCodeDiscount();
            }
        }
        public void Purchase_WhiteOpticalKeyboard()
        {
            var itemUrl           = "Wireless-White-2-4G-Optical-Keyboard-and-Mouse-USB-Receiver-Kit-For-PC-/360649772948?pt=LH_DefaultDomain_2&hash=item53f866cf94";
            var itemPrice         = "C $20.86";
            var currentClientInfo = new ClientInfo()
            {
                FirstName = "Anton",
                LastName  = "Angelov",
                Country   = "Bulgaria",
                Address1  = "33 Alexander Malinov Blvd.",
                City      = "Stara Zagora",
                Zip       = "6000",
                Phone     = "0035964644885",
                Email     = "*****@*****.**"
            };
            var itemPage            = new ItemPage();
            var checkoutPage        = new CheckoutPage();
            var shippingAddressPage = new ShippingAddressPage();
            var signInPage          = new SignInPage();

            itemPage.Navigate(itemUrl);
            itemPage.Validate().Price(itemPrice);
            itemPage.ClickBuyNowButton();
            signInPage.ClickContinueAsGuestButton();
            shippingAddressPage.FillShippingInfo(currentClientInfo);
            shippingAddressPage.Validate().Subtotal(itemPrice);
            shippingAddressPage.ClickContinueButton();
            checkoutPage.Validate().Subtotal(itemPrice);
        }
        public void Purchase_Casio_GShock()
        {
            var itemUrl           = "Casio-G-Shock-Standard-GA-100-1A2-Mens-Watch-Brand-New-/161209550414?pt=LH_DefaultDomain_15&hash=item2588d6864e";
            var itemPrice         = "AU $168.00";
            var currentClientInfo = new ClientInfo()
            {
                FirstName = "Anton",
                LastName  = "Angelov",
                Country   = "Bulgaria",
                Address1  = "33 Alexander Malinov Blvd.",
                City      = "Sofia",
                Zip       = "1729",
                Phone     = "0035964644885",
                Email     = "*****@*****.**"
            };
            var itemPage            = new ItemPage();
            var checkoutPage        = new CheckoutPage();
            var shippingAddressPage = new ShippingAddressPage();
            var signInPage          = new SignInPage();

            itemPage.Navigate(itemUrl);
            itemPage.Validate().Price(itemPrice);
            itemPage.ClickBuyNowButton();
            signInPage.ClickContinueAsGuestButton();
            shippingAddressPage.FillShippingInfo(currentClientInfo);
            shippingAddressPage.Validate().Subtotal(itemPrice);
            shippingAddressPage.ClickContinueButton();
            checkoutPage.Validate().Subtotal(itemPrice);
        }
        public void Purchase_WhiteOpticalKeyboard()
        {
            string itemUrl = "Wireless-White-2-4G-Optical-Keyboard-and-Mouse-USB-Receiver-Kit-For-PC-/360649772948?pt=LH_DefaultDomain_2&hash=item53f866cf94";
            string itemPrice = "C $20.86";
            ClientInfo currentClientInfo = new ClientInfo()
            {
                FirstName = "Anton",
                LastName = "Angelov",
                Country = "Bulgaria",
                Address1 = "33 Alexander Malinov Blvd.",
                City = "Stara Zagora",
                Zip = "6000",
                Phone = "0035964644885",
                Email = "*****@*****.**"
            };
            ItemPage itemPage = new ItemPage();
            CheckoutPage checkoutPage = new CheckoutPage();
            ShippingAddressPage shippingAddressPage = new ShippingAddressPage();
            SignInPage signInPage = new SignInPage();

            itemPage.Navigate(itemUrl);
            itemPage.Validate().Price(itemPrice);
            itemPage.ClickBuyNowButton();
            signInPage.ClickContinueAsGuestButton();
            shippingAddressPage.FillShippingInfo(currentClientInfo);
            shippingAddressPage.Validate().Subtotal(itemPrice);
            shippingAddressPage.ClickContinueButton();
            checkoutPage.Validate().Subtotal(itemPrice);
        }
        public void Purchase_Casio_GShock()
        {
            string itemUrl = "Casio-G-Shock-Standard-GA-100-1A2-Mens-Watch-Brand-New-/161209550414?pt=LH_DefaultDomain_15&hash=item2588d6864e";
            string itemPrice = "AU $168.00";
            ClientInfo currentClientInfo = new ClientInfo()
            {
                FirstName = "Anton",
                LastName = "Angelov",
                Country = "Bulgaria",
                Address1 = "33 Alexander Malinov Blvd.",
                City = "Sofia",
                Zip = "1729",
                Phone = "0035964644885",
                Email = "*****@*****.**"
            };
            ItemPage itemPage = new ItemPage();
            CheckoutPage checkoutPage = new CheckoutPage();
            ShippingAddressPage shippingAddressPage = new ShippingAddressPage();
            SignInPage signInPage = new SignInPage();

            itemPage.Navigate(itemUrl);
            itemPage.Validate().Price(itemPrice);
            itemPage.ClickBuyNowButton();
            signInPage.ClickContinueAsGuestButton();
            shippingAddressPage.FillShippingInfo(currentClientInfo);
            shippingAddressPage.Validate().Subtotal(itemPrice);
            shippingAddressPage.ClickContinueButton();
            checkoutPage.Validate().Subtotal(itemPrice);
        }
Exemplo n.º 6
0
 public void PurchaseItem(string item, string itemPrice, ClientInfo clientInfo)
 {
     ItemPage.Navigate(item);
     ItemPage.Validate().Price(itemPrice);
     ItemPage.ClickBuyNowButton();
     SignInPage.ClickContinueAsGuestButton();
     ShippingAddressPage.FillShippingInfo(clientInfo);
     ShippingAddressPage.Validate().Subtotal(itemPrice);
     ShippingAddressPage.ClickContinueButton();
     CheckoutPage.Validate().Subtotal(itemPrice);
 }
        public void NavigateToItemUrl(Table productsTable)
        {
            var itemPage = new ItemPage(Driver.Browser);
            var products = productsTable.CreateDynamicSet();

            foreach (var product in products)
            {
                itemPage.Navigate(string.Concat(product.Url, "?", product.AffilicateCode));
                itemPage.ClickBuyNowButton();
            }
        }
        public void PurchaseItem(
            string itemUrl,
            string itemPrice,
            ClientLoginInfo clientLoginInfo,
            ClientPurchaseInfo clientPurchaseInfo)
        {
            _itemPage.Navigate(itemUrl);
            _itemPage.ClickBuyNowButton();
            _previewShoppingCartPage.ClickProceedToCheckoutButton();
            _signInPage.Login(clientLoginInfo.Email, clientLoginInfo.Password);
            _shippingAddressPage.FillShippingInfo(clientPurchaseInfo);
            _shippingAddressPage.ClickDifferentBillingCheckBox(clientPurchaseInfo);
            _shippingAddressPage.ClickContinueButton();
            _shippingPaymentPage.ClickBottomContinueButton();
            _shippingAddressPage.FillBillingInfo(clientPurchaseInfo);
            _shippingAddressPage.ClickContinueButton();
            _shippingPaymentPage.ClickTopContinueButton();
            var totalPrice = double.Parse(itemPrice);

            _placeOrderPage.AssertOrderTotalPrice(totalPrice);
        }
Exemplo n.º 9
0
 protected override void ClickBuyNowButton() => _itemPage.ClickBuyNowButton();
Exemplo n.º 10
0
 public override void PerformAct()
 {
     _itemPage.ClickBuyNowButton();
 }
Exemplo n.º 11
0
 protected override void PerformAct()
 {
     _itemPage.ClickBuyNowButton();
 }