Adds SFRA 6.0
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
const { data, accountPage } = inject();
|
||||
|
||||
Then('shopper clicks add new address', () => {
|
||||
accountPage.clickAddAddress();
|
||||
});
|
||||
|
||||
Then('shopper fills out address information', () => {
|
||||
accountPage.addAddress(data.account.addressTitle, data.checkout.fName, data.checkout.lName, data.checkout.address1,
|
||||
data.checkout.country, data.checkout.state, data.checkout.city, data.checkout.zip, data.login.phone);
|
||||
});
|
@@ -0,0 +1,17 @@
|
||||
const { data, accountPage } = inject();
|
||||
|
||||
Then('shopper clicks add new payment', () => {
|
||||
accountPage.clickAddPayment();
|
||||
});
|
||||
|
||||
Then('shopper fills out their payment information', () => {
|
||||
accountPage.addPayment(data.account.name, data.checkout.ccNum, data.checkout.expMonth, data.checkout.expYear);
|
||||
});
|
||||
|
||||
Then('shopper clicks view payments', () => {
|
||||
accountPage.viewAllPayments();
|
||||
});
|
||||
|
||||
Then('shopper removes a saved credit card', () => {
|
||||
accountPage.removePayment(data.account.deletePaymentModalText);
|
||||
});
|
@@ -0,0 +1,9 @@
|
||||
const { data, accountPage } = inject();
|
||||
|
||||
Then('shopper clicks edit password', () => {
|
||||
accountPage.clickEditPassword();
|
||||
});
|
||||
|
||||
Then('shopper changes their password', () => {
|
||||
accountPage.changePassword(data.login.password, data.account.newPassword);
|
||||
});
|
@@ -0,0 +1,9 @@
|
||||
const { data, accountPage } = inject();
|
||||
|
||||
Then('shopper clicks edit profile', () => {
|
||||
accountPage.clickEditProfile();
|
||||
});
|
||||
|
||||
Then('shopper edits phone number', () => {
|
||||
accountPage.editProfile(data.login.phone, data.login.email, data.login.password);
|
||||
});
|
@@ -0,0 +1,10 @@
|
||||
const { cartPage, productPage, data } = inject();
|
||||
|
||||
Then('shopper edits products in cart', () => {
|
||||
productPage.viewCart();
|
||||
cartPage.verifyCartQuantity(+data.product.quantity + +data.product2.quantity);
|
||||
cartPage.removeProduct(data.product2.name);
|
||||
cartPage.verifyCart(data.product.quantity, data.product.itemPrice, data.product.totalItemPrice,
|
||||
data.product.shipping, data.product.tax, data.product.estimatedTotal);
|
||||
cartPage.editQuantity(data.product.editCartQuantity);
|
||||
});
|
@@ -0,0 +1,56 @@
|
||||
const { I, data, homePage, productPage, cartPage, checkoutPage } = inject();
|
||||
let product;
|
||||
|
||||
Given('Shopper searches for {string}', (inputProduct) => {
|
||||
product = inputProduct;
|
||||
homePage.search(product);
|
||||
});
|
||||
|
||||
When('selects size {string}', (size) => {
|
||||
productPage.selectSize(size);
|
||||
});
|
||||
|
||||
When('shopper changes product quantity', () => {
|
||||
productPage.selectQuantity(data.product.quantity);
|
||||
});
|
||||
|
||||
When('he adds the product to cart', async () => {
|
||||
I.wait(1);
|
||||
productPage.addToCart();
|
||||
});
|
||||
|
||||
Then('he is able to see the correct product in cart', () => {
|
||||
productPage.viewCart();
|
||||
I.see(product, cartPage.locators.lineItemName);
|
||||
cartPage.verifyCart(data.product.quantity, data.product.itemPrice, data.product.totalItemPrice,
|
||||
data.product.shipping, data.product.tax, data.product.estimatedTotal);
|
||||
});
|
||||
|
||||
When('shopper is able to add and remove a product from minicart', () => {
|
||||
homePage.search(data.product4.searchWord);
|
||||
productPage.addProductToMiniCart(data.product4);
|
||||
cartPage.removeProductFromMiniCart(data.product4);
|
||||
I.see(data.product4.afterRemoveQuantity, cartPage.locators.miniCartQuantity);
|
||||
});
|
||||
|
||||
Then('shopper is able to add a product and edit product quantity in minicart', () => {
|
||||
homePage.search(data.product4.searchWord);
|
||||
productPage.addProductToMiniCart(data.product4);
|
||||
cartPage.verifyMiniCartOriginal(data.product4);
|
||||
cartPage.editMiniCartQuantity(data.product4);
|
||||
cartPage.verifyMiniCartUpdated(data.product4);
|
||||
});
|
||||
|
||||
Then('shopper is able to navigate through minicart, registered checkout pages and remove the product from cart', () => {
|
||||
productPage.clickCheckoutBtnOnMiniCart();
|
||||
let locator = locate(checkoutPage.locators.checkoutStage).withAttr({ 'data-customer-type': 'registered' });
|
||||
I.seeElement(locator);
|
||||
checkoutPage.gotoHomePageFromCheckout();
|
||||
cartPage.removeProductFromMiniCart(data.product4);
|
||||
I.see(data.product4.afterRemoveQuantity, cartPage.locators.miniCartQuantity);
|
||||
});
|
||||
|
||||
Then('shopper goes to Guest Checkout page from minicart', () => {
|
||||
productPage.clickCheckoutBtnOnMiniCart();
|
||||
I.seeElement(checkoutPage.locators.checkoutAsGuestBtn);
|
||||
});
|
@@ -0,0 +1,12 @@
|
||||
const { I, data, homePage } = inject();
|
||||
|
||||
Then('shopper enters email in signup form', () => {
|
||||
I.scrollPageToBottom();
|
||||
homePage.subscribeList(data.home.email);
|
||||
});
|
||||
|
||||
Then('shopper subscribes to the email list', () => {
|
||||
I.click(homePage.locators.subscribeButton);
|
||||
I.waitForElement(homePage.locators.emailSignup);
|
||||
I.see('Email Signup successful');
|
||||
});
|
@@ -0,0 +1,6 @@
|
||||
const { I, data, homePage } = inject();
|
||||
|
||||
When('shopper selects yes or no for tracking consent', () => {
|
||||
I.amOnPage(data.login.homePage);
|
||||
homePage.accept();
|
||||
});
|
@@ -0,0 +1,15 @@
|
||||
const { I, data, homePage } = inject();
|
||||
|
||||
Then('shopper goes to store locator page', () => {
|
||||
I.amOnPage(data.storeLocator.pageURL);
|
||||
});
|
||||
|
||||
Then('shopper searches for a store', () => {
|
||||
homePage.searchForStore(data.storeLocator.zipCode);
|
||||
homePage.verifyStoreResults(data.storeLocator.numStores);
|
||||
});
|
||||
|
||||
Then('shopper searches for a store with different radius', () => {
|
||||
homePage.changeStoreRadius(data.storeLocator.radius);
|
||||
homePage.verifyStoreResults(data.storeLocator.numStoresRadius);
|
||||
});
|
@@ -0,0 +1,26 @@
|
||||
const { I, data, loginPage } = inject();
|
||||
|
||||
Then('shopper is able to click tab to create account', () => {
|
||||
I.click(loginPage.locators.createAccount);
|
||||
});
|
||||
|
||||
Then('shopper is able fill out registration information with new email', () => {
|
||||
loginPage.createAccount(data.login.fName, data.login.lName, data.login.phone, data.login.newRegEmail, data.login.password);
|
||||
});
|
||||
|
||||
Then('shopper is able fill out registration information with existing email', () => {
|
||||
loginPage.createAccount(data.login.fName, data.login.lName, data.login.phone, data.login.email, data.login.password);
|
||||
});
|
||||
|
||||
Then('shopper is able to click the create account button', () => {
|
||||
I.click(locate(loginPage.locators.primaryButton).withText('Create Account'));
|
||||
// TODO If you see an error then we'll know it's good, but it's also good if you see a dashboard
|
||||
});
|
||||
|
||||
Then('shopper sees a username is invalid error', () => {
|
||||
I.see(data.login.registrationError);
|
||||
});
|
||||
|
||||
Then('shopper does not see a username is invalid error', () => {
|
||||
I.dontSee(data.login.registrationError);
|
||||
});
|
@@ -0,0 +1,14 @@
|
||||
const { I, data, loginPage } = inject();
|
||||
|
||||
When('shopper clicks forgot password', () => {
|
||||
I.waitForElement(loginPage.locators.forgotPassword);
|
||||
I.click(loginPage.locators.forgotPassword);
|
||||
});
|
||||
|
||||
When('shopper fills out their recovery email address', () => {
|
||||
loginPage.forgotPassword(data.home.email);
|
||||
});
|
||||
|
||||
Then('shopper should see request to change password prompt', () => {
|
||||
loginPage.verifyPasswordReset();
|
||||
});
|
@@ -0,0 +1,43 @@
|
||||
const { I, data, homePage, loginPage } = inject();
|
||||
|
||||
// For going to the login landing page
|
||||
Given('shopper goes to the Login Page', () => {
|
||||
I.amOnPage(data.login.homePage);
|
||||
homePage.accept();
|
||||
I.amOnPage(data.login.loginPage);
|
||||
});
|
||||
|
||||
// For going to the login landing page and signing in
|
||||
Then('shopper logs into the website', () => {
|
||||
I.amOnPage(data.login.homePage);
|
||||
homePage.accept();
|
||||
I.amOnPage(data.login.loginPage);
|
||||
loginPage.login(data.login.email, data.login.password);
|
||||
});
|
||||
|
||||
Given('shopper logs into the website on phone', () => {
|
||||
I.amOnPage(data.login.homePage);
|
||||
homePage.accept();
|
||||
|
||||
I.seeElement(loginPage.locators.hamburgerLogin);
|
||||
I.click(loginPage.locators.hamburgerLogin);
|
||||
|
||||
let locator = locate(loginPage.locators.loginBtn)
|
||||
.withChild(loginPage.locators.loginBtnLink);
|
||||
I.waitForElement(locator);
|
||||
I.click(locator);
|
||||
|
||||
loginPage.login(data.login.email, data.login.password);
|
||||
});
|
||||
|
||||
Given('shopper logs into the website on tablet', () => {
|
||||
I.amOnPage(data.login.homePage);
|
||||
homePage.accept();
|
||||
|
||||
let locator = locate(loginPage.locators.loginBtn)
|
||||
.withChild(loginPage.locators.loginBtnLink);
|
||||
I.waitForElement(locator);
|
||||
I.click(locator);
|
||||
|
||||
loginPage.login(data.login.email, data.login.password);
|
||||
});
|
@@ -0,0 +1,23 @@
|
||||
const { I, data, pageDesigner } = inject();
|
||||
|
||||
Then('shopper should see the campaign banner', () => {
|
||||
I.waitForElement(pageDesigner.locators.campaignBanner);
|
||||
I.seeElement(pageDesigner.locators.campaignBannerMessage);
|
||||
});
|
||||
|
||||
Then('shopper should see the campaign banner message', () => {
|
||||
I.see(data.pageDesigner.campaignBannerMessage, pageDesigner.locators.campaignBannerMessage);
|
||||
});
|
||||
|
||||
|
||||
Then('shopper should see a close button on campaign banner', () => {
|
||||
I.seeElement(pageDesigner.locators.campaignBannerCloseButton);
|
||||
});
|
||||
|
||||
Then('shopper should be able to close the campaign banner', () => {
|
||||
I.click(pageDesigner.locators.campaignBannerCloseButton);
|
||||
});
|
||||
|
||||
Then('shopper should no longer see the campaign banner', () => {
|
||||
I.dontSeeElement(pageDesigner.locators.campaignBanner);
|
||||
});
|
@@ -0,0 +1,40 @@
|
||||
const { data, pageDesigner } = inject();
|
||||
|
||||
When('Shopper sees the carousel {string}', (position) => {
|
||||
var carouselPosition = position;
|
||||
pageDesigner.seeCarousel(carouselPosition);
|
||||
});
|
||||
|
||||
Given('Shopper sees carousel controls in carousel {string}', (position) => {
|
||||
var carouselPosition = position;
|
||||
pageDesigner.controlsVisible(carouselPosition);
|
||||
});
|
||||
|
||||
Then('Shopper should see the next slide in the first carousel', () => {
|
||||
pageDesigner.verifySlide(1, data.pageDesigner.mainBannerHeading2, pageDesigner.locators.mainBannerHeading);
|
||||
});
|
||||
|
||||
When('Shopper clicks previous in carousel {string}', (position) => {
|
||||
var carouselPosition = position;
|
||||
pageDesigner.carouselControlClick(carouselPosition, pageDesigner.locators.carouselPrevious);
|
||||
});
|
||||
|
||||
Then('Shopper should see the previous slide in the first carousel', () => {
|
||||
pageDesigner.verifySlide(1, data.pageDesigner.mainBannerHeading, pageDesigner.locators.mainBannerHeading);
|
||||
});
|
||||
|
||||
When('Shopper clicks next in carousel {string} {int} time(s)', (position, clicks) => {
|
||||
var carouselPosition = position;
|
||||
var carouselClicks = clicks;
|
||||
for (var i = 0; i < carouselClicks; i++) {
|
||||
pageDesigner.carouselControlClick(carouselPosition, pageDesigner.locators.carouselNext);
|
||||
}
|
||||
});
|
||||
|
||||
Then('Shopper should see next product in the second carousel', () => {
|
||||
pageDesigner.verifySlide(2, data.pageDesigner.productTileProductName, '.product-name-link');
|
||||
});
|
||||
|
||||
Then('Shopper should see previous slide in the second carousel', () => {
|
||||
pageDesigner.verifySlide(2, data.pageDesigner.productTileProductName5, '.product-name-link');
|
||||
});
|
@@ -0,0 +1,16 @@
|
||||
const { I, data, pageDesigner } = inject();
|
||||
|
||||
Then('shopper should see the category components', () => {
|
||||
I.seeElement('.experience-commerce_assets-category .shop-category-label');
|
||||
let el = locate('.experience-commerce_assets-category').at(1);
|
||||
|
||||
I.see(data.pageDesigner.category1, el);
|
||||
I.see(data.pageDesigner.category2, el);
|
||||
I.see(data.pageDesigner.category3, el);
|
||||
I.see(data.pageDesigner.category4, el);
|
||||
I.see(data.pageDesigner.category5, el);
|
||||
});
|
||||
|
||||
Then('shopper can click on a category link', () => {
|
||||
pageDesigner.clickPopulareCategory(1, '.shop-category-label', data.pageDesigner.categoryLink);
|
||||
});
|
@@ -0,0 +1,17 @@
|
||||
const { I, data, pageDesigner, utilities } = inject();
|
||||
|
||||
Then('shopper should see the image and text component', () => {
|
||||
I.waitForElement(pageDesigner.locators.ITC);
|
||||
I.seeElement(pageDesigner.locators.ITC);
|
||||
});
|
||||
|
||||
Then('shopper should see the overlay message', () => {
|
||||
let ITCElement = locate(pageDesigner.locators.ITC).at(1);
|
||||
let overlayText = ITCElement.find(pageDesigner.locators.ITCOverlay);
|
||||
I.see(data.pageDesigner.imageAndTextOverlayText, overlayText);
|
||||
});
|
||||
|
||||
Then('shopper should go to new arrivals page clicking on the image', () => {
|
||||
utilities.clickToLoadPage(pageDesigner.locators.ITCImageLink, data.pageDesigner.imageAndTextNewArrival);
|
||||
});
|
||||
|
@@ -0,0 +1,19 @@
|
||||
const { I, data, pageDesigner, utilities } = inject();
|
||||
|
||||
Then('shopper should see the main banner', () => {
|
||||
I.waitForElement(pageDesigner.locators.mainBanner);
|
||||
I.seeElement(pageDesigner.locators.mainBanner);
|
||||
});
|
||||
|
||||
Then('shopper should see the main banner message', () => {
|
||||
let mainBannerElement = locate(pageDesigner.locators.mainBanner).at(1);
|
||||
let heading = mainBannerElement.find(pageDesigner.locators.mainBannerHeading);
|
||||
let subHeading = mainBannerElement.find(pageDesigner.locators.mainBannerSubHeading);
|
||||
|
||||
I.see(data.pageDesigner.mainBannerHeading, heading);
|
||||
I.see(data.pageDesigner.mainBannerSubHeading, subHeading);
|
||||
});
|
||||
|
||||
Then('shopper should go to womens clothing dresses clicking on the main banner', () => {
|
||||
utilities.clickToLoadPage(pageDesigner.locators.mainBannerLink, data.pageDesigner.mainBannerLink);
|
||||
});
|
@@ -0,0 +1,6 @@
|
||||
const { I, pageDesigner } = inject();
|
||||
|
||||
Then('shopper should see the photo tile component', () => {
|
||||
I.waitForElement(pageDesigner.locators.photo);
|
||||
I.seeElement(pageDesigner.locators.photo);
|
||||
});
|
@@ -0,0 +1,25 @@
|
||||
const { I, pageDesigner } = inject();
|
||||
|
||||
Then('shopper should see the popularCategories layout', () => {
|
||||
I.waitForElement('.popular-categories');
|
||||
I.seeElement('.popular-categories .popular-cat-heading');
|
||||
I.see('Popular Catalogs', '.popular-cat-heading h3');
|
||||
I.seeElement('.popular-categories .popular-category');
|
||||
});
|
||||
|
||||
Then('shopper should see the popularCategory components', () => {
|
||||
I.seeNumberOfElements('.popular-category', 6);
|
||||
let el = locate('.popular-cat-link').at(1);
|
||||
I.see('Outfits', el);
|
||||
I.see('Tops', el);
|
||||
I.see('Dresses', el);
|
||||
I.see('Bottoms', el);
|
||||
I.see('Jackets & Coats', el);
|
||||
I.see('Feeling Red', el);
|
||||
});
|
||||
|
||||
|
||||
Then('shopper can click on a popular category', () => {
|
||||
pageDesigner.clickPopulareCategory(1, '.popular-category', '/s/RefArch/new arrivals/womens/?lang=default');
|
||||
});
|
||||
|
@@ -0,0 +1,42 @@
|
||||
const { I, data, pageDesigner, utilities } = inject();
|
||||
|
||||
Then('shopper should see the product tile component', () => {
|
||||
I.seeElement(pageDesigner.locators.productTile1);
|
||||
});
|
||||
|
||||
Then('shopper should see the alt attribute on product image', () => {
|
||||
I.seeAttributesOnElements(pageDesigner.locators.productTile1Image, { alt: 'Floral Print Pencil Skirt.' });
|
||||
});
|
||||
|
||||
Then('shopper should see the title attribute on product image', () => {
|
||||
I.seeAttributesOnElements(pageDesigner.locators.productTile1Image, { title: 'Floral Print Pencil Skirt., ' });
|
||||
});
|
||||
|
||||
Then('shopper should not see quickview on product tile', () => {
|
||||
I.dontSeeElement(pageDesigner.locators.productTile1Quickview);
|
||||
});
|
||||
|
||||
Then('shopper should see the product name on product tile', () => {
|
||||
I.see(data.pageDesigner.productTileProductName, pageDesigner.locators.productTile1ProductName);
|
||||
});
|
||||
|
||||
Then('shopper should see the regular price on product tile', () => {
|
||||
I.see(data.pageDesigner.productTile1ProductPrice, pageDesigner.locators.productTile1ProductPrice);
|
||||
});
|
||||
|
||||
Then('shopper should see the strike-through price on product tile', () => {
|
||||
I.see(data.pageDesigner.productTile3ProductStrikeThroughPrice, pageDesigner.locators.productTile3StrikeThroughPrice);
|
||||
});
|
||||
|
||||
Then('shopper should see the sales price on product tile', () => {
|
||||
I.see(data.pageDesigner.productTile3ProductPrice, pageDesigner.locators.productTile3ProductPrice);
|
||||
});
|
||||
|
||||
Then('shopper should go to the product details page clicking on the image', () => {
|
||||
utilities.clickToLoadPage(pageDesigner.locators.productTile1ImageLinkToPdp, data.pageDesigner.productTile1PDPLink);
|
||||
});
|
||||
|
||||
Then('shopper should go to the product details page clicking on product name', () => {
|
||||
utilities.clickToLoadPage(pageDesigner.locators.productTile1NameLinkToPdp, data.pageDesigner.productTile1PDPLink);
|
||||
});
|
||||
|
@@ -0,0 +1,12 @@
|
||||
const { I, data, pageDesigner } = inject();
|
||||
|
||||
Then('shopper should see the rich text component', () => {
|
||||
I.waitForElement(pageDesigner.locators.richText);
|
||||
I.seeElement(pageDesigner.locators.richText);
|
||||
});
|
||||
|
||||
Then('shopper should see the title', () => {
|
||||
let richTextElement = locate(pageDesigner.locators.richText).at(1);
|
||||
let title = richTextElement.find(pageDesigner.locators.richTextTitle);
|
||||
I.see(data.pageDesigner.richTextTitle, title);
|
||||
});
|
@@ -0,0 +1,18 @@
|
||||
const { I, data, pageDesigner, utilities } = inject();
|
||||
|
||||
Then('shopper should see the shop category heading', () => {
|
||||
I.see(data.pageDesigner.shopCategoryTitle, pageDesigner.locators.shopCategoryHeading);
|
||||
});
|
||||
|
||||
Then('shopper should see 5 shop categories', () => {
|
||||
I.seeNumberOfElements(pageDesigner.locators.shopCategoryLabel, 5);
|
||||
I.see(data.pageDesigner.shopCategory1, pageDesigner.locators.shopCategoryLink1);
|
||||
I.see(data.pageDesigner.shopCategory2, pageDesigner.locators.shopCategoryLink2);
|
||||
I.see(data.pageDesigner.shopCategory3, pageDesigner.locators.shopCategoryLink3);
|
||||
I.see(data.pageDesigner.shopCategory4, pageDesigner.locators.shopCategoryLink4);
|
||||
I.see(data.pageDesigner.shopCategory5, pageDesigner.locators.shopCategoryLink5);
|
||||
});
|
||||
|
||||
Then('shopper should go to the category page by clicking on the category link', () => {
|
||||
utilities.clickToLoadPage(pageDesigner.locators.shopCategoryLink3, data.pageDesigner.shopCategoryLink);
|
||||
});
|
@@ -0,0 +1,20 @@
|
||||
const { I, data, pageDesigner } = inject();
|
||||
|
||||
Then('shopper should see the shop the look component', () => {
|
||||
I.waitForElement(pageDesigner.locators.shopTheLookContainer);
|
||||
I.seeElement(pageDesigner.locators.shopTheLookContainer);
|
||||
});
|
||||
|
||||
Then('shopper should see the title when hover over image', () => {
|
||||
I.moveCursorTo(pageDesigner.locators.shopTheLookImage);
|
||||
I.see(data.pageDesigner.shopTheLookOverlayText, pageDesigner.locators.shopTheLookOverlayText);
|
||||
I.see(data.pageDesigner.shopTheLookSetItems, pageDesigner.locators.shopTheLookSetItems);
|
||||
I.see(data.pageDesigner.shopTheLookButton, pageDesigner.locators.shopTheLookButton);
|
||||
});
|
||||
|
||||
Then('shopper should not see the setItem when hover over image on product', () => {
|
||||
I.moveCursorTo(pageDesigner.locators.shopTheLook4thImage);
|
||||
I.see(data.pageDesigner.shopTheLookProductName, pageDesigner.locators.shopTheLookProductName);
|
||||
I.dontSeeElement(pageDesigner.locators.shopTheLook4thSetItems);
|
||||
I.see(data.pageDesigner.shopTheLookButton, pageDesigner.locators.shopTheLook4thButton);
|
||||
});
|
@@ -0,0 +1,13 @@
|
||||
const { productPage } = inject();
|
||||
|
||||
Then('shopper clicks on the more button', () => {
|
||||
productPage.clickMoreButton();
|
||||
});
|
||||
|
||||
Then('Shopper clicks on the first product Tile', () => {
|
||||
productPage.clickFirstTile();
|
||||
});
|
||||
|
||||
Then('Shopper clicks the back button on pdp', () => {
|
||||
productPage.simulateBackButton();
|
||||
});
|
@@ -0,0 +1,24 @@
|
||||
const { data, productPage, homePage } = inject();
|
||||
|
||||
Then('shopper searches for category from menu', () => {
|
||||
homePage.searchMenu(data.searchPages.womensTops);
|
||||
});
|
||||
|
||||
Then('shopper filters product by option', () => {
|
||||
productPage.filterProductOption(data.filterProduct.option, data.filterProduct.productName);
|
||||
});
|
||||
|
||||
Then('shopper filters product by color', () => {
|
||||
productPage.filterProductColor(data.filterProduct.color);
|
||||
productPage.verifyProductTotals(data.filterProduct.colorTotalItems);
|
||||
});
|
||||
|
||||
Then('shopper filters product by size', () => {
|
||||
productPage.filterProductSize(data.filterProduct.size);
|
||||
productPage.verifyProductTotals(data.filterProduct.sizeTotalItems);
|
||||
});
|
||||
|
||||
Then('shopper filters product by price', () => {
|
||||
productPage.filterProductPrice(data.filterProduct.price);
|
||||
productPage.verifyProductTotals(data.filterProduct.priceTotalItems);
|
||||
});
|
@@ -0,0 +1,12 @@
|
||||
const { I, productPage, cartPage, data } = inject();
|
||||
|
||||
Then('shopper opens product quick view from home page', () => {
|
||||
productPage.openProductQuickView(data.product3.productLinkQV);
|
||||
});
|
||||
|
||||
Then('shopper adds to cart from Quick View', () => {
|
||||
productPage.addToCartQuickView();
|
||||
I.waitForVisible(productPage.locators.alertAddToCart);
|
||||
productPage.viewCart();
|
||||
cartPage.verifyCartQuantity(data.product3.quantity);
|
||||
});
|
@@ -0,0 +1,45 @@
|
||||
const { I, homePage, productPage } = inject();
|
||||
var should = require('should'); // eslint-disable-line
|
||||
|
||||
Given('shopper goes to the Product Detail Page', () => {
|
||||
I.amOnPage('/on/demandware.store/Sites-RefArch-Site/en_US/Product-Show?pid=P0150M');
|
||||
homePage.accept();
|
||||
});
|
||||
|
||||
Then('shopper sees all the product related information', async () => {
|
||||
(await I.grabAttributeFrom(productPage.locators.productImage, 'src'))[0].trim().should.containEql('P0150_001.jpg');
|
||||
(await I.grabTextFrom(productPage.locators.productName))[0].trim().should.equal('Upright Case (33L - 3.7Kg)');
|
||||
(await I.grabTextFrom(productPage.locators.productId)).trim().should.equal('P0150M');
|
||||
(await I.grabTextFrom(productPage.locators.productAvailability)).trim().should.equal('In Stock');
|
||||
(await I.grabTextFrom(productPage.locators.productPrice)).trim().should.equal('$99.99');
|
||||
(await I.grabTextFrom(productPage.locators.productDescription)).trim().should.equal('This practical and functional case is perfect for business – with no need to check in as luggage due to its cabin size dimensions – or for any convenient no-fuss travel any time any where. You can pull along for comfort or carry by the handle, and with plenty of space inside and a large front pocket with additional zippered pocket, there’s plenty of useful and compact storage.');
|
||||
(await I.grabTextFrom(productPage.locators.productDetails)).trim().should.equal('1682 ballistic nylon and genuine leather inserts |Pull-out metallic handle for wheeling|Top and side handles|Cabin size for convenient travelling|TSA lock for security');
|
||||
});
|
||||
|
||||
Then('shopper sees the correct breadcrumbs', async () => {
|
||||
const breadcrumbsHrefs = await I.grabAttributeFrom(productPage.locators.navigationCrumbs, 'href');
|
||||
breadcrumbsHrefs[0].should.containEql('mens'); // Mens Category
|
||||
breadcrumbsHrefs[1].should.containEql('accessories'); // Accessories Category
|
||||
breadcrumbsHrefs[2].should.containEql('luggage'); // Luggage Category
|
||||
});
|
||||
|
||||
Then('shopper sees the correct social links', async () => {
|
||||
I.seeElement(productPage.locators.pinterest); // Pinterest
|
||||
I.seeElement(productPage.locators.facebook); // Facebook
|
||||
I.seeElement(productPage.locators.twitter); // Twitter
|
||||
I.seeElement(productPage.locators.copyLink); // Copy Link
|
||||
const socialHrefs = await I.grabAttributeFrom(productPage.locators.socialShare, 'href');
|
||||
socialHrefs[0].should.containEql('pinterest.com'); // Pinterest href
|
||||
socialHrefs[1].should.containEql('facebook.com'); // Facebook href
|
||||
socialHrefs[2].should.containEql('twitter.com'); // Twitter href
|
||||
socialHrefs[3].should.containEql('copy-link-message'); // Copy Link href
|
||||
});
|
||||
|
||||
Then('shopper is able to see Add to Cart Button Enabled', () => {
|
||||
I.seeElement(productPage.locators.addToCartButtonEnabled);
|
||||
});
|
||||
|
||||
Then('shopper is able to copy Product URL using Copy Link Icon', () => {
|
||||
productPage.clickCopyLink();
|
||||
I.seeElement(productPage.locators.copyLinkMsgVisible);
|
||||
});
|
@@ -0,0 +1,11 @@
|
||||
const { I, homePage } = inject();
|
||||
var should = require('should'); // eslint-disable-line
|
||||
|
||||
Given('shopper lands on the expected category landing page', () => {
|
||||
I.amOnPage('/on/demandware.store/Sites-RefArch-Site/en_US/SourceCodeRedirect-Start?src=televisions4');
|
||||
homePage.accept();
|
||||
});
|
||||
|
||||
Then('shopper sees all the category landing page related information', async () => {
|
||||
(await I.grabTextFrom('.page-title')).trim().should.equal('Flat Screen');
|
||||
});
|
@@ -0,0 +1,11 @@
|
||||
const { I, homePage } = inject();
|
||||
var should = require('should'); // eslint-disable-line
|
||||
|
||||
Given('shopper lands on the expected content page', () => {
|
||||
I.amOnPage('/on/demandware.store/Sites-RefArch-Site/en_US/SourceCodeRedirect-Start?src=privacy3');
|
||||
homePage.accept();
|
||||
});
|
||||
|
||||
Then('shopper sees the expected content page', async () => {
|
||||
(await I.grabTextFrom('.page-title')).trim().should.equal('Privacy Policy');
|
||||
});
|
@@ -0,0 +1,11 @@
|
||||
const { I, homePage, productPage } = inject();
|
||||
var should = require('should'); // eslint-disable-line
|
||||
|
||||
Given('shopper lands on the expected pdp', () => {
|
||||
I.amOnPage('/on/demandware.store/Sites-RefArch-Site/en_US/SourceCodeRedirect-Start?src=ps3bundle5');
|
||||
homePage.accept();
|
||||
});
|
||||
|
||||
Then('shopper sees all the product related information v2', async () => {
|
||||
(await I.grabTextFrom(productPage.locators.productName))[0].trim().should.equal('Playstation 3 Bundle');
|
||||
});
|
@@ -0,0 +1,90 @@
|
||||
const { I, data, cartPage, checkoutPage, accountPage, loginPage } = inject();
|
||||
|
||||
var orderHistoryNumber = '';
|
||||
|
||||
Then('shopper goes to cart', () => {
|
||||
I.waitForElement(cartPage.locators.cartIcon);
|
||||
I.click(cartPage.locators.cartIcon);
|
||||
});
|
||||
|
||||
Then('shopper changes product quantity to {string}', (quantity) => {
|
||||
cartPage.editQuantity(quantity);
|
||||
});
|
||||
|
||||
Then('shopper selects checkout from cart', () => {
|
||||
I.waitForElement(cartPage.locators.checkoutBtn);
|
||||
I.click(cartPage.locators.checkoutBtn);
|
||||
});
|
||||
|
||||
Then('shopper selects checkout as guest', () => {
|
||||
I.waitForElement(checkoutPage.locators.checkoutAsGuestBtn);
|
||||
checkoutPage.fillPersonalDataGuest(data.checkout.email);
|
||||
I.click(checkoutPage.locators.checkoutAsGuestBtn);
|
||||
});
|
||||
|
||||
Then('shopper fills out shipping information', () => {
|
||||
checkoutPage.fillShippingInfo(data.checkout.fName, data.checkout.lName, data.checkout.address1,
|
||||
data.checkout.country, data.checkout.state, data.checkout.city,
|
||||
data.checkout.zip, data.checkout.phone);
|
||||
});
|
||||
|
||||
Then('shopper verifies shipping information', () => {
|
||||
checkoutPage.verifyShipping(data.checkout.fName, data.checkout.lName, data.checkout.address1,
|
||||
data.checkout.city, data.checkout.stateAbr, data.checkout.zip);
|
||||
});
|
||||
|
||||
Then('shopper proceeds to payment section', () => {
|
||||
I.waitForElement(checkoutPage.locators.toPayment);
|
||||
I.click(checkoutPage.locators.toPayment);
|
||||
});
|
||||
|
||||
Then('shopper fills out billing information', () => {
|
||||
checkoutPage.fillPaymentInfoGuest(data.user1.fName, data.user1.lName, data.user1.address1,
|
||||
data.user1.city, data.user1.stateAbr, data.user1.zip, data.checkout.phone, data.checkout.ccNum,
|
||||
data.checkout.expMonth, data.checkout.expYear, data.checkout.ccSecCode);
|
||||
});
|
||||
|
||||
Then('shopper fills out registered user billing information', () => {
|
||||
checkoutPage.fillPaymentInfoRegistered(data.checkout.phone, data.checkout.ccSecCode);
|
||||
});
|
||||
|
||||
Then('shopper places order', () => {
|
||||
I.waitForElement(checkoutPage.locators.placeOrder);
|
||||
I.click(checkoutPage.locators.placeOrder);
|
||||
checkoutPage.verifyCheckoutInfo(data.checkout.fName, data.checkout.lName, data.checkout.address1,
|
||||
data.checkout.city, data.checkout.zip, data.checkout.phone, data.checkout.ccNum, data.checkout.ccExpDate, data.product.quantity,
|
||||
data.product.totalItemPrice, data.product.shipping, data.product.tax, data.product.estimatedTotal);
|
||||
I.waitForElement(checkoutPage.locators.confirmOrder);
|
||||
I.click(checkoutPage.locators.confirmOrder);
|
||||
});
|
||||
|
||||
Then('shopper verifies the order confirmation page', async () => {
|
||||
checkoutPage.verifyOrderConfirmation(data.checkout.fName, data.checkout.lName, data.checkout.address1,
|
||||
data.checkout.city, data.checkout.zip, data.checkout.phone,
|
||||
data.checkout.email, data.checkout.ccNum, data.checkout.ccExpDate, data.product.quantity,
|
||||
data.product.totalItemPrice, data.product.shipping, data.product.tax, data.product.estimatedTotal);
|
||||
orderHistoryNumber = await I.grabTextFrom('.summary-details.order-number');
|
||||
});
|
||||
|
||||
Then('shopper goes to profile saved payments page and deletes credit card', () => {
|
||||
I.amOnPage(data.account.accountPage);
|
||||
accountPage.viewAllPayments();
|
||||
accountPage.removePayment(data.account.deletePaymentModalText);
|
||||
});
|
||||
|
||||
Then('logs out of the account', () => {
|
||||
accountPage.logOut();
|
||||
});
|
||||
|
||||
Then('shopper is able to fill out the order number, email, and zip code', () => {
|
||||
loginPage.checkOrder(orderHistoryNumber, data.orderHistory.email, data.orderHistory.zip);
|
||||
});
|
||||
|
||||
Then('shopper is able to click the check status button', () => {
|
||||
I.waitForElement(loginPage.locators.primaryButton);
|
||||
I.click(locate(loginPage.locators.primaryButton).withText('Check status'));
|
||||
});
|
||||
|
||||
Then('shopper is able to view order detail', () => {
|
||||
loginPage.verifyOrderHistory(data.product);
|
||||
});
|
@@ -0,0 +1,13 @@
|
||||
const { I, utilities } = inject();
|
||||
|
||||
When('shopper load Page Designer home page', () => {
|
||||
I.amOnPage('/s/RefArch/homepage-example.html?lang=default');
|
||||
});
|
||||
|
||||
When('shopper load Page Designer campaign page', () => {
|
||||
I.amOnPage('/s/RefArch/campaign-example.html?lang=default');
|
||||
});
|
||||
|
||||
When('shopper accept the Consent Tracking Modal', () => {
|
||||
utilities.accept();
|
||||
});
|
Reference in New Issue
Block a user