예제 #1
0
        public void ValidateAvailabilityIsDisplay()
        {
            APIndexPage indexPage = new APIndexPage(Driver, Url);

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            indexPage = loginPage.Login("*****@*****.**", "1234");

            var manufacturesItems = indexPage.Header.GetManufacturerOptions();

            manufacturerOption = manufacturesItems.ElementAtOrDefault(2).webElement.Text;

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            Thread.Sleep(2000);

            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            Thread.Sleep(2000);
            IDictionary <string, string> availabiltyItemsTag = checkoutPage.AvailabiltyTagGet();

            Assert.IsTrue(availabiltyItemsTag.Count() > 0);
        }
예제 #2
0
        public void ValidateAvailability_Cart_Equals_Checkout()
        {
            APIndexPage indexPage = new APIndexPage(Driver, Url);

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            indexPage = loginPage.Login("*****@*****.**", "1234");

            var manufacturesItems = indexPage.Header.GetManufacturerOptions();

            manufacturerOption = manufacturesItems.ElementAtOrDefault(2).webElement.Text;

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            Thread.Sleep(5000);

            IDictionary <string, string> cartAvailabiltyItemsTag = CartMainPage.AvailabiltyTagGet();
            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            Thread.Sleep(5000);
            IDictionary <string, string> checkoutAvailabiltyItemsTag = checkoutPage.AvailabiltyTagGet();

            foreach (var tag in checkoutAvailabiltyItemsTag)
            {
                Assert.AreEqual(cartAvailabiltyItemsTag[tag.Key], tag.Value);
            }
        }
예제 #3
0
        public void Availability_OutOfStock()
        {
            APIndexPage indexPage = new APIndexPage(Driver, Url);

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            indexPage = loginPage.Login("*****@*****.**", "1234");

            var manufacturesItems = indexPage.Header.GetManufacturerOptions();

            manufacturerOption = manufacturesItems.ElementAtOrDefault(2).webElement.Text;

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            Thread.Sleep(2000);

            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            Thread.Sleep(2000);
            IDictionary <string, string> availabiltyItemsTag = checkoutPage.AvailabiltyTagGet();

            Assert.IsNotNull(availabiltyItemsTag.FirstOrDefault(t => t.Value.Contains(AvailabiltyConstants.OutOfStockGeneral)));
        }
예제 #4
0
        public void E2E06()
        {
            APIndexPage indexPage = new APIndexPage(Driver, Url);

            // log in
            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            loginPage.Login("*****@*****.**", "test1234");

            indexPage.Header.SetSearchFieldText("103-1035");
            CatalogItemsPage catalogItemsPage = indexPage.Header.ClickOnSearchButton();

            catalogItemsPage.AddToCartFirstItemInCatalog();

            APCartPage cartPage = indexPage.Header.ClickOnViewCart();

            Assert.IsTrue(cartPage.ShippingOptionsPriced());

            string shippingPrice = cartPage.SelectShipping("Showroom Pickup");

            cartPage.WaitForAppBusy();
            Assert.AreEqual(cartPage.GetShippingTotal(), "Free");

            shippingPrice = cartPage.SelectShipping("Ground");
            cartPage.WaitForAppBusy();
            Assert.AreEqual(cartPage.GetShippingTotal(), shippingPrice);

            APCheckoutPage checkoutPage = cartPage.ProceedToCheckOut();

            checkoutPage.WaitForAppBusy();
            checkoutPage.ClickShippingEdit();
            checkoutPage.SelectAddressRadioButton(AddressSelectOptions.New);
            AddressModel addressModel = new AddressModel
            {
                street      = "street 1",
                state       = "Alabama",
                city        = "city 1",
                postal      = "12345",
                country     = "Mexico",
                region      = "CL",
                CompanyName = "test"
            };

            checkoutPage.SetAddressElement(AddressInputs.StreetAddress, addressModel.street);
            checkoutPage.SetAddressElement(AddressInputs.City, addressModel.city);
            checkoutPage.SetAddressElement(AddressInputs.State, addressModel.state);
            checkoutPage.SetAddressElement(AddressInputs.Postal, addressModel.postal);
            checkoutPage.SetAddressElement(AddressInputs.Country, addressModel.country);
            checkoutPage.SetAddressElement(AddressInputs.ATTN, addressModel.CompanyName);
            checkoutPage.ShippingButtonIsEnable();
            checkoutPage.ShippingSubmitClick();
            System.Threading.Thread.Sleep(6000);

            //checkoutPage.NextStep();

            //Assert.AreEqual(checkoutPage.ShippingWarning(), "Cannot estimate shipping");
        }
예제 #5
0
        public void BillingInfoAUTH_T6208()
        {
            var indexPage = new APIndexPage(Driver, Url);

            //TODO
            //implement data factory

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            //TODO
            indexPage = loginPage.Login("", "");

            var manufacturesItems = indexPage.Header.GetManufacturerOptions();

            manufacturerOption = manufacturesItems.ElementAtOrDefault(2).webElement.Text;

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            //Waiting For Loading Cart
            Thread.Sleep(5000);

            //Click no Proceed to checkout button
            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            Thread.Sleep(3000);

            checkoutPage.SelectAddressRadioButton(AddressSelectOptions.Existing);

            //checkoutPage.SelectFirstInAddressDropDown();

            checkoutPage.ClickShippingButton();

            checkoutPage.SelectBillingRadioButton(BillingSelectOptions.Existing);

            //checkoutPage.SelectFirstInBillingDropDown();

            Assert.IsTrue(checkoutPage.BillingButtonIsEnable(), "Proceed to Review and Place Your Order button is not available");

            checkoutPage.BillingSubmitClick();
        }
