Commit Graph

1125 Commits

Author SHA1 Message Date
Yury Semikhatsky
52feff39b3
chore: run primary tests with blob reporter (#23076) 2023-05-17 09:10:31 -07:00
Pavel Feldman
04070a59e1
chore: remove expect.configure({poll}) (#23060) 2023-05-16 18:45:03 -07:00
Dmitry Gozman
fc2e0e76bd
feat(teardown): allow the same project to be a teardown for multiple (#23074) 2023-05-16 18:26:06 -07:00
Yury Semikhatsky
2d3ab74d22
chore: roll stable test runner (#23075) 2023-05-16 18:02:53 -07:00
Dmitry Gozman
fec5059fee
feat(connect): print debug log when remote connection failed (#23069) 2023-05-16 16:46:02 -07:00
Max Schmitt
89f1940509
chore: be able to hide webServer stderr (#23063)
Follow-up to https://github.com/microsoft/playwright/pull/22564.
2023-05-17 00:46:59 +02:00
Yury Semikhatsky
ed19e5403b
feat: merge config properties (#23071) 2023-05-16 15:15:11 -07:00
Pavel Feldman
2fc6341841
chore: remove node version checks from esm tests (#23031) 2023-05-16 11:07:34 -07:00
Dmitry Gozman
f469e4b1eb
fix(expect): mark step as failed when async custom matcher throws (#23035)
Fixes #23021.
2023-05-15 19:37:12 -07:00
Max Schmitt
edd003c230
chore: validate expected image buffer when comparing images (#23030)
Fixes https://github.com/microsoft/playwright/issues/23012
2023-05-15 23:32:16 +02:00
Pavel Feldman
4c4085e105
chore: partially hide built-in fixture steps (#23005) 2023-05-12 19:15:31 -07:00
Yury Semikhatsky
576d91fe80
fix: unique resource names between shards (#23004) 2023-05-12 18:21:43 -07:00
Pavel Feldman
083d13a13d
chore: surface syntax error in ui mode (#22982)
Fixes https://github.com/microsoft/playwright/issues/22863
2023-05-12 14:23:22 -07:00
Yury Semikhatsky
3ccec7eae5
feat(merge): generate html report with links to remote resources (#22968) 2023-05-12 09:26:04 -07:00
Pavel Feldman
e6d8cf9693
chore: include plugin list into the cache digest (#22946)
Fixes https://github.com/microsoft/playwright/issues/22931
2023-05-11 21:09:15 -07:00
Dmitry Gozman
9ffe33fae8
feat(test runner): support tsconfig.extends array (#22975)
Fixes #22151.
2023-05-11 19:18:13 -07:00
Pavel Feldman
59b9a39740
chore: add string attachments to trace (#22921) 2023-05-11 16:32:32 -07:00
Dmitry Gozman
44a934c160
feat(test runner): support .cjs and .cts files (#22971)
Fixes #22579.
2023-05-11 15:41:50 -07:00
Yury Semikhatsky
c9dad439cd
chore: write uncompressed blob report (#22945) 2023-05-10 15:08:53 -07:00
Pavel Feldman
5e0574dc44
chore: list attachments in the trace (#22919)
Fixes https://github.com/microsoft/playwright/issues/22736
2023-05-09 17:53:01 -07:00
Dmitry Gozman
cd49f5c466
feat(typescript): align with --moduleResolution=bundler (#22887)
This relaxes import requirements and allows importing `.ts` files
without an extension in CJS and ESM modes.

Fixes #22169.
2023-05-09 16:26:29 -07:00
Pavel Feldman
0bf297f523
fix(trace): merge step hierarchies (#22916) 2023-05-09 14:50:28 -07:00
Alex Neo
5bd5cea705
feat(html): describe labels (#22870) 2023-05-08 18:59:01 -07:00
Pavel Feldman
b10cc03314
chore: render parse errors in the UI mode (#22888)
Fixes: https://github.com/microsoft/playwright/issues/22863
2023-05-08 18:51:27 -07:00
Pavel Feldman
9771b1ee74
chore: show steps for fixtures (#22860)
Fixes https://github.com/microsoft/playwright/issues/22565
2023-05-06 10:25:32 -07:00
Dmitry Gozman
03616e976e
fix(deps): --repeat-each should not apply to dependencies (#22858)
Fixes #21778.
2023-05-05 16:59:39 -07:00
Pavel Feldman
efad19b332
chore: render test steps in the trace (#22837) 2023-05-05 15:12:18 -07:00
Pavel Feldman
9c25a04267
chore: use custom JSX runtime to stub-out erroneous JSX usage (#22827)
Fixes https://github.com/microsoft/playwright/issues/22789
2023-05-04 11:44:59 -07:00
Pavel Feldman
78203bf48d
chore: ensure error location is present (#22804)
Partial fix for https://github.com/microsoft/playwright/issues/22782
2023-05-03 18:45:33 -07:00
Dmitry Gozman
4edd023644
fix(tsconfig): fallback to default *:* path mapping when baseUrl is present (#22802)
According to
https://www.typescriptlang.org/docs/handbook/module-resolution.html#base-url,
`baseUrl` affects all non-relative imports. Additional `paths` mapping
can be specified for more control. However, if none of the `paths`
matches, it still falls back to the default `*:*` mapping. Confirmed by
invoking `tsc` with different configs.

Fixes #22663.
2023-05-03 16:08:06 -07:00
Pavel Feldman
9a61a55ea1
chore: nest api steps by time (#22801)
Fixes https://github.com/microsoft/playwright/issues/22786
2023-05-03 16:04:20 -07:00
Yury Semikhatsky
2233b352b6
fix(merger): pass onError to the reporter (#22775) 2023-05-03 09:08:09 -07:00
Dmitry Gozman
10ce7af411
fix(steps): step should not get an unrelated error (#22773)
Previously, we would use any error that was added during the step
execution as an error for this particular step.

This produces false positives, for example failing `page.click` call
that happened during `context` teardown was producing an error and
marking teardown is failed. However, in reality, the test itself has
failed, while teardown has not.

New approach uses test step hierarchy to inherit errors from child steps
to the parent step. This does not regress the original fix where
`expect.soft` errors are surfaced in the parent step.

See also #19973 that introduced the original logic.
2023-05-02 18:50:00 -07:00
Dmitry Gozman
dee0f2791e
test: unflake "should give enough time for fixture teardown" (#22763) 2023-05-02 17:40:10 -07:00
Dmitry Gozman
8f09935e81
fix(test runner): separate test fixture scope for beforeAll/afterAll hooks (#22746)
There was a single test fixture scope that covers all hooks, modifiers
and test function. Now beforeAll-like modifiers, beforeAll and afterAll
hooks get a scope each.

Fixes #22256.
2023-05-02 11:04:51 -07:00
Pavel Feldman
5ad75f92f7
test: unflake basic timeout test (#22745) 2023-05-02 09:14:57 -07:00
Sander
5b69c4cf52
chore: bump vite to 4.3.3 (#22711) 2023-05-01 15:19:49 -07:00
Pavel Feldman
70011c82f7
chore: unflake ui tests (3) (#22741) 2023-05-01 15:18:34 -07:00
Yury Semikhatsky
a4e90f20dc
fix(runner): do not hang on worker exit before tests (#22742) 2023-05-01 14:54:48 -07:00
Dmitry Gozman
fcd966c4e5
chore: make _setupArtifacts a worker-scoped fixture (#22739)
This should unblock having separate test-fixture scopes for hooks and
test.
2023-05-01 13:53:15 -07:00
Yury Semikhatsky
59079d94ca
fix: call onExit when merging reports (#22718) 2023-05-01 12:58:40 -07:00
Pavel Feldman
297fea0826
chore: purify the junit reporter (#22624) 2023-05-01 09:15:08 -07:00
Alex Neo
26cad0b31f
feat(html): matching labels with dash&spec symbol (#22709)
Fixes #22700
2023-05-01 09:13:30 -07:00
Pavel Feldman
a01df2ff5b
chore: render live trace for the serial mode (#22715)
Fixes https://github.com/microsoft/playwright/issues/22655
2023-04-28 17:47:57 -07:00
Dmitry Gozman
dbb218a9d5
feat: project.teardown that runs after all dependents have finished (#22696)
This replicates globalTeardown in the deps world.

Fixes #21914.
2023-04-28 14:27:08 -07:00
Pavel Feldman
2a675026de
chore: add image diff test to ui mode (#22637) 2023-04-28 14:18:46 -07:00
Pavel Feldman
e9373dfb6e
chore: make client-side instrumentation non-nullable (#22694) 2023-04-28 08:57:43 -07:00
Pavel Feldman
b555d33e38
chore: roll the stable test runner (#22701) 2023-04-28 08:57:19 -07:00
Alex Neo
7937699b28
fix(html): label not matched if first with describe (#22680) 2023-04-27 20:04:54 -07:00
Yury Semikhatsky
f37f5fc61c
chore: comma separated reporter names, reporter arg from config (#22693) 2023-04-27 15:16:18 -07:00
Dmitry Gozman
223baa3393
fix(html): keep tests in the declaration order (#22690)
Fixes #22143.
2023-04-27 13:54:15 -07:00
Yury Semikhatsky
82670147b4
chore: support multiple merged reports (#22672) 2023-04-27 09:15:24 -07:00
Max Schmitt
7b27d70d8a
feat(web-server): add stdout: "pipe"|"ignore" option (#22564)
Fixes https://github.com/microsoft/playwright/issues/22454
2023-04-26 23:39:42 +02:00
Pavel Feldman
7fdd7a20fb
chore: fix soft after poll (#22642) 2023-04-26 08:50:10 -07:00
Pavel Feldman
6b487ff49d
chore: remove cli from playwright-core (#22612)
Fixes https://github.com/microsoft/playwright/issues/22599
2023-04-25 11:19:37 -07:00
Pavel Feldman
a1007bbe2c
chore: introduce expect.configure (#22533) 2023-04-25 10:29:56 -07:00
Yury Semikhatsky
24478be565
feat: preserve attachments in blob reports (#22605)
Attachments with `path` are stored as `resources/sha1.ext` zip entries
and extracted under `report-dir/tmp` when merging. This way normal
fs.readFile keeps working as before even thought the file path is
different. The clients should rely on `attachment.name` instead of
`attachment.path` when deriving user visible titles in the UI. If this
turns out not to be the case we can reconsider later.

#10437
2023-04-24 17:34:09 -07:00
Pavel Feldman
bbc47ba315
chore: ensure web assertions are merged in trace (#22544) 2023-04-21 10:07:23 -07:00
Pavel Feldman
d95268ffc0
chore: remove refined title (#22541) 2023-04-20 20:34:07 -07:00
Pavel Feldman
d9a7aa584c
chore: bump timeouts in ui mode tests (#22526) 2023-04-20 16:47:08 -07:00
Yury Semikhatsky
9ea9adf8ff
test: mark reporter-blob tests as slow (#22530)
They run several playwright instances for each shard and then open
merged html report which takes considerable time
2023-04-20 09:36:38 -07:00
Pavel Feldman
0c70f6900e
chore: fix ui mode w/ multiple contexts (#22514)
Fixes: https://github.com/microsoft/playwright/issues/21895
2023-04-20 08:19:00 -07:00
Pavel Feldman
cdaccdeaf7
chore: speculative change to fix the ui mode tests stress (#22510) 2023-04-20 08:18:09 -07:00
Pavel Feldman
8f14517de2
chore: allow collapsing all (#22512)
Fixes https://github.com/microsoft/playwright/issues/21915
2023-04-19 18:16:18 -07:00
Dmitry Gozman
957ec0067f
chore: separate concerns of testinfo helpers (#22491) 2023-04-19 17:31:07 -07:00
Pavel Feldman
a45f04568b
chore: rename watchmode to uimode tsx (#22511) 2023-04-19 16:51:42 -07:00
Pavel Feldman
e7b9c08833
chore: should not spill toPass between tests (#22473) 2023-04-19 14:45:58 -07:00
Dmitry Gozman
bf0fab4927
fix(ui mode): ignore repeatEach (#22505)
Fixes #22498.
2023-04-19 14:16:12 -07:00
Max Schmitt
49c9284bc7
Revert "feat(html reporter): render multiple annotations of the same type together (#21580)" (#22466)
Fixes https://github.com/microsoft/playwright/issues/22323
2023-04-18 20:43:07 +02:00
mindaugasm
be79ee0450
feat(html-report): add attachmentsBaseURL option (#22212)
Fixes https://github.com/microsoft/playwright/issues/21636
2023-04-18 11:25:11 -07:00
Yury Semikhatsky
2ea214d6f0
fix: preserve trace if context if closed manually during test run (#22442)
Reference #22122, #22120
2023-04-18 09:02:33 -07:00
Pavel Feldman
8d69fbacf7
chore: introduce ct-core to hard-depend on vite (#22437)
Fixes https://github.com/microsoft/playwright/issues/22233
2023-04-17 16:19:21 -07:00
Dmitry Gozman
bf661535a6
fix(testMatch): do not count test.ts and spec.ts as test files by default (#22440) 2023-04-17 12:57:33 -07:00
Andrey Lushnikov
8bb708be70
test: unflake inspector-cli tests (#22347)
This patch:
- changes the `childProcess` fixture to reliably SIGKILL all descendants
  (children and grand-children, regardless of their process group).
This is achieved using the `ps` command to build the process tree, and
then send
  `SIGKILL` to the descendant process groups.
- changes the `runCLI` fixture to **not** auto-close codegen by default;
  the `childProcess` fixture will clean up all processes. This makes
sure that all `runCLI.waitFor()` commands actually wait until the
necessary
  output.
- for a handful of tests that do actually want to auto-close codegen,
  introduce an optional `autoCloseWhen` flag for the `runCLI` fixture
that makes sure to close the codegen once a certain output was reached.
2023-04-12 09:37:24 -07:00
Pavel Feldman
c5aeab4d7e
revert(20509, 20596): expect.toPass is broken with these (#22254)
Reverts https://github.com/microsoft/playwright/pull/20509 and
https://github.com/microsoft/playwright/pull/20596
Fixes #22215
2023-04-10 17:39:49 -07:00
Yury Semikhatsky
2af3f486c4
fix: do not load trace data for passing tests (#22311)
Fixes #22122
Fixes #22120
2023-04-10 13:29:55 -07:00
Yury Semikhatsky
1efa8de526
test: fix reporter blob tests on bots (#22281) 2023-04-07 17:48:54 -07:00
Yury Semikhatsky
8d2502ee62
test: make page-leaks tests pass in electron (#22277)
They've been failing
https://devops.playwright.dev/flakiness.html#filter_spec=page%2Fpage-leaks.spec.ts&test_parameter_filters=%5B%5D&timestamp=1680901928195
2023-04-07 17:20:49 -07:00
Pavel Feldman
eed5b4c83b
chore: process stdio buffers (#22270)
Fixes https://github.com/microsoft/playwright/issues/22265
2023-04-07 13:50:15 -07:00
Yury Semikhatsky
d59e0e10ce
feat: blob reporter (#22244)
#10437
2023-04-07 13:47:52 -07:00
Pavel Feldman
159e71982e
chore: render failed steps in the basic reporters (#22200)
Fixes #20532
2023-04-05 13:03:42 -07:00
Johannes Loher
bd698efaef
fix(webServer): follow relative redirects when checking the url (#22035)
Fixes https://github.com/microsoft/playwright/issues/22144
2023-04-05 10:39:35 +02:00
Pavel Feldman
3608425d57
chore: allow reusing browser between the tests (#22191) 2023-04-04 12:31:42 -07:00
Pavel Feldman
f8f9ee6a25
chore: introduce Reporter.onExit (#22176)
Fixes https://github.com/microsoft/playwright/issues/22173
2023-04-04 10:50:40 -07:00
Pavel Feldman
87acda74ff
chore: respect source map sources when filtering in CLI (#22180)
Fixes #22123
2023-04-03 19:49:01 -07:00
Dmitry Gozman
ab85b23e67
fix(expect): report expect "Timed out" when it actually does (#22174)
Previously, it would say "Timed out" when page was closed at test
timeout, or not say "Timed out" when at least one element matched.

Fixes #21664.
2023-04-03 15:06:13 -07:00
Dmitry Gozman
82e52004c9
fix(ui mode): preserve manually selected action in live trace (#22131) 2023-03-31 18:34:51 -07:00
Dmitry Gozman
41e3e6d13f
fix(tracing): avoid clashing network file names (#22126)
With two contexts in the same test, we can get:
- `<testId>.network` and `<testId>-1.network` files;
- for export, we can copy `<testId>.network` into `<testId>-1.network`
and try to copy into a file when another trace is reading from it.

Fixes #22089.
2023-03-31 17:29:39 -07:00
MarcNum
fbdafc5fe3
feat: Adding trace option 'on-all-retries' (#21985)
Fixes: #21860
2023-03-31 13:04:24 -07:00
Dmitry Gozman
37d1659508
feat(connect): support special headers for debug/attachments (#22106)
`x-playwright-debug-log: value` headers are printed to `pw:browser`
debug log.
`x-playwright-attachment: name=value` headers are attached to each test.

Fixes #21619.
2023-03-31 08:57:07 -07:00
Pavel Feldman
b1fdf0bcb6
chore: nest test steps based on zones (#22108)
Fixes: #21423
2023-03-30 21:05:07 -07:00
Pavel Feldman
eacaf5fc89
chore(ui): update expected state on test end (#22104)
Fixes https://github.com/microsoft/playwright/issues/22096
2023-03-30 16:17:34 -07:00
Pavel Feldman
a4f67c64e3
chore: allow ts decorators (#22080) 2023-03-29 20:43:08 -07:00
Pavel Feldman
d39ff3dc5a
chore: update typescript to 5.0.2 (#22079) 2023-03-29 17:13:09 -07:00
Yury Semikhatsky
026e49b076
chore: add snippet to the error message (#21991) 2023-03-29 14:07:14 -07:00
Pavel Feldman
8b7dc2cf7a
test: add a ui teardown test (#22010) 2023-03-29 13:57:19 -07:00
Dmitry Gozman
f7244a7e34
fix(tracing): allow disabling tracing through env (#22050)
We point `tracesDir` inside `test-results`, so it is removed between
test runs, while reused context is still writing there.
    To fix the issue, we can now pass `env.PW_TEST_REUSE_CONTEXT`.

References #21993.
2023-03-29 13:35:31 -07:00
Dmitry Gozman
47e5c02a21
fix(test runner): update default testMatch (#22006)
The intent of default test match is allowing `example.spec.ts` and
`example.test.ts` files. However, it was also matching `test.example.ts`
that should not be considered a test by default.

Fixes #21979.
2023-03-27 14:28:44 -07:00
Pavel Feldman
c3d7ffb773
chore(ui): do not print global setup epilogue (#21976) 2023-03-24 20:56:45 -07:00
Pavel Feldman
add948cdd0
chore: allow sibling describes with the same name (#21967)
Fixes https://github.com/microsoft/playwright/issues/21953
2023-03-24 17:09:11 -07:00
Pavel Feldman
79d55b959b
Revert "chore: remove legacy watch mode (#21944)" (#21973)
This reverts commit 86af908fa7.
2023-03-24 16:41:20 -07:00
Dmitry Gozman
120aaa777e
fix(test runner): do not show TimeoutError for unhandled rejection (#21971)
Unhandled error/rejection interrupts current test and produces a
TimeoutError for it that should be ignored.
2023-03-24 15:03:49 -07:00
Pavel Feldman
86af908fa7
chore: remove legacy watch mode (#21944) 2023-03-23 16:30:42 -07:00
Pavel Feldman
31e70c17be
chore: filter skipped tests (#21938)
Fixes https://github.com/microsoft/playwright/issues/21918
2023-03-23 13:29:52 -07:00
Max Schmitt
e621e52f89
chore: support TypeScript 5 in TS transformer (#21925)
Fixes https://github.com/microsoft/playwright/issues/21900
2023-03-23 18:07:02 +01:00
Alex Neo
6947f47f05
feat(html): added labels to test cases and test files (#21468) 2023-03-22 14:35:58 -07:00
Pavel Feldman
d9a9bb5a8c
chore: pack codemirror on resize (#21856) 2023-03-21 18:20:48 -07:00
Pavel Feldman
1bbe2b4b6a
chore: update test locations when merging (#21844) 2023-03-21 12:13:20 -07:00
Pavel Feldman
7ce2b36489
chore(ui): show load errors (#21843) 2023-03-21 12:03:26 -07:00
Dmitry Gozman
bea6fa15b2
feat(snapshots): use double-buffer to avoid white flash on hover (#21828) 2023-03-21 07:40:54 -07:00
Pavel Feldman
6015dad9db
chore: remove npx playwright ui (#21823) 2023-03-20 17:12:17 -07:00
Pavel Feldman
a33cf10696
chore(ui): decorate pending, add time spent (#21821) 2023-03-20 17:12:02 -07:00
Pavel Feldman
543c812d2f
chore(ui): queue watch runs (#21809) 2023-03-20 13:45:35 -07:00
Dmitry Gozman
73b20bc876
chore: roll stable-test-runner to 1.33.0-alpha-mar-20-2023 (#21817) 2023-03-20 13:42:22 -07:00
Dmitry Gozman
8accabdb59
test: gardening (#21814)
Notable changes:
- `page-event-crash` is not a page test, moving out of page/.
- One of the expect tests is directly covered by another, merging them.
2023-03-20 12:52:52 -07:00
Max Schmitt
4f43db686d
test: class properties with |this| don't work anymore (#21796)
https://github.com/microsoft/playwright/issues/21794
2023-03-20 16:38:51 +01:00
Max Schmitt
d641caeb6a
Revert "feat(typescript): allow declare for class properties (#21281)" (#21805)
This reverts commit a1ba6757e0.

https://github.com/microsoft/playwright/issues/21794
2023-03-20 16:37:20 +01:00
Pavel Feldman
001df3a495
chore(ui): follow up to watch, fix win (#21792) 2023-03-19 22:52:48 -07:00
Pavel Feldman
754e6edb95
chore: show folders in the tree (#21789) 2023-03-19 18:51:09 -07:00
Pavel Feldman
294baaeb44
chore: allow watching all tests (#21787) 2023-03-19 14:50:09 -07:00
Pavel Feldman
8a65cf9aac
chore(ui): ui polish / nits (#21781) 2023-03-19 12:04:19 -07:00
Pavel Feldman
0728d0f7fb
chore(ui): show test source before running (#21776) 2023-03-17 21:34:40 -07:00
Pavel Feldman
22e11a12ab
chore: show snapshots for sync assertions (#21775) 2023-03-17 20:20:35 -07:00
Dmitry Gozman
2a2d6c25a4
feat(deps): inherit environment changes from dependencies (#21771) 2023-03-17 15:46:52 -07:00
Pavel Feldman
6efb383433
chore: fix and test ui mode stop (#21769) 2023-03-17 14:10:25 -07:00
Dmitry Gozman
e856344235
chore: increase timeout for flaky "should stop tracing on requestContext.dispose()" (#21767) 2023-03-17 13:33:44 -07:00
Yury Semikhatsky
95e7d3aabc
chore: hide store from public (#21763) 2023-03-17 11:50:44 -07:00
Pavel Feldman
49ce561244
chore(ui): add hover-based run test (#21758) 2023-03-17 09:43:54 -07:00
Max Schmitt
53d341be01
test: do not pollute stderr with trace-viewer wsEndpoint (#21748) 2023-03-17 16:15:20 +01:00
Pavel Feldman
e066ca0713
chore: use test project output dir when showing live trace (#21735) 2023-03-16 20:09:09 -07:00
Pavel Feldman
ecd0f927f4
chore: make stacks rendering live in ui mode (#21728)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-03-16 18:17:07 -07:00
Dmitry Gozman
7879cf30f0
fix(reuse): serial mode with tracing should not throw (#21726)
Regressed in #19733.
Fixes #21113.
2023-03-16 14:32:12 -07:00
Pavel Feldman
c45d8749b0
chore: split trace events into phases (#21696) 2023-03-15 22:33:40 -07:00
Dmitry Gozman
455e11c1d9
fix(shards): shard test groups instead of files (#21638)
Fixes #21497.
2023-03-14 10:41:37 -07:00
Max Schmitt
a2c96494e0
chore: throw pretty error if rest parameters is used inside fixtures (#21659)
Fixes https://github.com/microsoft/playwright/issues/21566
2023-03-14 17:35:52 +01:00
Pavel Feldman
f5fa18a279
chore: reimplement filters (#21647) 2023-03-13 22:19:31 -07:00
Pavel Feldman
1d870ac407
chore(ui): start adding ui mode tests (2) (#21608) 2023-03-13 12:14:51 -07:00
Pavel Feldman
a12e909a40
chore(ui): start adding ui mode tests (#21601) 2023-03-12 15:18:47 -07:00
Pavel Feldman
b85d670491
chore(ui): show output on demand (#21592) 2023-03-11 11:43:33 -08:00
Dmitry Gozman
21950bc8ce
feat(html reporter): render multiple annotations of the same type together (#21580)
Multiple annotations are rendered as comma-separated lists. Fixes
#21253.

![IMAGE 2023-03-10
14:24:10](https://user-images.githubusercontent.com/9881434/224439435-3bf8e4f4-d874-4595-931d-ea5ff33ea374.jpg)
2023-03-10 15:26:02 -08:00
Dmitry Gozman
6d27d2c029
fix(test runner): improved fixture teardown timeout error message (#21572)
The new message looks like this:

```
Test finished within timeout of 500ms, but tearing down "playwright configuration" ran out of time.
Please allow more time for the test, since teardown is attributed towards the test timeout budget.·
```

References #21259.
2023-03-10 13:45:47 -08:00
Dmitry Gozman
58a23bc7a0
fix(test runner): allow worker-only dynamic imports (#21545)
Fixes #21409.
2023-03-10 08:58:26 -08:00
Max Schmitt
c9eac69f2b
fix(types): accept string in expect().toMatch() (#21454)
Fixes https://github.com/microsoft/playwright/issues/21453
2023-03-07 17:53:50 +01:00
Pavel Feldman
cffb6ac269
chore: move sever/isomorphic to utils/ to use it in client (#21445) 2023-03-06 18:49:14 -08:00
Sebastian Silbermann
fbaf56a13f
feat(ct-react): Support React 18 only (#19814)
BREAKING CHANGE: Drop support for React 17 and earlier
Support for React 17 an earlier is provided by
`@playwright/experimental-ct-react-17`

Closes #19923
2023-03-03 14:28:33 -08:00
Dmitry Gozman
eb3f8bfba8
fix(test runner): do not optimize filtering when sourcemap is present (#21359)
Fixes #21204.
2023-03-03 07:49:19 -08:00
Dmitry Gozman
6769a311ed
feat(test runner): error out when one test file imports another (#21357)
This situation is not supported, and we can now detect it by looking at
collected file dependencies.

Fixes #21270.
2023-03-02 15:09:50 -08:00
Dmitry Gozman
0b300f455c
fix(test runner): empty dependency should not skip other projects (#21354)
References #21270.
2023-03-02 13:32:23 -08:00
Dmitry Gozman
a1ba6757e0
feat(typescript): allow declare for class properties (#21281)
This enables `allowDeclareFields` flag that allows code like:

```ts
class Foo {
  declare prop: string;
}
```

Declaring is a workaround for inheritance vs property initialization
issues.
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier

For `allowDeclareFields` to work, we have to run
plugin-transform-typescript before plugin-proposal-class-properties and
few others, so this change migrates from preset-typescript that always
runs last to individual plugin-transform-typescript, and reorders some
plugins.

References #21119.
2023-03-01 16:43:17 -08:00
Yury Semikhatsky
60e5a93832
fix(store): support text and binary values (#21006) 2023-03-01 08:49:31 -08:00
Pavel Feldman
de3a5e2a91
chore(trace): include expect steps in a trace (#21199) 2023-02-28 13:26:23 -08:00
Pavel Feldman
81bd637d94
chore: merge traces into a single zip file (#21242) 2023-02-27 22:31:47 -08:00
Yury Semikhatsky
cfdddcf9ba
fix(runner): finish dispatching if remaining tests were skipped (#21238)
Fixes #21226
2023-02-27 17:20:30 -08:00
Pavel Feldman
ed41fd0643
chore: use listview to render stack trace (#21197) 2023-02-24 15:31:10 -08:00
Max Schmitt
f3a46f7405
feat(html): render annotations as links if needed (#21165)
Fixes https://github.com/microsoft/playwright/issues/20584
2023-02-23 21:57:02 +01:00
Nowell Strite
000583e048
fix(loader): experimentalLoader with node@18 (#21106)
There is currently a bug when running `node@18.14.2` when running with
experimentalLoader

```
TypeError: The URL must be of scheme file
  at new NodeError (node:internal/errors:399:5)
  at Object.fileURLToPath (node:internal/url:1492:11)
  at resolve (./node_modules/@playwright/test/lib/experimentalLoader.js:39:48)
  at nextResolve (node:internal/modules/esm/loader:163:22)
  at ESMLoader.resolve (node:internal/modules/esm/loader:838:24)
  at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:7)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:79:21)
```

This came from my test `vrt.spec.ts` which had a non package import
inside of it

```ts
import fs from "node:fs/promises"
```

The test run failed due to node imports not returning fileUrls when
resolved.

---------

Co-authored-by: Nowell Strite <nstrite@nvidia.com>
2023-02-22 14:28:03 -08:00
Max Schmitt
ae369144b6
chore: consolidate http/https fetching (#21104)
Fixes https://github.com/microsoft/playwright/issues/20784
Supersedes https://github.com/microsoft/playwright/pull/21076
2023-02-22 17:09:56 +01:00
Pavel Feldman
06fc72b6ed
revert(#12706): also fix related bugs it introduced (#21070) 2023-02-21 14:15:11 -08:00
Andrey Lushnikov
ce692830b3
fix: filter out comments inside fixture destructuring (#20989)
Fixes #20944
2023-02-21 12:51:40 -08:00
Dmitry Gozman
24c8d45c70
chore: enable tsc for ttest sources (#21018) 2023-02-19 11:18:07 -08:00
Dmitry Gozman
595502ac46
chore: remove unnecessary args in ttest (#21012) 2023-02-18 13:08:17 -08:00
Dmitry Gozman
56dbd1fcb0
chore: remove usesCustomOutputDir from tests (#21011) 2023-02-18 11:41:41 -08:00
Dmitry Gozman
55f4b670a9
fix(test runner types): allow sync step functions (#20996) 2023-02-17 14:26:40 -08:00
Yury Semikhatsky
09be9d6425
feat: key value store backed by filesystem (#20932)
Keys are used as a relative file path without any sanitization assuming
that the underlying fs will throw on error.
2023-02-16 16:48:28 -08:00
Pavel Feldman
96050a260e
chore(junit): render project as an agent name / hostname (#20927) 2023-02-16 07:59:05 -08:00
Dmitry Gozman
6f140d79d4
chore: do not create dummy config file in tests (#20935) 2023-02-16 06:56:52 -08:00
Yury Semikhatsky
90c4e6f9b2
chore: revert sharded html report (#20923)
We've decided not to ship it in the current form.

#10437
2023-02-15 12:38:03 -08:00
Dmitry Gozman
91da67fab1
test: remove magic headers in ttest (#20867)
Instead, explicitly import from '@playwright/test'.
2023-02-14 19:20:56 -08:00
Pavel Feldman
08be39a80e
fix(watch): fix the tests on win (#20844) 2023-02-14 14:55:49 -08:00
Pavel Feldman
7f0763d789
chore: hide watch mode, it is not ready (#20905) 2023-02-14 13:22:44 -08:00
Pavel Feldman
798696a18a
chore: fix context reuse disposal (#20876)
Fixes: https://github.com/microsoft/playwright/issues/20409
2023-02-14 12:56:47 -08:00
Dmitry Gozman
6d03211439
fix(test runner): --list should ignore '.only' annotations (#20868) 2023-02-13 11:13:30 -08:00
Andrey Lushnikov
fdcd7b549d
chore: mark comparator option back as experimental (#20816)
This reverts commit 303c5998f8.

Reason for revert: I tried enabling `ssim-cie94` by default on
ionic-framework test suite, and it proves to be overly strict for their
usecase.
2023-02-13 11:11:44 -08:00
Joel Einbinder
997dfa9274
fix(reporter): properly indent multiline attachments (#20847)
Text attachments were only indented on the first line.
2023-02-13 10:28:34 -08:00
Dmitry Gozman
de69b766d9
test: code health in ttest (#20837)
- Remove duplicate tests.
- Remove unused test helpers.
- Print full watch output on failures.
- Unflake some tests.
2023-02-10 20:26:19 -08:00
Dmitry Gozman
789b1c75e6
fix(expect): report received when timedOut during oneShot (#20806) 2023-02-10 14:59:21 -08:00
Pavel Feldman
1ba768bf60
chore: make watch + ct happy (#20804) 2023-02-10 08:33:25 -08:00
Pavel Feldman
4469e57695
chore: always grow component bundle (#20799)
Fixes https://github.com/microsoft/playwright/issues/20581
2023-02-09 18:39:20 -08:00
Pavel Feldman
69c4653c6b
chore: speculative windows cli fix (#20801) 2023-02-09 16:04:07 -08:00
Pavel Feldman
e1f287f255
chore: more watch tests (#20797) 2023-02-09 16:03:54 -08:00
Pavel Feldman
596ed97791
chore: add more watch tests (#20793) 2023-02-09 13:57:00 -08:00
Pavel Feldman
5112abc1d2
chore: fix a racy time-based test (#20783) 2023-02-09 08:49:51 -08:00
Pavel Feldman
b247bfe153
test(watch): start adding tests (#20764) 2023-02-09 08:31:02 -08:00
Pavel Feldman
7a093329fa
chore: do not run all on watch (#20758) 2023-02-08 12:44:51 -08:00
Pavel Feldman
11168efb0e
chore: roll stable-test-runner to ToT (#20754) 2023-02-08 10:02:20 -08:00
Yury Semikhatsky
a93cf767a1
feat: html reporter sharded option (#20737)
Make sharded report feature an opt-in:

```ts
{
   reporter: [['html', { sharded: true }]]
};
```

#10437
2023-02-07 22:21:50 -08:00
Pavel Feldman
4259d4e1d6
chore: implement repeat last run (#20727) 2023-02-07 15:56:39 -08:00
Pavel Feldman
1b941bcf2e
chore: simplify ttests (#20733) 2023-02-07 15:11:44 -08:00
Yury Semikhatsky
f10b29fd5e
feat: show warning when some report shards are missing (#20731)
When some of the report shards are missing still show the report but
display an error in the status line:

![image](https://user-images.githubusercontent.com/9798949/217371112-2317a307-204e-4c11-8d01-42e91fe6ca7a.png)

#10437
2023-02-07 14:22:10 -08:00
Yury Semikhatsky
8f53bf7b41
feat: sharded html report (#20700)
This implementation is based on the [original
PR](https://github.com/microsoft/playwright/pull/19691) by @kevin940726.
It makes the reporter produce single file when there is no sharding and
multiple out-of-line report-x-of-y.zip reports which are automatically
merged together when put in one folder.

References https://github.com/microsoft/playwright/issues/10437

Co-authored-by: Kai Hao <kevin830726@gmail.com>
2023-02-07 10:21:26 -08:00
Andrey Lushnikov
303c5998f8
feat: release "comparator" option from experiment (#20720)
The option defines a comparator to be used to compare images.
Possible values are `"pixelmatch"` and `"ssim-cie94"`.

Note: This reverts commit 8167f8bf54.
2023-02-07 08:51:48 -08:00
Pavel Feldman
361ea949aa
chore: respect deps when watching files (#20695) 2023-02-06 17:09:16 -08:00
Pavel Feldman
b6df48758d
chore: collect test dependencies (#20645) 2023-02-06 14:52:40 -08:00
Dmitry Gozman
e64c623e61
feat(expect): strip down Expect types (#20601)
This only leaves:
- documented assertions;
- asymmetric matchers;
- `resolves`/`rejects`;
- `expect.extend()`;
- `expect.getState()` with selected properties.

References #20432.
2023-02-03 15:56:31 -08:00
Sam Chen
340cacf4fd
feat: show diff tab by default (#19820)
Close https://github.com/microsoft/playwright/issues/19803

I had to manually inject `window.playwrightReportBase64` data into
`playwright/packages/html-reporter/index.html` when developing,
wondering if there's any method I don't know.
2023-02-03 10:32:23 -08:00
Andrey Lushnikov
f45f20a8c9
fix: handle not.toPass() with expect.soft inside (#20596)
Fixes #20518
2023-02-03 09:14:05 -08:00
Dmitry Gozman
3180bc9804
fix(types): make most fixtures non-undefined (#20573)
Fixes #20416.
2023-02-02 13:11:50 -08:00
Andrey Lushnikov
4f61105032
fix: swallow expect.soft errors inside successful toPass matcher (#20509)
Fixes #20437
2023-02-02 10:47:20 -08:00
Dmitry Gozman
5fb430a743
fix(test runner): do not print timeout message upon interrupt (#20574)
We should only print "Test was interrupted."

Regressed in #18321.
2023-02-01 19:39:43 -08:00
Dmitry Gozman
f46883e58e
feat(expect): add GenericAssertions documentation (#20564)
References #20432.
2023-02-01 16:55:52 -08:00
Pavel Feldman
421dd884a7
chore: implement --no-deps (#20569) 2023-02-01 16:32:13 -08:00
Pavel Feldman
635b47025e
chore: expose project dependencies api (#20546) 2023-02-01 08:39:07 -08:00
Pavel Feldman
08e4b50ff6
chore: project deps (#20514) 2023-01-31 15:59:13 -08:00
Dmitry Gozman
9c6c31a442
fix(types): update PlaywrightTestConfig types (#20540)
This makes errors more focused on the custom properties.

References #20416.
2023-01-31 15:02:01 -08:00
Yury Semikhatsky
a03f3223c4
fix: trim long expect messages (#20517)
Fixes #20324
2023-01-30 17:24:12 -08:00
chimurai
f72d400952
chore: fix typos (#20473) 2023-01-30 09:53:28 +01:00
Pavel Feldman
2c27bd3b07
chore: remove plugin registration sink (#20460) 2023-01-27 14:36:41 -08:00
Pavel Feldman
f7ff252455
chore: remove addFatalError (#20383) 2023-01-25 17:26:30 -08:00
Pavel Feldman
fe1dd7818d
chore: extract task runner for global setup (#20345) 2023-01-25 15:38:23 -08:00
Dmitry Gozman
d1fb3a2384
fix(test runner): do not send entirely skipped test groups to a worker (#20346)
Move TestCase properties calculation from WorkerMain to suite building
phase.

Fixes #20156.
2023-01-25 12:54:50 -08:00
Dmitry Gozman
b971dd3417
fix(test runner): show deep strack traces during imports (#20305)
Fixes #20239.
2023-01-24 08:49:06 -08:00
Pavel Feldman
147bb6b292
chore: run global setup before onBegin (#20285) 2023-01-23 17:44:23 -08:00
Pavel Feldman
9f31bcfbab
chore: refactor graceful close, rename to host/main (#20283) 2023-01-22 15:04:29 -08:00
Dmitry Gozman
b700c08dc5
feat(screenshots): when actual and expected have different sizes, pad and produce the diff image (#20208)
Also show sizes in the html report to easier spot the size mismatch
issue.

<img width="1030" alt="diff"
src="https://user-images.githubusercontent.com/9881434/213327632-b8fcd69c-8d08-460c-9de1-b5f4f8c56359.png">

Fixes #15802.
2023-01-20 19:41:43 -08:00
Pavel Feldman
7ff27600b4
chore: experimental oop loader (#20269) 2023-01-20 18:24:15 -08:00
Dmitry Gozman
eafa6fda13
fix(expect): poll/toPass should not wait over specified timeout (#20266)
Drive-by: unflake some timeout-dependent tests.
2023-01-20 15:47:24 -08:00
Pavel Feldman
3066ffd577
chore: use fake pool on the runner side (#20241) 2023-01-20 08:36:31 -08:00
Pavel Feldman
e08168e16e
chore: temporarily remove project and global setup, store (#20181) 2023-01-18 12:56:03 -08:00
Max Schmitt
0656ab4811
chore: roll stable test-runner to 1.30.0-alpha-jan-16-2023 (#20139) 2023-01-17 19:23:24 +01:00
Andrey Lushnikov
92375f6333
fix: support import assertions (#20009)
Fixes #19928

Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-01-16 08:26:14 -08:00
Pavel Feldman
d1c161ce99
chore: merge the util exports (#20110) 2023-01-13 13:50:38 -08:00
Pavel Feldman
736cf5c585
fix(tsx): resolve .js imports to .tsx as well (#20092)
Fixes: https://github.com/microsoft/playwright/issues/20039
2023-01-13 10:49:10 -08:00
Pavel Feldman
e065d608b6
chore: introduce defineConfig for easier JS typing (#20061)
Fixes https://github.com/microsoft/playwright/issues/19694
2023-01-12 13:12:02 -08:00
Yury Semikhatsky
730a197c80
feat: config.globalScripts (#20062)
Introduce config.globalScripts. Tests from the matching files will run
before all projects. We'll only allow beforeAll/afterAll instead of
tests in such files (next PR).

Global scripts are executed as part of 'Global Scripts' project which is
not present in FullConfig.projects but may be referenced by
corresponding global setup Suites.

Signed-off-by: Yury Semikhatsky <yurys@chromium.org>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2023-01-12 13:02:54 -08:00
Max Schmitt
e2a2196e6a
chore(html-reporter): show project name always for the test file (#19905)
Fixes https://github.com/microsoft/playwright/issues/19874
2023-01-10 17:11:38 +01:00
Dmitry Gozman
28577afde4
feat(soft expect): mark steps with failed soft expects as failed (#19973)
Fixes #19673.
2023-01-09 16:17:06 -08:00
Yury Semikhatsky
a39a97f0ee
chore: setup -> test.projectSetup (#19932)
* Changed `setup` to `test.projectSetup`
* Only `test.projectSetup.only` is supported on the new method
* test.* methods except for before/after/Each/All hooks can be called
inside the project setup files
2023-01-09 11:21:48 -08:00
Dmitry Gozman
31a63b5c2a
fix(reuse): make reuse work with tracing (#19733)
Fixes #19059.
2023-01-05 14:50:47 -08:00
Andrey Lushnikov
1afa38d5a7
chore(expect): extract polling from expect.poll and expect().toPass (#19882)
This extracts & unifies polling machinery from `expect.poll` and
`expect.toPass` methods.
2023-01-05 11:14:37 -08:00
Dmitry Gozman
388a3e1f37
fix(test runner): make sure to run afterAll after skipped tests (#19878)
Fixes #19745.
2023-01-04 14:13:49 -08:00
Dmitry Gozman
6193e6d8ea
fix(reuse): reset tracing (#19876)
References #19059.
2023-01-04 13:19:05 -08:00
Grant Colestock
a30aac5668
fix: make sure jsx fragments are transformed (#19755)
Fixes: #19142
2022-12-31 11:08:36 -08:00
Sander
b363902e1b
feat(ct): https (#19697) 2022-12-28 17:04:23 -08:00
Dmitry Gozman
5cdf118a42
fix(reuse): disable trace/video when reusing the context (#19764)
Previously, we disabled reuse when trace/video was on. Component testing
keeps this behavior.

References #19059.
2022-12-28 16:58:34 -08:00
Yury Semikhatsky
137070d889
Revert "chore: hide setup, store, TestProject.setupMatch, storageStat… (#19756)
…eName (#19442)"

This reverts commit 92dd734e04.
2022-12-28 15:39:31 -08:00
Pavel Feldman
233664bd30
chore: report more fatal errors via reporter (#19640) 2022-12-22 17:31:02 -08:00
Ross Wollman
06c7f1fb6c
fix(html): test and fix reporter timing display (#19670)
#19576 introduced a regression where the CLI reporters displayed some
times with way too many decimals. e.g. 7.123456789ms.

Prior to #19576, there were two monotonicTime implementations; that PR
updated the reporters to use the common definition that had existed in
utils.ts. However, that introduced a regression in the base.ts reporters
which used the ms duration humanizing package which did not account for
the more precise decimals used by the shared monotonicTime function.

This fix removes the dependency on the third-party ms package and now
consistently uses Pavel's humanize function which the HTML reporter had
been using and proved to have better defaults for decimals.
Additionally, we add more test coverage to limit future regressions
since this was caught in passing.

Closes #19556.
Relates #19576.
2022-12-22 15:57:55 -08:00
Dmitry Gozman
b8848fb499
fix(test runner): make sure undefined options in config result in default values (#19632)
Note: this keeps existing behavior of `undefined` in `test.use()`
reverting to the config value and not to the original default value.

References #19615.
2022-12-21 14:34:43 -08:00
Dmitry Gozman
eaae8ebbf3
chore: throw InvalidSelectorError from selector parser, add some tests (#19636) 2022-12-21 14:27:35 -08:00
Dmitry Gozman
d12bc0be9a
fix(screenshot): account for screenshot === undefined (#19627) 2022-12-21 10:16:36 -08:00
Pavel Feldman
675f0eb4a0
chore: report error location for fatal errors (#19610) 2022-12-21 09:36:59 -08:00
Ross Wollman
0844394270
feat(html): display overall duration (#19576)
<img width="1390" alt="Screenshot 2022-12-19 at 4 15 33 PM"
src="https://user-images.githubusercontent.com/11915034/208552484-c0127615-d2c6-414f-ae3b-e7836553d890.png">

* Adds duration (time ellapsed from `onBegin` to `onEnd`); roughly
equivalent to `time npx playwright test …`.
* Removes cumulative per-file time

Resolves #19566.
2022-12-20 14:13:10 -08:00
Andrey Lushnikov
d7e7cab44a
fix: properly handle negated timed-out toPass matcher (#19580) 2022-12-20 08:41:32 -08:00
Han Yeong-woo
00ffd74727
fix(runner): import export assignment from ts (#19559) 2022-12-19 14:41:29 -08:00
Vladimir Semenov
467d9f37fc
feat(reporter): Add parallelIndex field to TestResult (#19570) 2022-12-19 14:37:04 -08:00
Pavel Feldman
0e2732decf
feat(api): introduce expect().toPass (#19463) 2022-12-14 19:23:13 -08:00
Andrey Lushnikov
8167f8bf54
chore: hide "comparator" option from documentation and types (#19441) 2022-12-14 09:58:19 -08:00
Yury Semikhatsky
92dd734e04
chore: hide setup, store, TestProject.setupMatch, storageStateName (#19442) 2022-12-13 22:48:38 -08:00
Dmitry Gozman
ab9602bebf
chore: remove unused PW_TEST_OUT_OF_PROCESS_DRIVER (#19434) 2022-12-13 16:04:44 -08:00
Fernando Garcia Llorente
cd4ccdfa29
feat: allow options in automatic screenshots (#19143)
Closes #9983 

Allowing Automatic Screenshots in `PlaywrightTestConfig` to have
`fullPage` & `omitBackground` as optional parameters.
2022-12-07 08:45:33 -08:00