@@ -486,72 +486,5 @@ for (const useIntermediateMergeReport of [false, true] as const) {
486
486
expect ( text ) . toContain ( '› passes @bar1 @bar2 (' ) ;
487
487
expect ( text ) . toContain ( '› passes @baz1 @baz2 (' ) ;
488
488
} ) ;
489
-
490
- test . skip ( 'should show warnings on failing tests' , async ( { runInlineTest } ) => {
491
- const result = await runInlineTest ( {
492
- 'a.spec.ts' : `
493
- import { test, expect } from '@playwright/test';
494
- test('fail', async ({ page }, testInfo) => {
495
- testInfo.annotations.push({ type: 'warning', description: 'foo' });
496
- expect(page.locator('div')).toHaveText('A', { timeout: 100 });
497
- throw new Error();
498
- });
499
- ` ,
500
- } ) ;
501
- expect ( result . exitCode ) . toBe ( 1 ) ;
502
- expect ( result . passed ) . toBe ( 0 ) ;
503
- expect ( result . output ) . toContain ( 'Warning: a.spec.ts:5:41: This async call was not awaited by the end of the test.' ) ;
504
- expect ( result . output ) . toContain ( 'Warning: foo' ) ;
505
- } ) ;
506
-
507
- test . skip ( 'should not show warnings on passing tests' , async ( { runInlineTest } ) => {
508
- const result = await runInlineTest ( {
509
- 'a.spec.ts' : `
510
- import { test, expect } from '@playwright/test';
511
- test('success', async ({ page }, testInfo) => {
512
- testInfo.annotations.push({ type: 'warning', description: 'foo' });
513
- });
514
- ` ,
515
- } ) ;
516
- expect ( result . exitCode ) . toBe ( 0 ) ;
517
- expect ( result . passed ) . toBe ( 1 ) ;
518
- expect ( result . output ) . not . toContain ( 'Warning: foo' ) ;
519
- } ) ;
520
-
521
- test . skip ( 'should properly sort warnings' , async ( { runInlineTest } ) => {
522
- const result = await runInlineTest ( {
523
- 'external.js' : `
524
- import { expect } from '@playwright/test';
525
- export const externalAsyncCall = (page) => {
526
- expect(page.locator('div')).toHaveText('A', { timeout: 100 });
527
- };
528
- ` ,
529
- 'a.spec.ts' : `
530
- import { test, expect } from '@playwright/test';
531
- import { externalAsyncCall } from './external.js';
532
- test('fail a', async ({ page }, testInfo) => {
533
- testInfo.annotations.push({ type: 'warning', description: 'foo' });
534
- externalAsyncCall(page);
535
- expect(page.locator('div')).toHaveText('A', { timeout: 100 });
536
- testInfo.annotations.push({ type: 'warning', description: 'bar' });
537
- throw new Error();
538
- });
539
- ` ,
540
- } ) ;
541
- expect ( result . exitCode ) . toBe ( 1 ) ;
542
- expect ( result . passed ) . toBe ( 0 ) ;
543
- expect ( result . output ) . toContain ( 'Warning: a.spec.ts:7:41: This async call was not awaited by the end of the test.' ) ;
544
- expect ( result . output ) . toContain ( 'Warning: external.js:4:41: This async call was not awaited by the end of the test.' ) ;
545
- expect ( result . output ) . toContain ( 'Warning: foo' ) ;
546
- expect ( result . output ) . toContain ( 'Warning: bar' ) ;
547
-
548
- const manualIndexFoo = result . output . indexOf ( 'Warning: foo' ) ;
549
- const manualIndexBar = result . output . indexOf ( 'Warning: bar' ) ;
550
- const externalIndex = result . output . indexOf ( 'Warning: external.js:4:41' ) ;
551
- const specIndex = result . output . indexOf ( 'Warning: a.spec.ts:7:41' ) ;
552
- expect ( specIndex ) . toBeLessThan ( externalIndex ) ;
553
- expect ( externalIndex ) . toBeLessThan ( manualIndexFoo ) ;
554
- expect ( manualIndexFoo ) . toBeLessThan ( manualIndexBar ) ;
555
- } ) ;
556
489
} ) ;
557
490
}
0 commit comments