예제 #6
0
        protected void SetCreditCard(APCheckoutPage checkoutPage)
        {
            PaymentOptionModel paymentOptionModel = new PaymentOptionModel();

            paymentOptionModel.CardNumber     = "4052617213218274";
            paymentOptionModel.ExpirationMont = "05";
            paymentOptionModel.ExpirationYear = "20";
            paymentOptionModel.Cvv            = "649";
            paymentOptionModel.HolderName     = "Holly Smith";
            paymentOptionModel.LastFourDigits = "1293";
            checkoutPage.SetBillingElement(BillingInputs.CardNumber, paymentOptionModel.CardNumber);
            checkoutPage.SetBillingElement(BillingInputs.CVV, paymentOptionModel.Cvv);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationMonth, paymentOptionModel.ExpirationMont);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationYear, paymentOptionModel.ExpirationYear);
            checkoutPage.SetBillingElement(BillingInputs.CardHolderName, paymentOptionModel.HolderName);
        }
예제 #7
0
        public void E2E04()
        {
            APIndexPage indexPage = new APIndexPage(Driver, Url);

            Login(indexPage);

            //Orders
            OrdersHomePage ordersHomePage = indexPage.Header.ClickOnOrders();

            ordersHomePage.SetFromDate("11/01/2019");
            ordersHomePage.SetToDate("12/26/2019");
            ordersHomePage.ClickOnSearchButton();
            //Assert.IsTrue(ordersHomePage.ValidateDatesAreInSearchRange("11/01/2019", "12/26/2019"), "Dates aren't correct");
            OrderDetailsPage orderDetailsPage = ordersHomePage.ClickOnOrderButtonByIndex(0);

            orderDetailsPage.ClickOnReorderButton();
            orderDetailsPage.ClickOnAddToCartButton();
            APCartPage cartPage = orderDetailsPage.Header.ClickOnViewCart();

            cartPage.GetQuantityInput();

            //Edit Payment at Checkout
            APCheckoutPage checkoutPage = cartPage.ProceedToCheckOut();

            checkoutPage.UserInfoIsPopulated();
            AddressModel addressModel = GetAddressModel();

            checkoutPage.SetAddressElement(AddressInputs.StreetAddress, addressModel.street);
            checkoutPage.SetAddressElement(AddressInputs.City, addressModel.city);
            checkoutPage.SetAddressElement(AddressInputs.State, addressModel.state);
            checkoutPage.SetAddressElement(AddressInputs.Postal, addressModel.postal);
            checkoutPage.SetAddressElement(AddressInputs.ATTN, "Tundra Restaurant Supply");
            checkoutPage.NextStep();
            checkoutPage.ClickEditAction(EditActions.SecureBillingInformation);
            checkoutPage.ClickOnAssingNewCard();
            SetCreditCard(checkoutPage);
            checkoutPage.NextStep();
            OrderConfirmationPage orderConfirmationPage = checkoutPage.PlaceOrderSubmitClick();

            orderConfirmationPage.ClickOnContinueShoppingButton(ContinueShoppingButtons.ContinueShopping);
        }
예제 #8
0
        public void Availability_InStock_AddressSelect()
        {
            APIndexPage indexPage = new APIndexPage(Driver, Url);

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            indexPage = loginPage.Login("*****@*****.**", "1234");

            var manufacturesItems = indexPage.Header.GetManufacturerOptions();

            manufacturerOption = manufacturesItems.ElementAtOrDefault(2).webElement.Text;

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            Thread.Sleep(2000);

            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            Thread.Sleep(2000);
            IDictionary <string, string> availabiltyItemsTagPre = checkoutPage.AvailabiltyTagGet();

            Assert.IsNotNull(availabiltyItemsTagPre.FirstOrDefault(t => t.Value.Contains(AvailabiltyConstants.InStock)));

            checkoutPage.SelectAddressRadioButton(AddressSelectOptions.Existing);

            checkoutPage.SelectFirstInAddressDropDown();

            checkoutPage.ShippingSubmitClick();

            IDictionary <string, string> availabiltyItemsTagPos = checkoutPage.AvailabiltyTagGet();

            Assert.IsNotNull(availabiltyItemsTagPos.FirstOrDefault(t => t.Value.Contains(AvailabiltyConstants.InStock)));
        }
