@@ -1206,22 +1206,30 @@ test('should produce output twice', async ({ activate, overridePlaywrightVersion
12061206 ` ) ;
12071207} ) ;
12081208
1209- test ( 'should disable tracing when reusing context' , async ( { activate, showBrowser } ) => {
1210- test . skip ( ! showBrowser ) ;
1211-
1209+ test ( 'should not crash with tracing no matter reusing context' , async ( { activate } ) => {
12121210 const { testController } = await activate ( {
12131211 'playwright.config.js' : `module.exports = { testDir: 'tests', use: { trace: 'on' } }` ,
1214- 'tests/test .spec.ts' : `
1212+ 'tests/test1 .spec.ts' : `
12151213 import { test } from '@playwright/test';
12161214 test('one', async ({ page }) => {});
12171215 ` ,
1216+ 'tests/test2.spec.ts' : `
1217+ import { test } from '@playwright/test';
1218+ test('two', async ({ page }) => {});
1219+ ` ,
12181220 } ) ;
12191221
1220- const testItems = testController . findTestItems ( / t e s t .s p e c .t s / ) ;
1221- expect ( testItems . length ) . toBe ( 1 ) ;
1222- await testController . run ( testItems ) ;
1222+ const testItems1 = testController . findTestItems ( / t e s t 1 .s p e c .t s / ) ;
1223+ expect ( testItems1 . length ) . toBe ( 1 ) ;
1224+ await testController . run ( testItems1 ) ;
1225+ expect ( fs . existsSync ( test . info ( ) . outputPath ( 'test-results' , 'test1-one' , 'trace.zip' ) ) ) . toBe ( true ) ;
12231226
1224- expect ( fs . existsSync ( test . info ( ) . outputPath ( 'test-results' , 'test-one' , 'trace.zip' ) ) ) . toBe ( false ) ;
1227+ const testItems2 = testController . findTestItems ( / t e s t 2 .s p e c .t s / ) ;
1228+ expect ( testItems2 . length ) . toBe ( 1 ) ;
1229+ await testController . run ( testItems2 ) ;
1230+ // We do not clear output dir, so both traces should be present.
1231+ expect ( fs . existsSync ( test . info ( ) . outputPath ( 'test-results' , 'test1-one' , 'trace.zip' ) ) ) . toBe ( true ) ;
1232+ expect ( fs . existsSync ( test . info ( ) . outputPath ( 'test-results' , 'test2-two' , 'trace.zip' ) ) ) . toBe ( true ) ;
12251233} ) ;
12261234
12271235test ( 'should force workers=1 when reusing the browser' , async ( { activate, showBrowser } ) => {
0 commit comments