feat(watch): hide show-report prompt (#32666)
Closes https://github.com/microsoft/playwright/issues/32665
This commit is contained in:
parent
355c88f48f
commit
443f72dcbe
|
|
@ -143,7 +143,7 @@ class HtmlReporter implements ReporterV2 {
|
|||
const shouldOpen = !this._options._isTestServer && (this._open === 'always' || (!ok && this._open === 'on-failure'));
|
||||
if (shouldOpen) {
|
||||
await showHTMLReport(this._outputFolder, this._host, this._port, singleTestId);
|
||||
} else if (this._options._mode === 'test') {
|
||||
} else if (this._options._mode === 'test' && !this._options._isTestServer) {
|
||||
const packageManagerCommand = getPackageManagerExecCommand();
|
||||
const relativeReportPath = this._outputFolder === standaloneDefaultFolder() ? '' : ' ' + path.relative(process.cwd(), this._outputFolder);
|
||||
const hostArg = this._host ? ` --host ${this._host}` : '';
|
||||
|
|
|
|||
|
|
@ -215,6 +215,24 @@ test('should run tests on Enter', async ({ runWatchTest }) => {
|
|||
await testProcess.waitForOutput('Waiting for file changes.');
|
||||
});
|
||||
|
||||
test('should not print show-report command of HTML reporter', async ({ runWatchTest }) => {
|
||||
const testProcess = await runWatchTest({
|
||||
'a.test.ts': `
|
||||
import { test, expect } from '@playwright/test';
|
||||
test('passes', () => {});
|
||||
`,
|
||||
'playwright.config.ts': `
|
||||
import { defineConfig } from '@playwright/test';
|
||||
export default defineConfig({ reporter: 'html' });
|
||||
`,
|
||||
});
|
||||
await testProcess.waitForOutput('Waiting for file changes.');
|
||||
testProcess.clearOutput();
|
||||
testProcess.write('\r\n');
|
||||
await testProcess.waitForOutput('Waiting for file changes.');
|
||||
expect(testProcess.output).not.toContain('To open last HTML report run:');
|
||||
});
|
||||
|
||||
test('should run tests on R', async ({ runWatchTest }) => {
|
||||
const testProcess = await runWatchTest({
|
||||
'a.test.ts': `
|
||||
|
|
|
|||
Loading…
Reference in a new issue