예제 #9
0
        public void E2E02()
        {
            APIndexPage indexPage = new APIndexPage(Driver, Url);

            Login(indexPage);

            //Click on a Top Level Category (e.g.Hardware & Supplies)
            CatalogItemsPage catalogItemsPage = indexPage.Header.ClickOnCategory("Hardware & Supplies");

            Assert.IsTrue(catalogItemsPage.CheckIfYourPriceIsDisplayed(), "Your price is not diplayed");

            //Product list views
            catalogItemsPage.AddToCartElementByIndex(0);
            catalogItemsPage.ClickOnListViewIcon();
            catalogItemsPage.AddToCartElementByIndex(2);
            Assert.IsTrue(catalogItemsPage.ListViewDisplayed(), "The product view was not updated to List view(stack view).");

            //Page Navigation
            catalogItemsPage = catalogItemsPage.ClickOnNextPage();
            Assert.AreEqual("2", catalogItemsPage.GetActualPageListNumber(), "The page list number must be '2'.");
            catalogItemsPage.AddToCartElementByIndex(0);
            catalogItemsPage = catalogItemsPage.ClickOnLastPage();
            Assert.AreEqual(catalogItemsPage.GetLastPageListNumber(), catalogItemsPage.GetActualPageListNumber(), "Last page must be diplayed.");
            catalogItemsPage.AddToCartElementByIndex(0);

            //Category Navigation
            catalogItemsPage = catalogItemsPage.ClickOnSubCategory("Buzzers");
            catalogItemsPage.AddToCartFirstItemInCatalog();

            //Cart & Save for Later
            APCartPage cartPage = catalogItemsPage.Header.ClickOnViewCart();

            //Assert.AreEqual(5, cartPage.GetNumberOfItemsInCart(), "Must be 5 items in cart");
            Assert.IsTrue(cartPage.TotalAmountIsCorrect(), "The total amount doesn't reflect the sum of the items total.");
            cartPage.SelectAllItems();
            Assert.AreEqual(cartPage.GetNumberOfItemsInCart(), cartPage.GetNumberOfSelectedItems(), "Not all items were selected.");
            cartPage.MoveSelectedToSaveLater();
            Assert.AreEqual(0, cartPage.GetNumberOfItemsInCart(), "All items must be moved to 'Save for later' tab");
            cartPage.ClickOnSavedForLater();
            cartPage.SelectItemsByIndex(0);
            cartPage.SelectItemsByIndex(1);
            cartPage.SelectItemsByIndex(2);
            cartPage.MoveSelectedToCart();
            cartPage.ClickIndividualMoveToCartByIndex(1);
            cartPage.ClickOnCartTab();
            Assert.AreEqual(4, cartPage.GetNumberOfItemsInCart(), "Number of items in cart must be 4.");
            Assert.IsTrue(cartPage.InventoryAvailabilityIsDisplayed(), "Inventory availability must be displayed.");
            cartPage.SelectItemsByIndex(0);
            cartPage.SelectItemsByIndex(1);
            cartPage.ClickRemoveSelectedItems();
            cartPage.RemoveIndividualItemByIndex(0);
            Assert.AreEqual(1, cartPage.GetNumberOfItemsInCart(), "Number of items in cart must be 1.");

            //Checkout and continue shopping
            APCheckoutPage checkoutPage = cartPage.ProceedToCheckOut();

            checkoutPage.UserInfoIsPopulated();
            AddressModel addressModel = GetAddressModel();

            checkoutPage.SetAddressElement(AddressInputs.StreetAddress, addressModel.street);
            checkoutPage.SetAddressElement(AddressInputs.City, addressModel.city);
            checkoutPage.SetAddressElement(AddressInputs.State, addressModel.state);
            checkoutPage.SetAddressElement(AddressInputs.Postal, addressModel.postal);
            checkoutPage.SetAddressElement(AddressInputs.ATTN, "Tundra Restaurant Supply");
            checkoutPage.NextStep();
            OrderConfirmationPage orderConfirmationPage = checkoutPage.PlaceOrderSubmitClick();

            orderConfirmationPage.ClickOnContinueShoppingButton(ContinueShoppingButtons.ContinueShopping);
        }
