Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: allow repetative application of rebaselines in the same session (#34524)
Pavel Feldman7060cd1bf759
diff --git a/packages/playwright/src/runner/rebase.ts b/packages/playwright/src/runner/rebase.tsindex 196944fd88..b040761df9 100644--- a/packages/playwright/src/runner/rebase.ts+++ b/packages/playwright/src/runner/rebase.ts@@ -43,6 +43,10 @@ export function addSuggestedRebaseline(location: Location, suggestedRebaseline:suggestedRebaselines.set(location.file, { location, code: suggestedRebaseline });}+export function clearSuggestedRebaselines() {+ suggestedRebaselines.clear();+}+export async function applySuggestedRebaselines(config: FullConfigInternal, reporter: InternalReporter) {if (config.config.updateSnapshots === 'none')return;diff --git a/packages/playwright/src/runner/tasks.ts b/packages/playwright/src/runner/tasks.tsindex 84cffac573..2d0b57f13a 100644--- a/packages/playwright/src/runner/tasks.ts+++ b/packages/playwright/src/runner/tasks.ts@@ -34,7 +34,7 @@ import { detectChangedTestFiles } from './vcs';import type { InternalReporter } from '../reporters/internalReporter';import { cacheDir } from '../transform/compilationCache';import type { FullResult } from '../../types/testReporter';-import { applySuggestedRebaselines } from './rebase';+import { applySuggestedRebaselines, clearSuggestedRebaselines } from './rebase';const readDirAsync = promisify(fs.readdir);@@ -284,6 +284,9 @@ export function createLoadTask(mode: 'out-of-process' | 'in-process', options: {export function createApplyRebaselinesTask(): Task<TestRun> {return {title: 'apply rebaselines',+ setup: async () => {+ clearSuggestedRebaselines();+ },teardown: async ({ config, reporter }) => {await applySuggestedRebaselines(config, reporter);},