@@ -2943,6 +2943,7 @@ for (const useIntermediateMergeReport of [true, false] as const) {
29432943 await expect ( page . locator ( '.test-case-path' ) ) . toHaveText ( 'Root describe' ) ;
29442944 } ) ;
29452945
2946+
29462947 test ( 'should print a user-friendly warning when opening a trace via file:// protocol' , async ( { runInlineTest, showReport, page } ) => {
29472948 await runInlineTest ( {
29482949 'playwright.config.ts' : `
@@ -2965,10 +2966,16 @@ for (const useIntermediateMergeReport of [true, false] as const) {
29652966 const reportPath = path . join ( test . info ( ) . outputPath ( ) , 'playwright-report' ) ;
29662967 await page . goto ( url . pathToFileURL ( path . join ( reportPath , 'index.html' ) ) . toString ( ) ) ;
29672968 await page . getByRole ( 'link' , { name : 'View trace' } ) . click ( ) ;
2968- await expect ( page . locator ( '#fallback-error' ) ) . toContainText ( 'The Playwright Trace Viewer must be loaded over the http:// or https:// protocols.' ) ;
2969- await expect ( page . locator ( '#fallback-error' ) ) . toContainText ( `npx playwright show-report ${ reportPath . replace ( / \\ / g, '\\\\' ) } ` ) ;
2969+ await expect ( page . locator ( '#fallback-error' ) ) . toContainText (
2970+ 'The Playwright Trace Viewer must be loaded over the http:// or https:// protocols.'
2971+ ) ;
2972+ const expectedReportPath = reportPath . replace ( / \\ / g, '\\\\' ) ;
2973+ await expect ( page . locator ( '#fallback-error' ) ) . toContainText (
2974+ `npx playwright show-report "${ expectedReportPath } "`
2975+ ) ;
29702976 } ) ;
29712977
2978+
29722979 test ( 'should not collate identical file names in different project directories' , async ( { runInlineTest, page } ) => {
29732980 await runInlineTest ( {
29742981 'playwright.config.ts' : `
0 commit comments