Skip to content

Commit

Permalink
Merge branch 'main' into remove-config-sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
sirugh authored Dec 16, 2024
2 parents b4ba79f + 9eee699 commit 582333e
Show file tree
Hide file tree
Showing 6 changed files with 4,476 additions and 1,847 deletions.
11 changes: 6 additions & 5 deletions cypress/src/tests/e2eTests/events/recs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import { expectsEventWithContext } from "../../../assertions";
*
*/

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

it('recs-unit-view', () => {
cy.visit('/gear');
cy.visit(RECS_URL);
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 +50,7 @@ it('recs-unit-view', () => {
return adobeDataLayer;
}).then(adobeDataLayer => {
// triggers a second view when scrolled again
cy.get('#gear').scrollIntoView({ duration: 50 }).then(() => {
cy.get('.pdp-header__title').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 +61,7 @@ it('recs-unit-view', () => {
});

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

it('reqs-item-add-to-cart', () => {
cy.visit('/gear');
cy.visit(RECS_URL);
cy.waitForResource("commerce-events-collector.js").then(() => {
cy.window().then((win) => {
cy.spy(win.adobeDataLayer, "push").as("adl");
Expand Down
5 changes: 0 additions & 5 deletions head.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<!--
Domain Verification for Adobe Commerce Security Scan
https://experienceleague.adobe.com/en/docs/commerce-admin/systems/security/security-scan
-->
<meta name="p:domain_verify" content="yJyUSQ8U4NKaWH9aH30nXtptalV0gHK1"/>
<script type="speculationrules">
{
"prerender": [{
Expand Down
Loading

0 comments on commit 582333e

Please sign in to comment.