E2E/Playwright: Upgrade playwright/dependencies and test server config (#26464)

* chore: upgrade playwright and test server config

* add post install script

* update config types

* fix visual test
Этот коммит содержится в:
Saturnino Abril
2024-03-19 08:09:25 +08:00
коммит произвёл GitHub
родитель 297135c5b4
Коммит 53471c7e8c
14 изменённых файлов: 705 добавлений и 502 удалений

Просмотреть файл

@@ -6,7 +6,7 @@ import os from 'node:os';
import chalk from 'chalk';
import {expect, TestInfo} from '@playwright/test';
import {illegalRe} from '@e2e-support/util';
import {duration, illegalRe, wait} from '@e2e-support/util';
import testConfig from '@e2e-test.config';
import {ScreenshotOptions, TestArgs} from '@e2e-types';
@@ -23,6 +23,12 @@ export async function matchSnapshot(testInfo: TestInfo, testArgs: TestArgs, opti
return;
}
if (testConfig.snapshotEnabled || testConfig.percyEnabled) {
await testArgs.page.waitForLoadState('networkidle');
await testArgs.page.waitForLoadState('domcontentloaded');
await wait(duration.half_sec);
}
if (testConfig.snapshotEnabled) {
// Visual test with built-in snapshot
const filename = testInfo.title.replace(illegalRe, '').replace(/\s/g, '-').trim().toLowerCase();