Commit graph

39 commits

Author SHA1 Message Date
Pavel Feldman f54478a23e
chore: move utils that are user in server to server/utils (3) (#34739) 2025-02-12 09:34:01 -08:00
Pavel Feldman 46b048f018
chore: vendor stack utils (#34719) 2025-02-11 12:53:08 -08:00
Pavel Feldman 4a7f6a6ef0
chore: organize imports in playwright-core (#34680) 2025-02-07 13:54:01 -08:00
Dmitry Gozman be6caed8df
chore: remove expectZone (#34312) 2025-01-16 18:53:32 +00:00
Pavel Feldman c76f004ec3
chore: move compress call log to server (#33399) 2024-11-01 13:38:01 -07:00
Max Schmitt b275c19612
chore: update eslintignore to lint files in utils/ folders (#33218) 2024-10-22 11:52:20 +02:00
Pavel Feldman 2a3d67195d
chore: use aria snapshots in some ui mode tests (#33212) 2024-10-21 21:54:06 -07:00
Yury Semikhatsky fb319e6d3d
fix: match client step and server action by explicit stepId (#30641)
Matching bu `apiName@wallTime` fails when two actions start at the same
time, e.g. two parallel api requests. Moreover, it results in trace
actions that have parent set to themselves, which in turn causes
infinite loop in the trace viewer. To avoid this problems we write
stepId explicitly to the library trace and use those step ids to find
corresponding test runner steps.

The stepId is passed via zone in case of expect, because the protocol
step is quite deep in the call chain after or explicitly in case of API
call steps created by the test runner instrumentation.
2024-05-14 12:10:46 -07:00
Dmitry Gozman 086ea79c25
chore: remove checkCoverage script (#30552)
We do not benefit from it for many years already.
2024-04-25 14:00:14 -07:00
Yury Semikhatsky 73fce8fb98
chore: replace Zones with AsyncLocalStorage (#30381)
Reference https://github.com/microsoft/playwright/issues/30322
2024-04-16 12:51:20 -07:00
Pavel Feldman f212fd1a83
chore: unify target closed errors (#27540) 2023-10-12 11:05:34 -07:00
Pavel Feldman 11a4b3f7f5
chore: remove parsed stack trace (#27496) 2023-10-09 17:04:16 -07:00
Pavel Feldman b868f3a9d0
chore: extend raw stack (#22794) 2023-05-03 13:53:02 -07:00
Pavel Feldman 09f77c41dd
chore: migrate to protocol's StackFrame type (#21198) 2023-02-24 18:36:15 -08:00
Pavel Feldman 3fa19e80ad
chore: wrap expect call in a zone (#21191) 2023-02-24 12:17:03 -08:00
Pavel Feldman 3f8f2a0fdd
chore: do not use library stack capturer in test runner (#21075) 2023-02-21 19:24:17 -08:00
Pavel Feldman 06fc72b6ed
revert(#12706): also fix related bugs it introduced (#21070) 2023-02-21 14:15:11 -08:00
Max Schmitt df05c00da3
fix: filter out pwt stacks correctly (#20158)
Fixes https://github.com/microsoft/playwright/issues/20155
2023-01-17 22:38:30 +01:00
Max Schmitt 09e6bb9c0f
chore: sunset Node.js 12 (#16512) 2022-08-15 18:10:04 +02:00
Max Schmitt 57fcb590f7
chore: hide stackTrace.js from recorded frames (#16242) 2022-08-08 23:27:59 +02:00
Dmitry Gozman 5481e25015
chore: print full stacks when PWDEBUGIMPL is set (#16113)
For debugging purposes, especially on the client's computers.
2022-08-01 13:44:59 -07:00
Max Schmitt 3d1d723c56
fix(esm): show codeframe when errors get reported (#15262) 2022-06-30 21:17:08 +02:00
Pavel Feldman 3c896f6bc5
fix(tests): installation tests (#13623) 2022-04-18 22:17:56 -07:00
Pavel Feldman 63ea81ec54
chore: make bundles typed (#13620) 2022-04-18 17:50:25 -07:00
Pavel Feldman 58d79e5e4d
chore: add core utils bundle (#13615) 2022-04-18 13:47:23 -07:00
Pavel Feldman a3c02222bf
chore: use utils via index export (4) (#13404) 2022-04-07 14:36:13 -07:00
Pavel Feldman 40d5e3a3c9
chore: use utils via index export (3) (#13403) 2022-04-07 13:55:44 -07:00
Pavel Feldman 5ae2017a5b
chore: always import type (#13365) 2022-04-06 14:57:14 -07:00
Andrey Lushnikov 88610c8b4c
fix: properly define apiName for web-first assertions (#12706)
Turns out relying on PWTRAP in stack is not reliable: depending on the
call structure, the stack might be cut unpredictably by Node.js.

This patch removes PWTRAP and instead plumbs explicit stack and
pre-set `apiName` all the way down to `wrapApiCall`.
2022-03-14 18:01:13 -07:00
Pavel Feldman 1b3c7c03b6
chore: fix(stack): ignore stack frames inside whole core (#11935) 2022-02-08 10:33:50 -08:00
Andrey Lushnikov b0daa7754f
feat: filter stack traces to exclude test runner frames (#11795)
Before:

```bash
Running 1 test using 1 worker
  1) [chromium] › tests/example.spec.ts:3:1 › should work ==========================================

    Error: expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 1

      2 |
      3 | test('should work', async({page}) => {
    > 4 |   expect(1).toBe(2);
        |             ^
      5 | });
      6 |

        at Proxy.<anonymous> (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/expect.ts:151:30)
        at /Users/andreylushnikov/tmp/tests/example.spec.ts:4:13
        at /Users/andreylushnikov/prog/playwright/packages/playwright-test/src/workerRunner.ts:335:13
        at runNextTicks (node:internal/process/task_queues:61:5)
        at processImmediate (node:internal/timers:437:9)
        at TestInfoImpl._runFn (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/testInfo.ts:164:7)
        at WorkerRunner._runTestWithBeforeHooks (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/workerRunner.ts:317:24)
        at TimeoutRunner.run (/Users/andreylushnikov/prog/playwright/packages/playwright-core/src/utils/async.ts:48:14)
        at TestInfoImpl._runWithTimeout (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/testInfo.ts:151:7)
        at WorkerRunner._runTestOrAllHook (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/workerRunner.ts:276:5)
        at WorkerRunner._runSuite (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/workerRunner.ts:190:11)
        at WorkerRunner.run (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/workerRunner.ts:137:9)
        at process.<anonymous> (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/worker.ts:87:5)
```

after:

```
Running 1 test using 1 worker
  1) [chromium] › tests/example.spec.ts:3:1 › should work ==========================================

    Error: expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 1

      2 |
      3 | test('should work', async({page}) => {
    > 4 |   expect(1).toBe(2);
        |             ^
      5 | });
      6 |

        at /Users/andreylushnikov/tmp/tests/example.spec.ts:4:13
```
2022-02-01 18:40:44 -08:00
Andrey Lushnikov 13dd41c2e3
devops: fix self-hosted runner stack collection (#11169)
In case of self-hosted github runners, it's much easier to checkout
under `playwright-internal` folder name instead of a default
`playwright` name. This confuses our stack collection.

This patch makes it generic.
2022-01-04 06:23:28 -08:00
Pavel Feldman b302152789
chore(zones): prepare to remove wrapApiCall, introduce zones (#10427) 2021-11-18 22:30:09 -08:00
Max Schmitt ac629afd46
chore: fix API name capitalisation with APIRequestContext (#10240) 2021-11-11 08:46:17 -08:00
Max Schmitt ceedf45d4a
fix: support .mjs files with Playwright Inspector (#10043) 2021-11-05 12:28:52 +01:00
Pavel Feldman 273122b761
chore: align internal test harness w/ @playwright/test (#9796) 2021-10-26 13:45:53 -07:00
Pavel Feldman 2d4db7a6f0
fix(stack): hide test runner stack frames (#9735) 2021-10-25 11:49:59 -07:00
Pavel Feldman e31b96cc26
feat(tracing): make context.request appear in the trace (#9555) 2021-10-15 15:22:49 -07:00
Joel Einbinder c89d5a50dd
chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
Renamed from src/utils/stackTrace.ts (Browse further)