예제 #10
0
        public void E2E01()
        {
            //Search & Price
            APIndexPage indexPage = new APIndexPage(Driver, Url);

            indexPage.Header.SetSearchFieldText("103-1035");
            CatalogItemsPage catalogItemsPage = indexPage.Header.ClickOnSearchButton();

            //Add product to the cart from the result page
            Assert.IsTrue(catalogItemsPage.IsListPriceDisplayed(), "There is no numeric price shown.");
            int quantityBeforeAdd = catalogItemsPage.Header.GetMiniCartQuantity();

            catalogItemsPage.AddToCartElementByIndex(0);
            int quantityAfterAdd = catalogItemsPage.Header.GetMiniCartQuantity(quantityBeforeAdd);
            //Assert.IsTrue(quantityAfterAdd > quantityBeforeAdd, "The item quantity did no increment");

            //Click on the product to go to the Product Detail Page
            OfferingProductsPage offeringProductsPage = catalogItemsPage.ClickOnFirstItemInCatalog();

            Assert.IsTrue(offeringProductsPage.ListPriceLabelforANON(), "List price tag not shown.");
            Assert.IsTrue(offeringProductsPage.NumericPriceDisplayed(), "No numeric price diplayed.");
            offeringProductsPage.UpdateAmountQuantity();
            int amountQuantityBeforeAdd = offeringProductsPage.GetAmountQuantity();

            //Add product to the cart from Product Detail Page and click on cart
            offeringProductsPage.AddToCartFirstProduct();
            offeringProductsPage.UpdateAmountQuantity();
            int amountQuantityAfterAdd = offeringProductsPage.GetAmountQuantity();

            Assert.IsTrue(offeringProductsPage.AumontQuantityIncremented(amountQuantityBeforeAdd, amountQuantityAfterAdd),
                          "Quantity did not incremented.");
            APCartPage cartPage = offeringProductsPage.ClickOnCart();

            Assert.AreEqual(1, cartPage.NumberOfItemsInCart(), "Should be just one product in cart.");
            Assert.AreEqual(2, cartPage.GetQuantityInput(), "Quantity must be 2.");

            //Checkout
            cartPage.ProceedToCheckOut();
            APCheckoutPage   checkoutPage     = cartPage.CheckoutAsGuest();
            ContactInfoModel contactInfoModel = new ContactInfoModel();

            contactInfoModel.FirstName   = "Jesus Carlos";
            contactInfoModel.LastName    = "Acosta Rocha";
            contactInfoModel.Email       = "*****@*****.**";
            contactInfoModel.Company     = "Softtek";
            contactInfoModel.PhoneNumber = "6681596072";
            checkoutPage.SetContactElement(ContactInputs.FirstName, contactInfoModel.FirstName);
            checkoutPage.SetContactElement(ContactInputs.LastName, contactInfoModel.LastName);
            checkoutPage.SetContactElement(ContactInputs.Email, contactInfoModel.Email);
            checkoutPage.SetContactElement(ContactInputs.Company, contactInfoModel.Company);
            checkoutPage.SetContactElement(ContactInputs.PhoneNumber, contactInfoModel.PhoneNumber);
            checkoutPage.NextStep();
            AddressModel addressModel = GetAddressModel();

            checkoutPage.SetAddressElement(AddressInputs.StreetAddress, addressModel.street);
            checkoutPage.SetAddressElement(AddressInputs.City, addressModel.city);
            checkoutPage.SetAddressElement(AddressInputs.State, addressModel.state);
            checkoutPage.SetAddressElement(AddressInputs.Postal, addressModel.postal);
            checkoutPage.NextStep();
            SetCreditCard(checkoutPage);
            checkoutPage.NextStep();

            //Confirmation page and continue shopping
            OrderConfirmationPage orderConfirmationPage = checkoutPage.PlaceOrderSubmitClick();

            orderConfirmationPage.ClickOnContinueShoppingButton(ContinueShoppingButtons.PrintOrderConfirmation);
            Assert.AreEqual(2, Driver.WindowHandles.Count, "Printable Order Confirmation Not Shown.");
            Driver.SwitchTo().DefaultContent();
            orderConfirmationPage.ClickOnContinueShoppingButton(ContinueShoppingButtons.ContinueShopping);
        }
예제 #11
0
        public void E2E03()
        {
            //Content
            APIndexPage indexPage = new APIndexPage(Driver, Url);

            Login(indexPage);

            //Shopping lists
            OfferingProductsPage offeringProductsPage = indexPage.ClickOnProductSpotlightDealsByIndex(0);

            offeringProductsPage.ClickOnAddToList();
            Assert.AreEqual(1, offeringProductsPage.AddListModal.GetOptionsFromChooseListModal().Count,
                            "There must be just 1 option.");
            Assert.AreEqual("My List", offeringProductsPage.AddListModal.GetOptionsFromChooseListModal()[0].webElement.Text,
                            "The option must be 'My List'");
            offeringProductsPage.AddListModal.CloseAddToListModal();
            offeringProductsPage.ClickOnAddToList();
            offeringProductsPage.AddListModal.ClickOnAddToListModal();
            offeringProductsPage.AddListModal.IsSuccessMessageInModal();
            offeringProductsPage.AddListModal.CloseAddToListModal();

            //Shopping lists
            offeringProductsPage.ChangeQuantity(2);
            offeringProductsPage.UpdateAmountQuantity();
            int amountQuantityBeforeAdd = offeringProductsPage.GetAmountQuantity();

            offeringProductsPage.AddToCartFirstProduct();
            offeringProductsPage.UpdateAmountQuantity();
            int amountQuantityAfterAdd = offeringProductsPage.GetAmountQuantity();

            Assert.IsTrue(offeringProductsPage.AumontQuantityIncremented(amountQuantityBeforeAdd, amountQuantityAfterAdd),
                          "Quantity did not increment.");
            offeringProductsPage.ScrollToTop();
            offeringProductsPage.WaitForAppBusy(3);
            offeringProductsPage.Header.SetSearchFieldText("Amana");
            CatalogItemsPage catalogItemsPage = offeringProductsPage.Header.ClickOnSearchButton();

            catalogItemsPage.AddToListByIndex(0);
            catalogItemsPage.AddToListByIndex(1);
            catalogItemsPage.AddToListByIndex(2);
            APListSummaryPage listSummaryPage = catalogItemsPage.AddToListByIndex(3, visitList: true);

            Assert.AreEqual(5, listSummaryPage.NumberOfItemsInList(), "Quantity must be 5.");
            listSummaryPage.SelectByIndex(0);
            listSummaryPage.SelectByIndex(1);
            listSummaryPage.ClickOnRemoveSelected();
            Assert.AreEqual(3, listSummaryPage.NumberOfItemsInList(), "Quantity must be 3.");
            listSummaryPage.RemoveIndividualByIndex(0);
            Assert.AreEqual(2, listSummaryPage.NumberOfItemsInList(), "Quantity must be 2.");
            // if different in cart is true, it clicks on a different index
            listSummaryPage.ClickOnAddToCartByIndex(1, differentInCart: true);
            //*******************
            APListHomePage listHomePage = listSummaryPage.ClickOnBreadCrumbLists();

            listHomePage.ClickCreateaNewList();
            listHomePage.SendListName("new list");
            listHomePage.ClickCreateListButton();
            Assert.IsTrue(listHomePage.SuccessListCreated(), "List was not created");
            listHomePage.CloseModal();
            catalogItemsPage = listHomePage.Header.ClickOnCategory("Hardware & Supplies");
            listSummaryPage  = catalogItemsPage.AddToListByIndex(0, visitList: true, list: "new list");
            Assert.AreEqual(1, listSummaryPage.NumberOfItemsInList(), "There must be 1 item.");
            listHomePage = listSummaryPage.ClickOnBreadCrumbLists();
            Assert.AreEqual(2, listHomePage.GetNumberOfLists());

            //Create new payment method at checkout
            APCartPage cartPage = listHomePage.Header.ClickOnViewCart();

            Assert.AreEqual(2, cartPage.GetNumberOfItemsInCart());
            cartPage.GetQuantityInput();
            Assert.IsTrue(cartPage.IsQuantityInCartItem(2), "One of the quantity items must be 1.");
            APCheckoutPage checkoutPage = cartPage.ProceedToCheckOut();

            checkoutPage.UserInfoIsPopulated();
            AddressModel addressModel = GetAddressModel();

            checkoutPage.SetAddressElement(AddressInputs.StreetAddress, addressModel.street);
            checkoutPage.SetAddressElement(AddressInputs.City, addressModel.city);
            checkoutPage.SetAddressElement(AddressInputs.State, addressModel.state);
            checkoutPage.SetAddressElement(AddressInputs.Postal, addressModel.postal);
            checkoutPage.SetAddressElement(AddressInputs.ATTN, "Tundra Restaurant Supply");
            checkoutPage.NextStep();
            checkoutPage.ClickEditAction(EditActions.SecureBillingInformation);
            checkoutPage.ClickOnAssingNewCard();
            SetCreditCard(checkoutPage);
            checkoutPage.NextStep();
            OrderConfirmationPage orderConfirmationPage = checkoutPage.PlaceOrderSubmitClick();

            orderConfirmationPage.ClickOnContinueShoppingButton(ContinueShoppingButtons.ContinueShopping);
        }
