-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding visual comparison tests for bacom.
- Loading branch information
Dennis Li
committed
Sep 27, 2024
1 parent
9f168b5
commit 6d2d17e
Showing
3 changed files
with
80 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,21 @@ | ||
--- | ||
'homepage': 'https://business.stage.adobe.com/' | ||
'de homepage': 'https://business.stage.adobe.com/de/' | ||
'fr homepage': 'https://business.stage.adobe.com/fr/' | ||
'au homepage': 'https://business.stage.adobe.com/au/' | ||
'uk homepage': 'https://business.stage.adobe.com/uk/' | ||
'jp homepage': 'https://business.stage.adobe.com/jp/' | ||
'kr homepage': 'https://business.stage.adobe.com/kr/' | ||
'genstudio': 'https://business.stage.adobe.com/products/genstudio.html' | ||
'genstudio/creation': 'https://business.stage.adobe.com/products/genstudio/creation.html' | ||
'aem-sites': 'https://business.stage.adobe.com/products/experience-manager/sites/aem-sites.html' | ||
'rtcdp': 'https://business.stage.adobe.com/products/real-time-customer-data-platform/rtcdp.html' | ||
'ai-assistant': 'https://business.stage.adobe.com/products/sensei/ai-assistant.html' | ||
'resources': 'https://business.stage.adobe.com/resources/main.html' | ||
'holiday-shopping-report': 'https://business.stage.adobe.com/resources/holiday-shopping-report.html' | ||
'experience-cloud': 'https://business.stage.adobe.com/request-consultation/experience-cloud.html' | ||
'experience-magento-compare': 'https://business.stage.adobe.com/resources/experience-magento-compare.html' | ||
'customer-success-stories': 'https://business.stage.adobe.com/customer-success-stories.html' | ||
'pricing': 'https://business.stage.adobe.com/products/pricing.html' | ||
'real-time-customer-data-platform/pricing': 'https://business.stage.adobe.com/products/real-time-customer-data-platform/pricing.html' | ||
'marketo-measure': 'https://business.stage.adobe.com/products/marketo/marketo-measure.html' |
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,13 @@ | ||
module.exports = { | ||
name: 'BACOM SOT Visual Comparison', | ||
features: [ | ||
{ | ||
tcid: '0', | ||
name: 'BACOM Visual Comparison', | ||
stable: '@bacom_prod', | ||
beta: '@bacom_stage', | ||
tags: '@bacom-visual @visual @bacom-screenshots', | ||
data: 'data/bacom/visual/sot.yml', | ||
}, | ||
], | ||
}; |
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,46 @@ | ||
import { test } from '@playwright/test'; | ||
import { features } from '../../../features/visual/bacom/sot.spec.js'; | ||
import { takeTwo } from '../../../libs/screenshot/take.js'; | ||
import { writeResultsToFile } from '../../../libs/screenshot/utils.js'; | ||
|
||
const { WebUtil } = require('../../../libs/webutil.js'); | ||
|
||
const folderPath = 'screenshots/bacom'; | ||
const results = {}; | ||
const MILO_LIBS = '?milolibs=stage'; | ||
|
||
test.describe('BACOM SOT visual comparison test suite', () => { | ||
// reset timeout because we use this to run all test data | ||
test.setTimeout(10 * 60 * 1000); | ||
|
||
for (const feature of features) { | ||
test(`${feature.name},${feature.tags}`, async ({ page }, testInfo) => { | ||
const testdata = await WebUtil.loadTestData(`${feature.data}`); | ||
|
||
for (const key of Object.keys(testdata)) { | ||
const stableURL = testdata[key].replace('.stage.', '.'); | ||
console.info(stableURL); | ||
const betaURL = testdata[key] + MILO_LIBS; | ||
console.info(betaURL); | ||
|
||
const name = `${feature.name}-${key}-${testInfo.project.name}`; | ||
const result = await takeTwo( | ||
page, | ||
stableURL, | ||
async () => { | ||
await page.waitForTimeout(3000); | ||
}, | ||
betaURL, | ||
async () => { | ||
await page.waitForTimeout(3000); | ||
}, | ||
folderPath, | ||
name, | ||
{ fullPage: true }, | ||
); | ||
results[name] = [result]; | ||
} | ||
writeResultsToFile(folderPath, testInfo, results); | ||
}); | ||
} | ||
}); |