-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add screenshots test for graybox dc (#454)
* add tests for graybox-bacom * just use chrome * add more waiting time * add merch card * add 404 checker for graxybox-bacom * update gitignore and file name * add screenshots for graybox-dc
- Loading branch information
Showing
4 changed files
with
70 additions
and
1 deletion.
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,10 @@ | ||
--- | ||
'not-found': 'https://www.stage.adobe.com/not-found.html' | ||
'Homepage': 'https://www.stage.adobe.com/acrobat/business.html' | ||
'AcrobatPro': 'https://www.stage.adobe.com/acrobat/business/acrobat-pro.html' | ||
'Pricing': 'https://www.stage.adobe.com/acrobat/pricing.html' | ||
'Word2PDF': 'https://www.stage.adobe.com/acrobat/online/word-to-pdf.html' | ||
'AIChatPDF': 'https://www.stage.adobe.com/acrobat/online/ai-chat-pdf.html' | ||
'PDFtoWord': 'https://www.stage.adobe.com/acrobat/online/pdf-to-word.html' | ||
'Sign': 'https://www.stage.adobe.com/acrobat/acrobat/business/sign.html' | ||
'AdobeSign': 'https://www.stage.adobe.com/acrobat/business/online-signature.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
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: 'Graybox DC SOT Visual Comparison', | ||
features: [ | ||
{ | ||
tcid: '0', | ||
name: '@graybox-dc-visual', | ||
stable: '@adobe_stage', | ||
beta: '@graybox_dc', | ||
tags: '@graybox-dc-visual @visual @graybox-dc-screenshots', | ||
data: 'data/graybox/sot-dc.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,45 @@ | ||
/* eslint-disable no-restricted-syntax */ | ||
/* eslint-disable import/named */ | ||
import { test } from '@playwright/test'; | ||
import { features } from '../../../features/visual/graybox/sot.dc.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/graybox-dc'; | ||
const results = {}; | ||
|
||
test.describe('Graybox DC SOT visual comparison test suite', () => { | ||
// reset timeout because we use this to run all test data | ||
test.setTimeout(20 * 60 * 1000); | ||
for (const feature of features) { | ||
// eslint-disable-next-line no-loop-func | ||
test(`${feature.name},${feature.tags}`, async ({ page }, testInfo) => { | ||
// load test data from static files | ||
const testdata = await WebUtil.loadTestData(`${feature.data}`); | ||
|
||
for (const key of Object.keys(testdata)) { | ||
const stableURL = testdata[key]; | ||
console.info(stableURL); | ||
const betaURL = testdata[key].replace('www.stage', 'test.graybox'); | ||
console.info(betaURL); | ||
|
||
const name = `${feature.name}-${key}-${testInfo.project.name}`; | ||
// eslint-disable-next-line no-await-in-loop | ||
const result = await takeTwo( | ||
page, | ||
stableURL, | ||
async () => { await page.waitForTimeout(10000); }, | ||
betaURL, | ||
async () => { await page.waitForTimeout(15000); }, | ||
folderPath, | ||
name, | ||
{ fullPage: true }, | ||
); | ||
results[name] = [result]; | ||
} | ||
writeResultsToFile(folderPath, testInfo, results); | ||
}); | ||
} | ||
}); |