예제 #12
0
        public void E2ETestwithContactInfoandAddressUser()
        {
            var indexPage = new APIndexPage(Driver, Url);

            //TODO
            //use a datafactory tool instead csv (checkout.csv)
            var testData = new
            {
                country      = "Country",
                countryShort = "CountryShort",
                address      = "StreetAddress",
                state        = "State",
                city         = "City",
                zipCode      = "ZipCode",
                apt          = "Apt",
                firstname    = "FirstName",
                lastname     = "LastName",
                company      = "Company",
                phonenumber  = "PhoneNumber",
                attn         = "ATTN",
            };

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            indexPage = loginPage.Login("test", "1234");

            manufacturerOption = indexPage.Header.GetManufacturerDropdownOptions().ElementAtOrDefault(2);

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            //Waiting For Loading Cart
            Thread.Sleep(7000);

            //Click no Proceed to checkout button
            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            Thread.Sleep(5000);

            checkoutPage.SelectAddressRadioButton(AddressSelectOptions.Existing);

            Thread.Sleep(5000);

            checkoutPage.SelectFirstInAddressDropDown();

            checkoutPage.ClickShippingButton();

            Thread.Sleep(5000);

            PaymentOptionModel cardToken = new PaymentOptionModel
            {
                CardNumber     = "4111111111111111",
                ExpirationMont = "12",
                ExpirationYear = "24",
                HolderName     = "Test corp",
                Cvv            = "077"
            };

            checkoutPage.SetBillingElement(BillingInputs.CardHolderName, cardToken.HolderName);
            checkoutPage.SetBillingElement(BillingInputs.CardNumber, cardToken.CardNumber);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationMonth, cardToken.ExpirationMont);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationYear, cardToken.ExpirationYear);
            checkoutPage.SetBillingElement(BillingInputs.CVV, cardToken.Cvv);

            Thread.Sleep(5000);

            checkoutPage.SelectFirstInBillingDropDown();

            Assert.IsTrue(checkoutPage.BillingButtonIsEnable(), "Proceed to Review and Place Your Order button is not available");

            Thread.Sleep(5000);

            checkoutPage.BillingSubmitClick();

            Assert.IsTrue(checkoutPage.PlaceOrderButtonIsEnable(), "Place Your Order button is not available");

            Thread.Sleep(5000);

            OrderConfirmationPage orderpage = checkoutPage.PlaceOrderSubmitClick();

            Assert.IsTrue(checkoutPage.OrderConfirmationText(), "Order Confirmation text is not available");
        }
