generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* eslint-disable max-len */ | ||
|
||
module.exports = { | ||
FeatureName: 'Merch CCD Card Feature', | ||
features: [ | ||
// Checkout Link Page | ||
{ | ||
tcid: '0', | ||
name: '@MAS-DOCS-checkout-link', | ||
path: '/libs/features/mas/docs/checkout-link.html', | ||
browserParams: '?theme=dark', | ||
tags: '@mas-docs @checkout-link @commerce @smoke @regression @milo', | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { features } from './docs.spec.js'; | ||
|
||
const miloLibs = process.env.MILO_LIBS || ''; | ||
|
||
test.describe('CCD Merchcard feature test suite', () => { | ||
test.beforeEach(async ({ page, browserName }) => { | ||
test.skip(browserName !== 'chromium', 'Not supported to run on multiple browsers.'); | ||
|
||
if (browserName === 'chromium') { | ||
await page.setExtraHTTPHeaders({ 'sec-ch-ua': '"Chromium";v="123", "Not:A-Brand";v="8"' }); | ||
} | ||
}); | ||
|
||
// *** Checkout Link Page: *** | ||
|
||
// @MAS-DOCS-checkout-link | ||
test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { | ||
const testPage = `${baseURL}${features[0].path}${miloLibs}`; | ||
console.info('[Test Page]: ', testPage); | ||
|
||
await test.step('step-1: Go to MAS Checkout Link Docs page', async () => { | ||
await page.goto(testPage); | ||
await page.waitForLoadState('domcontentloaded'); | ||
await expect(page).toHaveURL(`${baseURL}${features[0].path}`); | ||
}); | ||
|
||
await test.step('step-2: Verify on load pending & resolved events', async () => { | ||
const eventsLog = page.locator('#log'); | ||
await expect(eventsLog).toHaveText('checkout-link resolvedcheckout-link resolvedcheckout-link pendingcheckout-link pending'); | ||
}); | ||
|
||
await test.step('step-3: Verify on click pending & resolved events', async () => { | ||
const btnRefresh = page.locator('#btnRefresh'); | ||
const eventsLog = page.locator('#log'); | ||
await btnRefresh.click(); | ||
await expect(eventsLog).toHaveText('checkout-link resolvedcheckout-link resolvedcheckout-link pendingcheckout-link pendingcheckout-link resolvedcheckout-link resolvedcheckout-link pendingcheckout-link pending'); | ||
}); | ||
}); | ||
}); |