playwright/tests
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
..
android test: migrate to upstream fixtures (#9835) 2021-10-28 08:31:30 -07:00
assets feat(firefox-beta): roll to r1310 (#10954) 2021-12-15 17:33:09 -08:00
chromium test(chromium): ensure that arguments can be passed with spaces (#10057) 2021-11-23 02:59:56 -05:00
config feat(proxy): unify local network proxy behavior (#10719) 2021-12-10 14:01:56 -08:00
electron fix(electron): make recordVideo work (#10810) 2021-12-08 17:34:50 -08:00
emulation-focus.spec.ts-snapshots test: roll to folio@0.4.0-alpha28 (#6918) 2021-06-04 20:54:58 -07:00
firefox test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
inspector fix(inspector): do not show internal calls (#10982) 2021-12-16 17:17:24 -08:00
page test: skip fill tests for android (#11155) 2022-01-03 15:02:31 -08:00
playwright-test fix(test runner): show codeframe and location from the error top stack frame (#11179) 2022-01-04 16:00:55 -08:00
screenshot.spec.ts-snapshots test: add screenshot test with hanging main resource (#9972) 2021-11-02 16:55:32 +01:00
trace-viewer test: mark trace-viewer tests as slow, unflake resource order (#11070) 2021-12-22 11:17:43 -08:00
beforeunload.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browser.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-add-cookies.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-add-init-script.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-base-url.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-basic.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-clearcookies.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-cookies.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-credentials.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-csp.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-device.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-dsf.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-expose-function.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-fetch.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-locale.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-network-event.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-page-event.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-pages.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-proxy.spec.ts feat(proxy): unify local network proxy behavior (#10719) 2021-12-10 14:01:56 -08:00
browsercontext-route.spec.ts feat(firefox-beta): roll to r1310 (#10954) 2021-12-15 17:33:09 -08:00
browsercontext-set-extra-http-headers.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-storage-state.spec.ts fix: support cookies with empty value (#9376) 2021-10-07 15:37:47 -07:00
browsercontext-strict.spec.ts fix: strict mode on page.* methods on context level (#8324) 2021-08-19 23:08:28 +02:00
browsercontext-timezone-id.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
browsercontext-user-agent.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-viewport-mobile.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-viewport.spec.ts test: newContext works when both screen and viewport specified (#9520) 2021-10-18 10:45:47 -07:00
browsertype-basic.spec.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
browsertype-connect.spec.ts feat(tracing): pack sources to trace on the driver side (#10815) 2021-12-09 17:21:17 -08:00
browsertype-launch-selenium.spec.ts test: move grid tests to installation-tests (#10418) 2021-11-18 15:32:09 -08:00
browsertype-launch-server.spec.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
browsertype-launch.spec.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
capabilities.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
channels.spec.ts feat(firefox-beta): roll to r1310 (#10954) 2021-12-15 17:33:09 -08:00
component-parser.spec.ts fix(monorepo): explicitly list package.json exports instead of using glob patterns (#9584) 2021-10-19 12:28:02 -04:00
css-parser.spec.ts fix(monorepo): explicitly list package.json exports instead of using glob patterns (#9584) 2021-10-19 12:28:02 -04:00
defaultbrowsercontext-1.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
defaultbrowsercontext-2.spec.ts test: reenable Chromium Windows cookies test (#11176) 2022-01-04 12:14:35 -08:00
download.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
downloads-path.spec.ts feat(acceptDownload): revert acceptDownload (#10709) 2021-12-06 09:25:24 -08:00
emulation-focus.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
favicon.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
geolocation.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
global-fetch-cookie.spec.ts chore(fetch): rename ApiRequest* to APIRequest* (#9606) 2021-10-19 07:38:27 -07:00
global-fetch.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
har.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
headful.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
hit-target.spec.ts feat(input): restore modified layout shift check (#11032) 2022-01-03 17:46:04 -08:00
ignorehttpserrors.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
index.d.ts test: added tests for WebSocket over Socks proxy (#7235) 2021-06-24 18:50:16 +02:00
launcher.spec.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
logger.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
modernizr.spec.ts feat(webkit): roll to r1578 (#10323) 2021-11-15 08:43:51 -08:00
pdf.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
permissions.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
popup.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
port-forwarding-server.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
proxy.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
resource-timing.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
screenshot.spec.ts chore(chromium): Capture off-screen content without resizing viewport (#10606) 2021-11-30 14:11:15 -08:00
selector-generator.spec.ts chore: escape CSS selectors in codegen correctly (#10608) 2021-11-30 21:13:41 +01:00
selectors-register.spec.ts chore(zones): prepare to remove wrapApiCall, introduce zones (#10427) 2021-11-18 22:30:09 -08:00
signals.spec.ts fix: do not show taskkill.exe output (#10244) 2021-11-11 18:32:22 +01:00
slowmo.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
snapshotter.spec.ts fix(tracing): trace frame (#10846) 2021-12-17 10:43:19 -08:00
tap.spec.ts feat(input): restore modified layout shift check (#11032) 2022-01-03 17:46:04 -08:00
tracing.spec.ts test(tracing): skip test in ff and wk (#10955) 2021-12-15 17:40:34 -08:00
tsconfig.json fix: support even older node 12 (#9718) 2021-10-22 15:59:52 -04:00
video.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00
web-socket.spec.ts test: introduce #smoke tests (#11135) 2021-12-29 18:51:28 -08:00