예제 #13
0
        public void OrderConfirmationAUTH_()
        {
            var indexPage = new APIndexPage(Driver, Url);

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            //TODO
            //implement data factory here
            indexPage = loginPage.Login("", "");

            var manufacturesItems = indexPage.Header.GetManufacturerOptions();

            manufacturerOption = manufacturesItems.ElementAtOrDefault(2).webElement.Text;

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            //Waiting For Loading Cart
            Thread.Sleep(5000);

            //Click on Proceed to checkout button
            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            Thread.Sleep(5000);

            checkoutPage.SelectAddressRadioButton(AddressSelectOptions.Existing);

            checkoutPage.ClickShippingButton();

            Thread.Sleep(5000);

            PaymentOptionModel cardToken = new PaymentOptionModel
            {
                CardNumber     = "4111111111111111",
                ExpirationMont = "12",
                ExpirationYear = "24",
                HolderName     = "Test corp",
                Cvv            = "077"
            };

            checkoutPage.SetBillingElement(BillingInputs.CardHolderName, cardToken.HolderName);
            checkoutPage.SetBillingElement(BillingInputs.CardNumber, cardToken.CardNumber);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationMonth, cardToken.ExpirationMont);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationYear, cardToken.ExpirationYear);
            checkoutPage.SetBillingElement(BillingInputs.CVV, cardToken.Cvv);

            Assert.IsTrue(checkoutPage.BillingButtonIsEnable(), "Proceed to Review and Place Your Order button is not available");

            checkoutPage.BillingSubmitClick();

            Thread.Sleep(2000);

            Assert.IsTrue(checkoutPage.PlaceOrderButtonIsEnable(), "Place Your Order button is not available");

            Thread.Sleep(2000);

            checkoutPage.PlaceOrderSubmitClick();

            Thread.Sleep(2000);

            Assert.IsTrue(checkoutPage.OrderConfirmationText(), "Order Confirmation text is not available");

            Thread.Sleep(2000);

            Assert.IsTrue(checkoutPage.SuccessText(), "Success text is not available");
        }
예제 #14
0
        public void APCheckoutPageANON_T6208()
        {
            var indexPage = new APIndexPage(Driver, Url);

            var testData = new
            {
                email        = (string)TestContext.DataRow["Email"],
                pwd          = TestContext.DataRow["Password"].ToString(),
                country      = (string)TestContext.DataRow["Country"],
                countryShort = (string)TestContext.DataRow["CountryShort"],
                address      = (string)TestContext.DataRow["StreetAddress"],
                state        = (string)TestContext.DataRow["State"],
                city         = (string)TestContext.DataRow["City"],
                zipCode      = TestContext.DataRow["ZipCode"].ToString(),
                apt          = TestContext.DataRow["Apt"].ToString(),
                firstname    = (string)TestContext.DataRow["FirstName"],
                lastname     = (string)TestContext.DataRow["LastName"],
                company      = (string)TestContext.DataRow["Company"],
                phonenumber  = TestContext.DataRow["PhoneNumber"].ToString(),
                attn         = TestContext.DataRow["ATTN"].ToString(),
            };

            var manufacturesItems = indexPage.Header.GetManufacturerOptions();

            manufacturerOption = manufacturesItems.ElementAtOrDefault(2).webElement.Text;

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            //Waiting For Loading Cart
            Thread.Sleep(5000);

            //Click no Proceed to checkout button
            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            //Redirected to Login Page
            Assert.IsNull(checkoutPage);

            //Click on Proceed as Guest
            APLoginPage loginPage = new APLoginPage(Driver);

            checkoutPage = loginPage.clickOnGuestbutton();

            //Wait for loading checkout
            Thread.Sleep(3000);

            checkoutPage.SetContactElement(ContactInputs.FirstName, testData.firstname);

            checkoutPage.SetContactElement(ContactInputs.LastName, testData.lastname);

            checkoutPage.SetContactElement(ContactInputs.PhoneNumber, testData.phonenumber);

            checkoutPage.SetContactElement(ContactInputs.Email, testData.email);

            Assert.IsTrue(checkoutPage.ContactButtonIsEnable(), "Proceed to Shipping Information button is not available");

            checkoutPage.ContactSubmitClick();

            checkoutPage.WaitForAppBusy();

            checkoutPage.SetAddressElement(AddressInputs.ATTN, testData.attn);

            checkoutPage.SetAddressElement(AddressInputs.StreetAddress, testData.address);

            checkoutPage.SetAddressElement(AddressInputs.Apt, testData.apt);

            checkoutPage.SetAddressElement(AddressInputs.City, testData.city);

            checkoutPage.SetAddressElement(AddressInputs.State, testData.state);

            checkoutPage.SetAddressElement(AddressInputs.Postal, testData.zipCode);

            Assert.IsTrue(checkoutPage.ShippingButtonIsEnable(), "Proceed to Secure Billing button is not available");

            checkoutPage.ShippingSubmitClick();
        }
