@@ -194,10 +194,10 @@ test('should include the project name', async ({ runInlineTest }) => {
194194 expect ( result . output ) . toContain ( 'my-test.spec.js-snapshots/bar-foo.txt' ) ;
195195
196196 // test1, run with bar
197- expect ( result . output ) . toContain ( 'test-results/my-test-test-1-Bar-space-dc1461 /bar.txt' ) ;
198- expect ( result . output ) . toContain ( 'my-test.spec.js-snapshots/bar-Bar-space-dc1461 .txt' ) ;
199- expect ( result . output ) . toContain ( 'test-results/my-test-test-1-Bar-space-dc1461 -retry1/bar.txt' ) ;
200- expect ( result . output ) . toContain ( 'my-test.spec.js-snapshots/bar-Bar-space-dc1461 .txt' ) ;
197+ expect ( result . output ) . toContain ( 'test-results/my-test-test-1-Bar-space-/bar.txt' ) ;
198+ expect ( result . output ) . toContain ( 'my-test.spec.js-snapshots/bar-Bar-space-.txt' ) ;
199+ expect ( result . output ) . toContain ( 'test-results/my-test-test-1-Bar-space--retry1/bar.txt' ) ;
200+ expect ( result . output ) . toContain ( 'my-test.spec.js-snapshots/bar-Bar-space-.txt' ) ;
201201
202202 // test2, run with empty
203203 expect ( result . output ) . toContain ( 'test-results/my-test-test-2/bar.txt' ) ;
@@ -212,8 +212,8 @@ test('should include the project name', async ({ runInlineTest }) => {
212212 expect ( result . output ) . toContain ( 'my-test.spec.js-snapshots/bar-foo-suffix.txt' ) ;
213213
214214 // test2, run with bar
215- expect ( result . output ) . toContain ( 'test-results/my-test-test-2-Bar-space-dc1461 /bar.txt' ) ;
216- expect ( result . output ) . toContain ( 'my-test.spec.js-snapshots/bar-Bar-space-dc1461 -suffix.txt' ) ;
215+ expect ( result . output ) . toContain ( 'test-results/my-test-test-2-Bar-space-/bar.txt' ) ;
216+ expect ( result . output ) . toContain ( 'my-test.spec.js-snapshots/bar-Bar-space--suffix.txt' ) ;
217217} ) ;
218218
219219test ( 'should include path option in snapshot' , async ( { runInlineTest } ) => {
@@ -401,58 +401,6 @@ test('should allow nonAscii characters in the output dir', async ({ runInlineTes
401401 expect ( outputDir ) . toBe ( path . join ( testInfo . outputDir , 'test-results' , 'my-test-こんにちは世界' ) ) ;
402402} ) ;
403403
404- test ( 'should not collide with other tests when nonAscii characters are replaced' , async ( { runInlineTest } ) => {
405- test . info ( ) . annotations . push ( { type : 'issue' , description : 'https://github.com/microsoft/playwright/issues/23386' } ) ;
406- const result = await runInlineTest ( {
407- 'my-test.spec.js' : `
408- import { test, expect } from '@playwright/test';
409- const specialChars = ['>', '=', '<', '+', '#', '-', '.', '!', '$', '%', '&', '\\'', '*', '/', '?', '^', '_', '\`', '{', '|', '}', '~', '(', ')', '[', ']', '@'];
410- for (const char of specialChars) {
411- test('test' + char, async ({}, testInfo) => {
412- console.log('\\n%%' + testInfo.outputDir);
413- });
414- }
415- ` ,
416- } ) ;
417- expect ( result . exitCode ) . toBe ( 0 ) ;
418- const outputDirs = result . outputLines ;
419- expect ( outputDirs . length ) . toBe ( 27 ) ;
420- expect ( new Set ( outputDirs ) . size ) . toBe ( outputDirs . length ) ;
421- const forbiddenCharacters = [ '\\' , '/' , ':' , '*' , '?' , '"' , '<' , '>' , '|' , '%' ] ;
422- for ( const outputDir of outputDirs ) {
423- const relativePath = path . relative ( path . join ( test . info ( ) . outputDir , 'test-results' ) , outputDir ) ;
424- for ( const forbiddenCharacter of forbiddenCharacters )
425- expect ( relativePath ) . not . toContain ( forbiddenCharacter ) ;
426- }
427- } ) ;
428-
429- test ( 'should generate expected output dir names' , async ( { runInlineTest } , testInfo ) => {
430- const runTests = async ( fileName : string , testNames : string [ ] ) => {
431- const result = await runInlineTest ( {
432- [ fileName ] : `
433- import { test, expect } from '@playwright/test';
434- ${ testNames . map ( name => `test('${ name } ', async ({}, testInfo) => console.log('\\n%%' + testInfo.outputDir));` ) . join ( '\n' ) }
435- ` ,
436- } ) ;
437- expect ( result . exitCode ) . toBe ( 0 ) ;
438- const outputDirs = result . outputLines . map ( line => path . relative ( path . join ( testInfo . outputDir , 'test-results' ) , line ) ) ;
439- return outputDirs ;
440- } ;
441- expect ( await runTests ( 'filename.spec.js' , [
442- 'testing > foo' ,
443- 'testing multiple spaces' ,
444- 'testing multiple spaces' ,
445- '!!!hello!!!' ,
446- 'dashes-are-used' ,
447- ] ) ) . toEqual ( [
448- 'filename-testing-foo-574286' ,
449- 'filename-testing-multiple-spaces' ,
450- 'filename-testing-multiple-spaces-f5d359' ,
451- 'filename-hello-8eb257' ,
452- 'filename-dashes-are-used-c67e31' ,
453- ] ) ;
454- } ) ;
455-
456404test ( 'should allow shorten long output dirs characters in the output dir' , async ( { runInlineTest } , testInfo ) => {
457405 const result = await runInlineTest ( {
458406 'very/deep/and/long/file/name/that/i/want/to/be/trimmed/my-test.spec.js' : `
@@ -478,7 +426,7 @@ test('should not mangle double dashes', async ({ runInlineTest }, testInfo) => {
478426 ` ,
479427 } ) ;
480428 const outputDir = result . outputLines [ 0 ] ;
481- expect ( outputDir ) . toBe ( path . join ( testInfo . outputDir , 'test-results' , 'my--file-my-test-68b7dd ' ) ) ;
429+ expect ( outputDir ) . toBe ( path . join ( testInfo . outputDir , 'test-results' , 'my--file-my--test ' ) ) ;
482430} ) ;
483431
484432test ( 'should allow include the describe name the output dir' , async ( { runInlineTest } , testInfo ) => {
0 commit comments