playwright/tests/playwright-test
Dmitry Gozman 16a779a5ff
fix(test runner): show codeframe and location from the error top stack frame (#11179)
Previously, reporter would look for a stack frame directly in the test file.
Often times, that is not a top stack frame, especially when the test uses
some helper functions.

This changes error snippets and locations to use the top frame. When top
frame does not match the test file, we additionally show the location
to avoid confusion:

```
  1) a.spec.ts:7:7 › foobar ========================================================================

    Error: oh my

       at helper.ts:5

      3 |
      4 |       export function ohMy() {
    > 5 |         throw new Error('oh my');
        |               ^
      6 |       }
      7 |

        at ohMy (.../reporter-base-should-print-codeframe-from-a-helper/helper.ts:5:15)
        at .../reporter-base-should-print-codeframe-from-a-helper/a.spec.ts:8:9
        at FixtureRunner.resolveParametersAndRunHookOrTest (.../src/fixtures.ts:281:12)
```
2022-01-04 16:00:55 -08:00
..
assets chore: add blink-diff third party library (#10984) 2021-12-17 15:53:37 -08:00
stable-test-runner chore: roll stable-test-runner to dec-18-2021 (#11008) 2021-12-18 10:12:35 -08:00
access-data.spec.ts feat(test-runner): introduce attachments (#7685) 2021-07-16 13:48:37 -07:00
basic.spec.ts feat(test runner): allow top-level test.fixme similar to test.skip (#10250) 2021-11-19 11:40:40 -08:00
blink-diff.spec.ts fix(test runner): show codeframe and location from the error top stack frame (#11179) 2022-01-04 16:00:55 -08:00
config.spec.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
exit-code.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
expect.spec.ts feat(test-runner): specific playwright types for expect (#10670) 2021-12-13 13:42:36 -05:00
fixture-errors.spec.ts fix(fixtures): await fixture teardown when shutting down the worker (#11033) 2021-12-20 16:19:21 -08:00
fixtures.spec.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
gitignore.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
global-setup.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
golden.spec.ts fix(html reporter): fix too much strikethrough in diffs (#11115) 2021-12-28 09:56:34 -08:00
hooks.spec.ts fix(test runner): show the location of afterAll timeout (#11007) 2021-12-18 09:32:41 -08:00
list-mode.spec.ts chore: add npm run lint-tests (#10252) 2021-11-11 13:27:50 -08:00
loader.spec.ts feat(esm): introduce experimental PW_EXPERIMENTAL_TS_ESM option (#10519) 2021-11-24 14:17:01 -08:00
match-grep.spec.ts test(test-runner): add tests to show that grep is case insensitive (#8091) 2021-08-09 14:05:51 -04:00
max-failures.spec.ts chore(test runner): create TestResult instances lazily in dispatcher (#10921) 2021-12-14 14:10:56 -08:00
override-timeout.spec.ts test(test-runner): unflake override-timeout.spec.ts (#7869) 2021-07-29 13:34:46 -07:00
playwright-test-fixtures.ts chore: roll stable-test-runner to dec-18-2021 (#11008) 2021-12-18 10:12:35 -08:00
playwright-test.config.ts chore: introduce docker integration dogfood (#9998) 2021-11-03 15:26:18 -07:00
playwright.artifacts.spec.ts feat(test runner): save traces for beforeAll/afterAll hooks (#10950) 2021-12-15 16:06:10 -08:00
playwright.expect.misc.spec.ts feat(expect): show expect timeout in the error message (#10388) 2021-11-17 17:28:30 -08:00
playwright.expect.text.spec.ts feat(inputValue): allow on labels, retarget (#10666) 2021-12-02 10:31:06 -08:00
playwright.expect.true.spec.ts feat(toBeChecked): allow passing checked: false (#10665) 2021-12-02 10:31:26 -08:00
playwright.fetch.spec.ts test: add missing request tests (#9343) 2021-10-06 10:15:13 -07:00
playwright.spec.ts fix(test-runner): apply default options to all browserTypes (#10507) 2021-11-29 12:21:15 -05:00
playwright.trace.spec.ts feat(test-runner): allow specifying fine-grained trace options (#10147) 2021-11-08 15:39:58 -08:00
repeat-each.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
reporter-attachment.spec.ts feat(api): add explicit async testInfo.attach (#10121) 2021-11-23 09:30:53 -08:00
reporter-base.spec.ts fix(test runner): show codeframe and location from the error top stack frame (#11179) 2022-01-04 16:00:55 -08:00
reporter-dot.spec.ts feat(html): unhide html reporter (#9512) 2021-10-14 11:17:35 -07:00
reporter-github.spec.ts fix(github reporter): handle global onError (#10256) 2021-11-11 13:25:38 -08:00
reporter-html.spec.ts feat(html): group similar items in the report (#11160) 2022-01-03 21:17:17 -08:00
reporter-json.spec.ts feat(reporters): augment non-stdio reporters with dot/line (#10003) 2021-11-03 08:25:16 -07:00
reporter-junit.spec.ts feat(html): unhide html reporter (#9512) 2021-10-14 11:17:35 -07:00
reporter-line.spec.ts feat(reporters): show retry #x when running a test (#11003) 2021-12-17 21:07:04 -08:00
reporter-list.spec.ts feat(reporters): show retry #x when running a test (#11003) 2021-12-17 21:07:04 -08:00
reporter-raw.spec.ts fix(html): render text attachments as text (#10778) 2021-12-08 08:51:44 -08:00
reporter.spec.ts feat(test runner): show beforeAll/afterAll hooks similar to tests (#10923) 2021-12-15 10:39:49 -08:00
resolver.spec.ts feat(tsconfig): respect baseUrl and paths from tsconfig (#10525) 2021-12-08 22:43:00 -08:00
retry.spec.ts feat(test runner): show beforeAll/afterAll hooks similar to tests (#10923) 2021-12-15 10:39:49 -08:00
runner.spec.ts feat(test runner): rewrite dispatcher to avoid unneded stalls (#9629) 2021-10-22 11:10:37 -07:00
shard.spec.ts fix(test runner): disallow use(workerFixture) in describes (#8119) 2021-08-10 16:32:32 -07:00
stdio.spec.ts feat(test runner): show beforeAll/afterAll hooks similar to tests (#10923) 2021-12-15 10:39:49 -08:00
test-extend.spec.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
test-ignore.spec.ts test: improve child process utilities in tests (#9036) 2021-09-20 17:17:12 -07:00
test-info.spec.ts feat(test.info): expose information on the currently running test (#10708) 2021-12-06 09:25:11 -08:00
test-modifiers.spec.ts fix(test runner): show the location of afterAll timeout (#11007) 2021-12-18 09:32:41 -08:00
test-output-dir.spec.ts feat(test-runner): shorten long output paths (#10523) 2021-12-13 10:56:03 -08:00
test-parallel.spec.ts feat(test runner): describe.parallel (#8662) 2021-09-02 15:42:07 -07:00
test-serial.spec.ts fix(test runner): proper serial mode with beforeAll/afterAll failures (#9183) 2021-09-27 15:58:26 -07:00
test-step.spec.ts fix(stack): hide test runner stack frames (#9735) 2021-10-25 11:49:59 -07:00
test-use.spec.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
timeout.spec.ts fix(test runner): test.setTimeout whould not break debugging (#11004) 2021-12-17 15:17:48 -08:00
types-2.spec.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
types.spec.ts Revert "feat(test-runner): allow parametrized tests that don't extend base (#9301)" 2021-10-11 17:32:31 +02:00
web-server.spec.ts test: using custom baseURL with webServer (#10539) 2021-11-29 17:41:26 +01:00
worker-index.spec.ts feat(test runner): introduce TestInfo.parallelIndex (#9762) 2021-11-01 10:37:34 -07:00