Example #1
0
        public void BuyProductFromCart()
        {
            ConfirmAddToCartStartPage ConfirmAddToCartStartPage = new ConfirmAddToCartStartPage(FFDriver);

            PageFactory.InitElements(FFDriver, (new ConfirmAddToCartStartPage(this.FFDriver)));

            ShoppingCartPage ShoppingCartPage = ConfirmAddToCartStartPage.OpenShoppingCartPage();
            SignInPage       SignInPage       = ShoppingCartPage.OpenSignInPage();
            //TODO:retrieving data from file
            string login    = ConfigurationManager.AppSettings["login"];
            string password = ConfigurationManager.AppSettings["password"];
            SelectShippingAddress SelectShippingAddress = SignInPage.OpenShippingAddressPageWithCredentials(login, password);

            AmazonUIBuyer.Pages.SelectShippingAddress.ShippingAddressInfo ShippingAddressInfo = new AmazonUIBuyer.Pages.SelectShippingAddress.ShippingAddressInfo();

            //TODO: retriving and setting values
            ShippingAddressInfo.FullName          = ConfigurationManager.AppSettings["FullName"];
            ShippingAddressInfo.AddressLineFirst  = ConfigurationManager.AppSettings["AddressLineFirst"];
            ShippingAddressInfo.AddressLineSecond = ConfigurationManager.AppSettings["AddressLineSecond"];
            ShippingAddressInfo.City = ConfigurationManager.AppSettings["City"];
            ShippingAddressInfo.StateProvinceRegion = ConfigurationManager.AppSettings["StateProvinceRegion"];
            ShippingAddressInfo.ZIP                = ConfigurationManager.AppSettings["ZIP"];
            ShippingAddressInfo.Country            = ConfigurationManager.AppSettings["Country"];
            ShippingAddressInfo.PhoneNumber        = ConfigurationManager.AppSettings["PhoneNumber"];
            ShippingAddressInfo.WeekendDelivery    = ConfigurationManager.AppSettings["WeekendDelivery"];
            ShippingAddressInfo.SecurityAccessCode = ConfigurationManager.AppSettings["SecurityAccessCode"];

            ShippingOptionPage ShippingOptionPage = SelectShippingAddress.CreateShippingAddress(ShippingAddressInfo);
            PaymentMethodPage  PaymentMethodPage  = ShippingOptionPage.SelectShippingOption("free");
            PlaceOrderPage     PlaceOrderPage     = PaymentMethodPage.ProvideCardInformation(ConfigurationManager.AppSettings["cardName"], ConfigurationManager.AppSettings["cardNumber"], ConfigurationManager.AppSettings["expCardMonth"], ConfigurationManager.AppSettings["expCardYear"]);
            //PlaceOrderPage.PlaceOrder();
        }