fix: quote trace file path when printing error message (#29052)
Fixes https://github.com/microsoft/playwright/issues/29039
This commit is contained in:
		
							parent
							
								
									4a45724633
								
							
						
					
					
						commit
						c76f5294ce
					
				|  | @ -331,7 +331,7 @@ export function formatFailure(config: FullConfig, test: TestCase, options: {inde | ||||||
|             const packageManagerCommand = getPackageManagerExecCommand(); |             const packageManagerCommand = getPackageManagerExecCommand(); | ||||||
|             resultLines.push(colors.cyan(`    Usage:`)); |             resultLines.push(colors.cyan(`    Usage:`)); | ||||||
|             resultLines.push(''); |             resultLines.push(''); | ||||||
|             resultLines.push(colors.cyan(`        ${packageManagerCommand} playwright show-trace ${relativePath}`)); |             resultLines.push(colors.cyan(`        ${packageManagerCommand} playwright show-trace "${relativePath}"`)); | ||||||
|             resultLines.push(''); |             resultLines.push(''); | ||||||
|           } |           } | ||||||
|         } else { |         } else { | ||||||
|  |  | ||||||
|  | @ -66,7 +66,7 @@ test('render trace attachment', async ({ runInlineTest }) => { | ||||||
|       test('one', async ({}, testInfo) => { |       test('one', async ({}, testInfo) => { | ||||||
|         testInfo.attachments.push({ |         testInfo.attachments.push({ | ||||||
|           name: 'trace', |           name: 'trace', | ||||||
|           path: testInfo.outputPath('trace.zip'), |           path: testInfo.outputPath('my dir with space', 'trace.zip'), | ||||||
|           contentType: 'application/zip' |           contentType: 'application/zip' | ||||||
|         }); |         }); | ||||||
|         expect(1).toBe(0); |         expect(1).toBe(0); | ||||||
|  | @ -75,8 +75,8 @@ test('render trace attachment', async ({ runInlineTest }) => { | ||||||
|   }, { reporter: 'line' }); |   }, { reporter: 'line' }); | ||||||
|   const text = result.output.replace(/\\/g, '/'); |   const text = result.output.replace(/\\/g, '/'); | ||||||
|   expect(text).toContain('    attachment #1: trace (application/zip) ─────────────────────────────────────────────────────────'); |   expect(text).toContain('    attachment #1: trace (application/zip) ─────────────────────────────────────────────────────────'); | ||||||
|   expect(text).toContain('    test-results/a-one/trace.zip'); |   expect(text).toContain('    test-results/a-one/my dir with space/trace.zip'); | ||||||
|   expect(text).toContain('npx playwright show-trace test-results/a-one/trace.zip'); |   expect(text).toContain('npx playwright show-trace "test-results/a-one/my dir with space/trace.zip"'); | ||||||
|   expect(text).toContain('    ────────────────────────────────────────────────────────────────────────────────────────────────'); |   expect(text).toContain('    ────────────────────────────────────────────────────────────────────────────────────────────────'); | ||||||
|   expect(result.exitCode).toBe(1); |   expect(result.exitCode).toBe(1); | ||||||
| }); | }); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue