chore: drive-by fixes for the snapshotPathTemplate (#18715)

- Use `snapshotPathTemplate` for docker screenshots in html-reporter
- Mark the snapshot path template test as slow since it re-spawns
  worker for each project.
- Fix docker smoke tests
This commit is contained in:
Andrey Lushnikov 2022-11-10 15:50:13 -08:00 committed by GitHub
parent 56d7d47d43
commit db826c9c8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 4 deletions

View File

@ -816,9 +816,14 @@ jobs:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run build
- run: npx playwright install --with-deps
- run: ./utils/docker/build.sh --amd64 focal playwright:localbuild
- run: PWTEST_DOCKER_BASE_IMAGE=playwright:localbuild npx playwright docker build
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run dtest
- run: |
./utils/docker/build.sh --amd64 focal $PWTEST_DOCKER_BASE_IMAGE
npx playwright docker build
nohup npx playwright docker start &
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --grep '@smoke'
env:
PLAYWRIGHT_DOCKER: 1
PWTEST_DOCKER_BASE_IMAGE: playwright:localbuild
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always()
shell: bash

View File

@ -13,7 +13,6 @@
},
"license": "Apache-2.0",
"scripts": {
"dtest": "cross-env PLAYWRIGHT_DOCKER=1 playwright test --config=tests/library/playwright.config.ts --grep '@smoke'",
"ctest": "playwright test --config=tests/library/playwright.config.ts --project=chromium",
"ftest": "playwright test --config=tests/library/playwright.config.ts --project=firefox",
"wtest": "playwright test --config=tests/library/playwright.config.ts --project=webkit",

View File

@ -22,6 +22,7 @@ const config: PlaywrightTestConfig = {
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
ignoreSnapshots: !process.env.PLAYWRIGHT_DOCKER,
snapshotPathTemplate: '{testDir}/__screenshots__/{projectName}/{testFilePath}/{arg}{ext}',
reporter: 'html',
use: {
ctPort: 3101,

View File

@ -45,6 +45,7 @@ async function getSnapshotPaths(runInlineTest, testInfo, playwrightConfig, pathA
}
test('tokens should expand property', async ({ runInlineTest }, testInfo) => {
test.slow();
const snapshotPath = await getSnapshotPaths(runInlineTest, testInfo, {
projects: [{
name: 'proj1',