Adds SFRA 6.0
This commit is contained in:
@@ -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);
|
||||
});
|
Reference in New Issue
Block a user