コード例 #1
0
        //[TestCategory(TestCategoriesConstants.NoTestData)]
        public void ValidateListPriceLabelforANON()
        {
            var indexPage = new IndexPage(driver, url);

            var manufacturesItems = indexPage.Header.GetManufacturerOptions();

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

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            var offeringProductpage = catalogItemPage.ClickOnFirstItemInCatalog();

            offeringProductpage.ListPriceLabelforANON();
        }
コード例 #2
0
        public void ValidateMergeCart()
        {
            var indexPage = new IndexPage(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(),
            };

            var manufacturesItems = indexPage.Header.GetManufacturerOptions();

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

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            var offeringProductpage = catalogItemPage.ClickOnFirstItemInCatalog();

            offeringProductpage.AddtoCartInOffering();

            Thread.Sleep(2000);

            LoginPage loginPage = offeringProductpage.ClickOnSignInOffering();

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

            Thread.Sleep(2000);

            offeringProductpage.SavingsMsgDisplayed();

            offeringProductpage.YourPriceLabelforAUTH();
        }
コード例 #3
0
        public void ValidateProductSectionsQUTH()
        {
            var indexPage = new IndexPage(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(),
            };

            LoginPage 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();

            var offeringProductpage = catalogItemPage.ClickOnFirstItemInCatalog();

            offeringProductpage.ShippingInfoSectionAvailable();

            //offeringProductpage.AvailabilityInfo();

            offeringProductpage.DescriptionAvailableSection();

            offeringProductpage.SpecificationsSection();
        }
コード例 #4
0
        public void ValidateMergeCart()
        {
            var indexPage = new APIndexPage(Driver, Url);

            var testData = new
            {
                email        = "Email",
                password     = "******",
                country      = "Country",
                countryShort = "CountryShort",
                address      = "StreetAddress",
                state        = "State",
                city         = "City",
                zipCode      = "ZipCode",
                apt          = "Apt",
                firstname    = "FirstName",
                lastname     = "LastName",
                company      = "Company",
                phonenumber  = "PhoneNumber",
                attn         = "ATTN",
            };

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

            indexPage.Header.SelectManufacturer(manufacturerOption);

            CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton();

            var offeringProductpage = catalogItemPage.ClickOnFirstItemInCatalog();

            offeringProductpage.AddtoCartInOffering();

            Thread.Sleep(2000);

            APLoginPage loginPage = offeringProductpage.ClickOnSignInOffering();

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

            Thread.Sleep(2000);

            offeringProductpage.SavingsMsgDisplayed();

            offeringProductpage.YourPriceLabelforAUTH();
        }
コード例 #5
0
        public void ValidateAddToCartinOffering()
        {
            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();

            var offeringProductpage = catalogItemPage.ClickOnFirstItemInCatalog();

            offeringProductpage.AddtoCartInOffering();
        }
コード例 #6
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);
        }