예제 #15
0
        public void GoogleTypeAheadAUTH_T6208()
        {
            var indexPage = new APIndexPage(Driver, Url);

            var testData = new
            {
                email        = (string)TestContext.DataRow["Email"],
                password     = TestContext.DataRow["Password"].ToString(),
                country      = (string)TestContext.DataRow["Country"],
                countryShort = (string)TestContext.DataRow["CountryShort"],
                address      = (string)TestContext.DataRow["StreetAddress"],
                state        = (string)TestContext.DataRow["State"],
                city         = (string)TestContext.DataRow["City"],
                zipCode      = TestContext.DataRow["ZipCode"].ToString(),
                apt          = TestContext.DataRow["Apt"].ToString(),
                firstname    = (string)TestContext.DataRow["FirstName"],
                lastname     = (string)TestContext.DataRow["LastName"],
                company      = (string)TestContext.DataRow["Company"],
                phonenumber  = TestContext.DataRow["PhoneNumber"].ToString(),
                attn         = TestContext.DataRow["ATTN"].ToString(),
            };

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            indexPage = loginPage.Login(testData.email, testData.password);

            var manufacturesItems = indexPage.Header.GetManufacturerOptions();

            manufacturerOption = manufacturesItems.ElementAtOrDefault(2).webElement.Text;

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            //Waiting For Loading Cart
            Thread.Sleep(5000);

            //Click no Proceed to checkout button
            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            Thread.Sleep(5000);

            checkoutPage.SelectAddressRadioButton(AddressSelectOptions.New);

            checkoutPage.SetAddressElement(AddressInputs.ATTN, testData.attn);

            checkoutPage.SetAddressElement(AddressInputs.StreetAddress, testData.address);

            checkoutPage.SetAddressElement(AddressInputs.Apt, testData.apt);

            checkoutPage.SetAddressElement(AddressInputs.City, testData.city);

            checkoutPage.SetAddressElement(AddressInputs.State, testData.state);

            checkoutPage.SetAddressElement(AddressInputs.Postal, testData.zipCode);

            Assert.IsTrue(checkoutPage.ShippingButtonIsEnable(), "Proceed to Secure Billing button is not available");
        }
예제 #16
0
        public void OnlyPaymentMethodAdded()
        {
            var indexPage = new APIndexPage(Driver, Url);

            var testData = new
            {
                //Make sure to change name of email
                user = dataFactory.CreateLoginAccount(),
            };

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            indexPage = loginPage.Login(testData.user.Email, testData.user.Password);

            indexPage.Header.SelectManufacturer(manufacturerOption);

            indexPage.Header.SetSearchFieldText(searchField);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            Thread.Sleep(2000);

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            //Waiting For Loading Cart
            Thread.Sleep(7000);

            //Click no Proceed to checkout button
            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            Thread.Sleep(5000);

            checkoutPage.SetAddressElement(AddressInputs.ATTN, "CompanyOrName");
            checkoutPage.SetAddressElement(AddressInputs.StreetAddress, "123 Massachusetts Avenue");
            checkoutPage.SetAddressElement(AddressInputs.Apt, "12345");
            checkoutPage.SetAddressElement(AddressInputs.City, "Cambridge");
            checkoutPage.SetAddressElement(AddressInputs.State, "MA");
            checkoutPage.SetAddressElement(AddressInputs.Postal, "02138");

            checkoutPage.ClickShippingButton();

            //Thread.Sleep(2000);

            Thread.Sleep(5000);

            checkoutPage.SelectBillingRadioButton(BillingSelectOptions.New);

            PaymentOptionModel cardToken = new PaymentOptionModel
            {
                CardNumber     = "4111111111111111",
                ExpirationMont = "12",
                ExpirationYear = "24",
                HolderName     = "Test corp",
                Cvv            = "077"
            };

            checkoutPage.SetBillingElement(BillingInputs.CardHolderName, cardToken.HolderName);
            checkoutPage.SetBillingElement(BillingInputs.CardNumber, cardToken.CardNumber);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationMonth, cardToken.ExpirationMont);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationYear, cardToken.ExpirationYear);
            checkoutPage.SetBillingElement(BillingInputs.CVV, cardToken.Cvv);

            Thread.Sleep(2000);

            Assert.IsTrue(checkoutPage.BillingButtonIsEnable(), "Proceed to Review and Place Your Order button is not available");

            checkoutPage.BillingSubmitClick();

            Thread.Sleep(3000);

            Assert.IsTrue(checkoutPage.PlaceOrderButtonIsEnable(), "Place Your Order button is not available");

            Thread.Sleep(5000);

            OrderConfirmationPage orderpage = checkoutPage.PlaceOrderSubmitClick();

            Assert.IsTrue(checkoutPage.OrderConfirmationText(), "Order Confirmation text is not available");
        }
