@@ -108,18 +108,13 @@ defineWorkerFixture('browser', async ({browserType, defaultBrowserOptions}, test
108
108
await browser . close ( ) ;
109
109
} ) ;
110
110
111
- defineTestFixture ( 'testOutputDir' , async ( { testInfo } , runTest ) => {
112
- const relativePath = path . relative ( config . testDir , testInfo . file ) . replace ( / \. s p e c \. [ j t ] s / , '' ) ;
111
+ defineTestFixture ( 'testOutputDir' , async ( { testInfo, browserName } , runTest ) => {
112
+ const relativePath = path . relative ( config . testDir , testInfo . file )
113
+ . replace ( / \. s p e c \. [ j t ] s / , '' )
114
+ . replace ( / \. t e s t \. [ j t ] s / , '' ) ;
113
115
const sanitizedTitle = testInfo . title . replace ( / [ ^ \w \d ] + / g, '_' ) ;
114
- const testOutputDir = path . join ( config . outputDir , relativePath , sanitizedTitle ) ;
115
- await fs . promises . mkdir ( testOutputDir , { recursive : true } ) ;
116
+ const testOutputDir = path . join ( config . outputDir , relativePath , sanitizedTitle , browserName ) ;
116
117
await runTest ( testOutputDir ) ;
117
- const files = await fs . promises . readdir ( testOutputDir ) ;
118
- if ( ! files . length ) {
119
- // Do not leave an empty useless directory.
120
- // This might throw. See https://github.com/GoogleChrome/puppeteer/issues/2778
121
- await removeFolderAsync ( testOutputDir ) . catch ( e => { } ) ;
122
- }
123
118
} ) ;
124
119
125
120
defineTestFixture ( 'context' , async ( { browser, testOutputDir } , runTest ) => {
0 commit comments