Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:hlxsites/aem-boilerplate-commerc…
Browse files Browse the repository at this point in the history
…e into auth-acc-order-beta
  • Loading branch information
Ferri0 committed Dec 9, 2024
2 parents 7c0c9a1 + 2fc5bb1 commit 74356d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cypress/src/tests/e2eTests/events/recs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { expectsEventWithContext } from "../../../assertions";
*/

it('api-request-sent, api-response-received, unit-impression-render', () => {
cy.visit('/products/crown-summit-backpack/24-MB03');
cy.visit('/gear');
cy.waitForResource('commerce-events-collector.js').then(() => {
cy.window().its('adobeDataLayer').then((adobeDataLayer) => {
expectsEventWithContext(
Expand All @@ -36,7 +36,7 @@ it('api-request-sent, api-response-received, unit-impression-render', () => {
});

it('recs-unit-view', () => {
cy.visit('/products/crown-summit-backpack/24-MB03');
cy.visit('/gear');
cy.waitForResource('commerce-events-collector.js').then(() => {
cy.get('.product-recommendations-wrapper').scrollIntoView({ duration: 1000 });
cy.window().its('adobeDataLayer').then((adobeDataLayer) => {
Expand All @@ -49,7 +49,7 @@ it('recs-unit-view', () => {
return adobeDataLayer;
}).then(adobeDataLayer => {
// triggers a second view when scrolled again
cy.get('.pdp-header__title').scrollIntoView({ duration: 50 }).then(() => {
cy.get('#gear').scrollIntoView({ duration: 50 }).then(() => {
cy.get('.product-recommendations-wrapper').scrollIntoView({ duration: 50 }).then(() => {
const eventCount = adobeDataLayer.filter(data => data?.event === 'recs-unit-view');
expect(eventCount).to.have.lengthOf(2);
Expand All @@ -60,7 +60,7 @@ it('recs-unit-view', () => {
});

it('recs-item-click', () => {
cy.visit('/products/crown-summit-backpack/24-MB03');
cy.visit('/gear');
cy.waitForResource("commerce-events-collector.js").then(() => {
cy.window().then((win) => {
cy.spy(win.adobeDataLayer, "push").as("adl");
Expand Down Expand Up @@ -92,7 +92,7 @@ it('recs-item-click', () => {
});

it('reqs-item-add-to-cart', () => {
cy.visit('/products/crown-summit-backpack/24-MB03');
cy.visit('/gear');
cy.waitForResource("commerce-events-collector.js").then(() => {
cy.window().then((win) => {
cy.spy(win.adobeDataLayer, "push").as("adl");
Expand Down

0 comments on commit 74356d9

Please sign in to comment.