Skip to content

Commit

Permalink
Adding visual comparison tests for bacom.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Li committed Sep 27, 2024
1 parent 9f168b5 commit 6d2d17e
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
21 changes: 21 additions & 0 deletions data/bacom/visual/sot.yml
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'
13 changes: 13 additions & 0 deletions features/visual/bacom/sot.spec.js
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',
},
],
};
46 changes: 46 additions & 0 deletions tests/visual/bacom/sot.test.js
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);
});
}
});

0 comments on commit 6d2d17e

Please sign in to comment.