chore(recorder): support HMR (#33637)

This commit is contained in:
Max Schmitt 2024-11-18 18:23:29 +01:00 committed by GitHub
parent acd862c6c9
commit 150092438f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -88,7 +88,7 @@ export class RecorderApp extends EventEmitter implements IRecorderApp {
});
const mainFrame = this._page.mainFrame();
await mainFrame.goto(serverSideCallMetadata(), 'https://playwright/index.html');
await mainFrame.goto(serverSideCallMetadata(), process.env.PW_HMR ? 'http://localhost:44225' : 'https://playwright/index.html');
}
static factory(context: BrowserContext): IRecorderAppFactory {

View File

@ -342,6 +342,13 @@ if (watchMode) {
cwd: path.join(__dirname, '..', '..', 'packages', 'html-reporter'),
concurrent: true,
});
steps.push({
command: 'npx',
args: ['vite', '--port', '44225'],
shell: true,
cwd: path.join(__dirname, '..', '..', 'packages', 'recorder'),
concurrent: true,
});
}
// Generate injected.