Skip to content

Commit

Permalink
fix: pass --headed when reusing browser
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman committed Jan 10, 2023
1 parent 4d02a9a commit 8fd5682
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/
import { PlaywrightTestConfig } from '@playwright/test';
import { TestOptions } from './tests/utils';
import { WorkerOptions } from './tests/utils';

const config: PlaywrightTestConfig<TestOptions> = {
const config: PlaywrightTestConfig<WorkerOptions> = {
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ located next to Run / Debug Tests toolbar buttons.`);
errorsByFile.set(error.location?.file, error);
}
}
this._updateDiagnistics(errorsByFile);
this._updateDiagnostics(errorsByFile);
finishedCallback();
}, 0);

Expand Down
4 changes: 3 additions & 1 deletion src/playwrightTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ export class PlaywrightTest {
'--repeat-each', '1',
'--retries', '0',
];
if (this._isUnderTest || this._reusedBrowser.browserServerEnv(false) || args.includes('--headed'))
if (this._reusedBrowser.browserServerEnv(false) && !allArgs.includes('--headed') && !this._isUnderTest)
allArgs.push('--headed');
if (this._isUnderTest || args.includes('--headed'))
allArgs.push('--workers', '1');
// Disable original reporters when listing files.
if (mode === 'list')
Expand Down

0 comments on commit 8fd5682

Please sign in to comment.