예제 #17
0
        public void OnlyContactInformationadded()
        {
            var indexPage = new APIndexPage(Driver, Url);

            var testData = new
            {
                //Make sure to change name of email
                user = dataFactory.CreateLoginAccount(),
            };

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            indexPage = loginPage.Login(testData.user.Email, testData.user.Password);

            indexPage.Header.SelectManufacturer(manufacturerOption);

            indexPage.Header.SetSearchFieldText(searchField);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            //Waiting For Loading Cart
            Thread.Sleep(7000);

            //Click no Proceed to checkout button
            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            Thread.Sleep(5000);

            checkoutPage.SelectAddressRadioButton(AddressSelectOptions.Existing);

            Thread.Sleep(5000);

            checkoutPage.SelectFirstInAddressDropDown();

            checkoutPage.ClickShippingButton();

            Thread.Sleep(5000);

            PaymentOptionModel cardToken = new PaymentOptionModel
            {
                CardNumber     = "4111111111111111",
                ExpirationMont = "12",
                ExpirationYear = "24",
                HolderName     = "Test corp",
                Cvv            = "077"
            };

            checkoutPage.SetBillingElement(BillingInputs.CardHolderName, cardToken.HolderName);
            checkoutPage.SetBillingElement(BillingInputs.CardNumber, cardToken.CardNumber);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationMonth, cardToken.ExpirationMont);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationYear, cardToken.ExpirationYear);
            checkoutPage.SetBillingElement(BillingInputs.CVV, cardToken.Cvv);

            Thread.Sleep(5000);

            checkoutPage.SelectFirstInBillingDropDown();

            Assert.IsTrue(checkoutPage.BillingButtonIsEnable(), "Proceed to Review and Place Your Order button is not available");

            Thread.Sleep(5000);

            checkoutPage.BillingSubmitClick();

            Assert.IsTrue(checkoutPage.PlaceOrderButtonIsEnable(), "Place Your Order button is not available");

            Thread.Sleep(5000);

            OrderConfirmationPage orderpage = checkoutPage.PlaceOrderSubmitClick();

            Assert.IsTrue(checkoutPage.OrderConfirmationText(), "Order Confirmation text is not available");
        }
예제 #18
0
        public void AddAddressChecktoutoMyAccount()
        {
            var indexPage = new APIndexPage(Driver, Url);

            //TODO
            //use a datafactory tool instead csv (shipping.csv)
            var testData = new
            {
                country      = "Country",
                countryShort = "CountryShort",
                address      = "StreetAddress",
                state        = "State",
                city         = "City",
                zipCode      = "ZipCode",
                apt          = "Apt",
                firstname    = "FirstName",
                lastname     = "LastName",
                company      = "Company",
                phonenumber  = "PhoneNumber",
                attn         = "ATTN"
            };

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            indexPage = loginPage.Login("test", "1234");


            manufacturerOption = indexPage.Header.GetManufacturerDropdownOptions().ElementAtOrDefault(2);

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            catalogItemPage.AddtoCartbuttonInCatalog();

            Thread.Sleep(5000);

            APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart();

            //Waiting For Loading Cart
            Thread.Sleep(7000);

            //Click no Proceed to checkout button
            APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            Thread.Sleep(5000);

            //checkoutPage.SelectAddressRadioButton(AddressSelectOptions.New);

            Thread.Sleep(5000);

            checkoutPage.SetAddressElement(AddressInputs.ATTN, testData.attn);

            checkoutPage.SetAddressElement(AddressInputs.StreetAddress, testData.address);

            checkoutPage.SetAddressElement(AddressInputs.Apt, testData.apt);

            checkoutPage.SetAddressElement(AddressInputs.City, testData.city);

            checkoutPage.SetAddressElement(AddressInputs.State, testData.state);

            checkoutPage.SetAddressElement(AddressInputs.Postal, testData.zipCode);

            checkoutPage.ClickShippingButton();

            Thread.Sleep(5000);

            //checkoutPage.SelectBillingRadioButton(BillingSelectOptions.Existing);
            PaymentOptionModel cardToken = new PaymentOptionModel
            {
                CardNumber     = "4111111111111111",
                ExpirationMont = "12",
                ExpirationYear = "24",
                HolderName     = "Test corp",
                Cvv            = "077"
            };

            checkoutPage.SetBillingElement(BillingInputs.CardHolderName, cardToken.HolderName);
            checkoutPage.SetBillingElement(BillingInputs.CardNumber, cardToken.CardNumber);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationMonth, cardToken.ExpirationMont);
            checkoutPage.SetBillingElement(BillingInputs.ExpirationYear, cardToken.ExpirationYear);
            checkoutPage.SetBillingElement(BillingInputs.CVV, cardToken.Cvv);

            Thread.Sleep(5000);

            checkoutPage.SelectFirstInBillingDropDown();

            Assert.IsTrue(checkoutPage.BillingButtonIsEnable(), "Proceed to Review and Place Your Order button is not available");

            Thread.Sleep(5000);

            checkoutPage.BillingSubmitClick();

            Assert.IsTrue(checkoutPage.PlaceOrderButtonIsEnable(), "Place Your Order button is not available");

            Thread.Sleep(5000);

            //checkoutPage.PlaceOrderSubmitClick();
            OrderConfirmationPage orderpage = checkoutPage.PlaceOrderSubmitClick();

            Assert.IsTrue(checkoutPage.OrderConfirmationText(), "Order Confirmation text is not available");

            //APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut();

            indexPage = orderpage.ContinueShoppingClick();

            //AddressesHomePage addresspage = indexPage.Header.ClickOnAddresses();

            //var dropdownItems = addresspage.GetAddressesDropdownItems(AccessLevel.User).ToList();

            ////just created address data
            //string createdAddress = string.IsNullOrEmpty(testData.apt) ?
            //    $"{testData.address}, {testData.city} {testData.countryShort} {testData.zipCode}"
            //    :
            //    $"{testData.address}, {testData.apt}, {testData.city} {testData.countryShort} {testData.zipCode}";

            ////search the address in the user level dropdown
            //string expectedAddress = dropdownItems.FirstOrDefault(x => x.Contains(createdAddress));

            //Assert.IsNotNull(expectedAddress, "Address is not found in dropdown");
        }