Commit graph

1231 commits

Author SHA1 Message Date
Yury Semikhatsky b8b929fdea
chore: hide merge-reports command (#22509) 2023-04-19 15:36:17 -07:00
Pavel Feldman ba8aed9dea
chore: move mount implementation to ct-core (#22506) 2023-04-19 15:32:33 -07:00
Pavel Feldman e7b9c08833
chore: should not spill toPass between tests (#22473) 2023-04-19 14:45:58 -07:00
Pavel Feldman 3c495c5590
chore: only transpile tsx for components (#22504) 2023-04-19 14:20:53 -07:00
Dmitry Gozman bf0fab4927
fix(ui mode): ignore repeatEach (#22505)
Fixes #22498.
2023-04-19 14:16:12 -07: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
Debbie O'Brien 3a0f49acab
docs: add options snippets to api docs (#22098) 2023-04-18 19:04:13 +02: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
Debbie O'Brien d9e7a4fffd
docs: remove test advanced guide (#22028) 2023-04-18 10:47:32 +02: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
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
Pavel Feldman 635a2dac16
chore: remove FullProjectInternal.from (#22280) 2023-04-07 19:12:20 -07:00
Pavel Feldman 3b94bb6740
chore: simplify full config and full project building (#22278) 2023-04-07 17:46:47 -07:00
Valentín Costa 93e020d483
docs(class-test.md): add missing R in the word returned (#22252) 2023-04-07 13:57:28 -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 a42567d549
chore: inside out the config & project internal (#22260) 2023-04-07 09:54:01 -07:00
Pavel Feldman 02ca63b381
chore: use separator when printing titles in the list mode (#22269)
Fixes https://github.com/microsoft/playwright/issues/22267
2023-04-07 09:52:04 -07:00
Yury Semikhatsky 1ea9f02944
chore: add configDir to reporter options (#22250) 2023-04-06 14:23:47 -07:00
Pavel Feldman 09f072de09
chore: introduce the concept of a test run (#22243) 2023-04-06 11:20:24 -07:00
Pavel Feldman 9ced1e278d
chore: remove the legacy webServer accessor from the config (#22245) 2023-04-06 11:20:11 -07:00
Sander cea382015f
chore(ct): rename component.d.ts (#22234) 2023-04-06 08:40:49 -07:00
Yury Semikhatsky fc23d35697
chore: clear previous test results optionally (#22224) 2023-04-06 08:33:17 -07:00
Yury Semikhatsky b5195122d9
chore: return promise from tele receiver dispatch (#22218) 2023-04-05 14:23:06 -07:00
Sander 789d8b24c0
chore(ct): dedupe json object (#22138) 2023-04-05 13:10:00 -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 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
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
Sander b9f7cca0aa
fix(ct): optional hooks config type (#22100) 2023-03-30 21:09:05 -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
Debbie O'Brien 2c9d65b5ed
docs: change port to url (#22029) 2023-03-30 15:18:59 +02:00
Pavel Feldman a4f67c64e3
chore: allow ts decorators (#22080) 2023-03-29 20:43:08 -07:00
Yury Semikhatsky 026e49b076
chore: add snippet to the error message (#21991) 2023-03-29 14:07:14 -07:00
Sander 8d6f7ad521
fix(ct): viteConfig commonjsOptions doesn't work (#22063) 2023-03-29 14:00:38 -07:00
Sander 9c0c5d6e2a
chore(ct): throw error when props are not json serializable (#22025) 2023-03-29 13:59:27 -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 6929214dbf
feat(expect): expect(locator).toBeAttached() (#22067)
Fixes #13467.
2023-03-29 11:09:17 -07:00
Andrey Lushnikov bb6b4425f7
fix: per-user cache folders (#22046)
Fixes https://github.com/microsoft/playwright/issues/21859
2023-03-29 10:49:52 -07:00
Nathan Power 02db6882ec
fix(ct): update regex to cater for minified JS files (#22017) 2023-03-28 11:15:11 -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
Sébastien Richert 591e4ea976
feat: Restrain sending http credentials on a specific origin (#20374)
For security purpose, we would like to restrain sending HTTP credentials
to only the specified server. The idea is to give the ability to specify
a origin (scheme://host:port) additionally to current pair
username/password. When an authorization response is received from
servers, the credentials are sent only if the server origin in the
request matches case insensitive the specified origin.
2023-03-27 08:52:00 -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 5ff8c5f782
chore: show global setup errors in ui mode (#21942)
Fixes: [21941](https://github.com/microsoft/playwright/issues/21941)
2023-03-23 15:46:24 -07:00
Yury Semikhatsky 900f9deb4f
chore: pass parent step id in tele reporter (#21934) 2023-03-23 15:15:58 -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
Pavel Feldman f5bd236c7b
chore: install global watch late (#21927) 2023-03-23 11:30:28 -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
Yury Semikhatsky a2a2b78cc8
chore: relative paths in telereporter (#21887) 2023-03-22 13:59:57 -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
Pavel Feldman 0bf406c8aa
chore: sort tracing actions by wall time (#21839) 2023-03-21 10:03:49 -07:00
Pavel Feldman 6015dad9db
chore: remove npx playwright ui (#21823) 2023-03-20 17:12:17 -07:00
Pavel Feldman 543c812d2f
chore(ui): queue watch runs (#21809) 2023-03-20 13:45:35 -07: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 294baaeb44
chore: allow watching all tests (#21787) 2023-03-19 14:50:09 -07:00
Andrey Lushnikov 32d33cb8d5
chore: cut 1.32 (#21773) 2023-03-17 19:36:43 -07:00
Pavel Feldman d806c98009
chore(ct): do not clash internals with userland (#21774) 2023-03-17 18:08:28 -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
Yury Semikhatsky 95e7d3aabc
chore: hide store from public (#21763) 2023-03-17 11:50:44 -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 f37f38e553
chore: decouple test groups from root suite as much as possible (#21731) 2023-03-16 17:11:15 -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
Dmitry Gozman 2074a51299
docs: fix details about WorkerInfo vs TestInfo availability (#21699)
Fixes #21695.
2023-03-16 12:36:34 -07:00
Max Schmitt 3ceac4bf53
docs: drop duplicate JS code snippets from test-api (#21466)
https://github.com/microsoft/playwright/issues/21385
2023-03-16 19:01:15 +01:00
Dmitry Gozman ea85242941
chore: improve client-side options plumbing (#21697) 2023-03-16 07:03:33 -07:00
Pavel Feldman c45d8749b0
chore: split trace events into phases (#21696) 2023-03-15 22:33:40 -07:00
Dmitry Gozman b149d132a6
chore(test runner): split loadAllTests into parts (#21674) 2023-03-15 13:40:58 -07:00
Pavel Feldman 27048adebe
chore: introduce testInfo.testId (#21670) 2023-03-14 15:58:55 -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
Dmitry Gozman 809725e114
fix(reuse): only reuse the default browser, not explicitly launched ones (#21631)
Fixes #20399.
2023-03-13 16:50:51 -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 493171cb6b
chore: select files to watch explicitly (#21599) 2023-03-12 10:50:21 -07:00
Dmitry Gozman ea8aa63f1a
feat: support PWTEST_PROFILE_DIR in run-server (#21582)
This creates one profile per connection in the specified directory.
2023-03-10 19:07:40 -08:00
Pavel Feldman 0b9c037f36
chore(ui): do not add sources into the zip file (#21588) 2023-03-10 17:01:30 -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
Pavel Feldman 1073e42686
chore: allow running failing (#21569) 2023-03-10 12:41:00 -08:00
Dmitry Gozman 58a23bc7a0
fix(test runner): allow worker-only dynamic imports (#21545)
Fixes #21409.
2023-03-10 08:58:26 -08:00
Pavel Feldman e7b21425f7
chore: support both test --ui and ui clis (#21537) 2023-03-09 13:03:01 -08:00
Pavel Feldman 47a71731f4
chore: add explicit command for gui runner (#21509) 2023-03-09 08:04:02 -08:00
Pavel Feldman 5ef2edb9f7
chore: support suites in the tree (#21508) 2023-03-08 19:50:32 -08:00
Pavel Feldman a2490a8fc8
chore(ui): maintain test order when updating (#21478) 2023-03-07 20:34:57 -08:00
Pavel Feldman f5894ed089
chore: open location in vscode (#21472) 2023-03-07 17:20:41 -08:00
Pavel Feldman e9f94f0346
chore: add ui mode terminal (#21470) 2023-03-07 14:24:50 -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 65117702e7
chore: consistent xterm naming (#21446) 2023-03-06 20:39:52 -08:00
Pavel Feldman b6ff3bad98
chore: split code mirror and xterm modules (#21415) 2023-03-06 10:40:45 -08:00
Pavel Feldman bae9173208
chore: split ui mode toolbar into lines, show progress (#21403) 2023-03-05 13:46:21 -08:00
Pavel Feldman ec056a6312
chore: merge projects in the tree (#21401) 2023-03-04 16:28:30 -08:00
Pavel Feldman f0cd123a45
chore(ui): make ui-side drive things (#21398) 2023-03-04 15:05:41 -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
Pavel Feldman 57624bc01b
chore: ui mode ui improvements (#21325) 2023-03-02 13:45:15 -08:00
Sander d58d833daf
fix(ct): solid and react JS as child (#20125) 2023-03-02 13:40:51 -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
Max Schmitt 6a7347f134
chore: have pretty error if CT config has no defineConfig (#21318)
Fixes https://github.com/microsoft/playwright/issues/21312
2023-03-02 00:47:05 +01:00
Pavel Feldman e222874445
chore: ui mode first cut (#21291) 2023-03-01 15:27:23 -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
Dmitry Gozman 27027658dc
chore: fix all Proxy() to account for symbol properties (#21272)
Fixes #20940.
2023-02-28 12:45:14 -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
Leo Sklyut 6c3d35fa58
fix(junit): use the JUnit schema's specified ISO format for timestamp (#21062)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-02-27 11:04:22 +01:00
Pavel Feldman 4d91248c1e
chore: simplify the trace collection fixtures (#21203) 2023-02-25 21:21:09 -08: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
Gonçalo Basto 7c6630b1a2
docs: add custom reporter options documentation (#21144) 2023-02-24 12:29:08 +01:00
Pavel Feldman 8ccc02a9d3
chore: use client wall time in traces (#21163) 2023-02-23 14:37:53 -08: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 3f8f2a0fdd
chore: do not use library stack capturer in test runner (#21075) 2023-02-21 19:24:17 -08:00
Max Schmitt 1432c406ad
docs: fix toMatch code snippet typo (#21077)
Fixes https://github.com/microsoft/playwright/issues/21014
2023-02-22 00:38:30 +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 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
Dmitry Gozman 0b7f9055a3
chore: fix docs for python and java (#20962) 2023-02-16 11:48:38 -08:00
Andrey Lushnikov 1db04f2839
fix: simplify protocol for toBeInViewport (#20960) 2023-02-16 11:02:19 -08:00
Dmitry Gozman ffc2477a00
chore: 1.31 release notes for js (#20933) 2023-02-16 09:35:01 -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 e77e2d8c7f
chore: mark 1.32.0-next (#20929) 2023-02-15 16:15:42 -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
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
Andrey Lushnikov 72942e81d5
chore: fixes to toBeInViewport (#20870) 2023-02-13 15:21:40 -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
Pavel Feldman e9ca483666
chore: dim watch separator (#20836) 2023-02-12 10:00:40 -08:00
Dmitry Gozman 8a1612ceec
fix(reporters): preserve the order between deferred errors and stdio (#20830) 2023-02-10 14:58:44 -08:00
Pavel Feldman 1ba768bf60
chore: make watch + ct happy (#20804) 2023-02-10 08:33:25 -08:00
Andrey Lushnikov 68e170ef89
feat: implement expect(locator).toBeInViewport() (#20668)
The method accepts a `ratio` option to assert the ratio
of the element in viewport. `ratio` defaults to `Number.MIN_VALUE`.

NOTE: this reverts commit d950f5b6ee and
adds `ratio` option support + does the rename.

Fixes #8740
2023-02-10 04:33:22 -08:00
Dmitry Gozman 778dd20403
chore(docs): beautify generated types, put options always last (#20805) 2023-02-09 20:46:33 -08:00
Dmitry Gozman ab4cd83e44
chore: move testInfo and timeoutManager to worker/ (#20803) 2023-02-09 19:22:17 -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 e1f287f255
chore: more watch tests (#20797) 2023-02-09 16:03:54 -08:00
Dmitry Gozman 8002baf44f
chore: move option overrides logic to FixturePool (#20795) 2023-02-09 14:50:40 -08:00
Dmitry Gozman 4d37491e9b
chore: split FixtureRunner from fixtures (#20787)
It is only used in worker process.
2023-02-09 11:31:54 -08:00
Sander 4a3d79f291
chore(ct): improve internal hook types (#20722) 2023-02-09 08:58:15 -08:00
Pavel Feldman 5112abc1d2
chore: fix a racy time-based test (#20783) 2023-02-09 08:49:51 -08:00
Dmitry Gozman 190c121e66
chore: bundle chokidar, leave fsevents as an optional dependency (#20762) 2023-02-09 08:40:27 -08:00
Pavel Feldman b247bfe153
test(watch): start adding tests (#20764) 2023-02-09 08:31:02 -08:00
Pavel Feldman 6b0a7003c4
chore(watch): run by default again (#20763) 2023-02-08 18:53:07 -08:00
Pavel Feldman 027d6b5239
chore: set filters and run tests separately (#20759) 2023-02-08 14:30:53 -08:00
Pavel Feldman 7a093329fa
chore: do not run all on watch (#20758) 2023-02-08 12:44:51 -08:00
Dmitry Gozman 98e2fe184e
chore(docs): sort members instead of validating (#20755) 2023-02-08 09:59:31 -08:00
Pavel Feldman 0678b6575f
chore(watch): allow toggling browser (#20738) 2023-02-08 08:36:02 -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 96f0674e41
chore: calcular pool digests on the loader process side (#20728) 2023-02-07 14:08:17 -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
Pavel Feldman 98e348d16a
chore(watch): print current filters (#20696) 2023-02-07 09:48:46 -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 430d08f4fb
chore: watch mode first cut (#20647) 2023-02-06 15:52:14 -08:00
Pavel Feldman b6df48758d
chore: collect test dependencies (#20645) 2023-02-06 14:52:40 -08:00
Dmitry Gozman 33a05446d2
fix(expect): update docs to point to GenericAssertions instead of expect library (#20688)
Closes #20432.
2023-02-06 14:51:24 -08:00
Andrey Lushnikov 0a752f3fd6
chore(docker): remove experimental docker integration (#20676)
This removes everything related to docker integration experiments that
we conducted over the last 6 months.

I'll send a follow-up with an alternative suggestion that was demo'ed on
a team meeting in the end of December.
2023-02-06 10:50:45 -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
Andrey Lushnikov f45f20a8c9
fix: handle not.toPass() with expect.soft inside (#20596)
Fixes #20518
2023-02-03 09:14:05 -08:00
Pavel Feldman ffb719385b
chore: fix oop loading, prepare to watch (#20618) 2023-02-03 09:11:02 -08:00
Pavel Feldman b0b9b08167
chore: fix plugin reporting, rearrange steps (#20616) 2023-02-03 08:44:01 -08:00
Pavel Feldman 8b5e55d432
chore: implement compilation cache (#20597) 2023-02-02 16:46:54 -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 190b0ab609
fix(options): do not default navigationTimeout to actionTimeout (#20578)
Fixes #20549.
2023-02-02 07:36:16 -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 cb9ace6035
chore(test): move run options into config (#20568) 2023-02-01 15:25:26 -08:00
Max Schmitt 0edf77fe91
chore: bump json5 dependency (#20560)
Fixes https://github.com/microsoft/playwright/pull/20309
2023-02-01 22:50:50 +01:00
Pavel Feldman a1cdd939f8
chore: load tests file by file (#20557) 2023-02-01 12:33:42 -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
Dmitry Gozman b39079b51e
feat(trace viewer): popout snapshot in a new tab (#20475) 2023-01-30 19:07:52 -08:00
Yury Semikhatsky a03f3223c4
fix: trim long expect messages (#20517)
Fixes #20324
2023-01-30 17:24:12 -08:00
Pavel Feldman 0dd090aeab
chore: prepare to deps (#20513) 2023-01-30 14:34:48 -08:00
Max Schmitt 01790c0e19
fix(test-runner): throw error if no port and url is given (#20497)
https://github.com/microsoft/playwright/issues/20476
2023-01-30 16:28:31 +01:00
chimurai f72d400952
chore: fix typos (#20473) 2023-01-30 09:53:28 +01:00
Adi 32724cd5ce
docs: Added types to custom reporter typescript example (#20191) 2023-01-28 09:38:42 -08:00
Pavel Feldman 2b499bd5d6
chore: create tests groups per project (#20463) 2023-01-28 09:30:42 -08:00
Pavel Feldman 2c27bd3b07
chore: remove plugin registration sink (#20460) 2023-01-27 14:36:41 -08:00
Yeison Daza 98a0f98577
chore: ct vite config async (#20288) 2023-01-27 14:13:15 -08:00
Pavel Feldman b91bb1af9a
chore: minimize configLoader use (#20431) 2023-01-27 12:44:15 -08:00
Pavel Feldman 7d7e66f450
chore: group test runner files by process (#20425) 2023-01-26 17:26:47 -08:00
Pavel Feldman 0c84d88127
chore: extract tasks into separate methods (#20413) 2023-01-26 13:20:05 -08:00
Pavel Feldman 5761a62b1c
docs: clarify the null value for the viewport (#20333)
Fixes https://github.com/microsoft/playwright/issues/20284
2023-01-25 17:48:18 -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 1f576ff0bc
chore: simplify static test annotations (#20335) 2023-01-24 12:49:47 -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 0cc0d168cd
chore: mark 1.31-next (#20268) 2023-01-20 19:29:14 -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 fdd62f31f1
chore: extract pool builder, simplify project suite cloning (#20235) 2023-01-19 15:56:57 -08:00
Dmitry Gozman d950f5b6ee
chore: remove toIntersectViewport for the next release (#20232)
Mostly reverts #19901.
2023-01-19 15:04:09 -08:00
Pavel Feldman e08168e16e
chore: temporarily remove project and global setup, store (#20181) 2023-01-18 12:56:03 -08:00
Pavel Feldman 3fd0530076
chore: remove worker isolation options (#20176) 2023-01-17 17:38:44 -08:00
Pavel Feldman d9d4070520
chore: split config and test loaders (#20175) 2023-01-17 17:16:36 -08:00
Pavel Feldman 020dcd89fa
chore: prepare to load scripts in subprocess (#20174) 2023-01-17 14:53:11 -08:00
Ben McCann 9ba5a1be38
fix: remove export for file that doesn't exist (#20120) 2023-01-17 22:43:07 +01: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
Pavel Feldman 9a64597d74
chore: extract process and process host (#20166) 2023-01-17 12:43:51 -08: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
Dmitry Gozman 9a5df720ff
chore: fix build/watch script for bundles and vite-powered packages (#20055) 2023-01-11 18:36:04 -08: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
Pavel Feldman 6083926111
chore: render readable title separator in errors (#19754) 2023-01-09 09:33:09 -08:00
Andrey Lushnikov 2a49c5e498
feat(expect): introduce expect(locator).toIntersectViewport() (#19901)
This is a new web-first assertion that should be used like this:

```ts
test('should work', async ({ page }) => {
  const locator = page.locator('body');
  // New web-first assertion.
  await expect(locator).toIntersectViewport();
  // The same functionality.
  await expect.poll(() => locator.viewportRatio()).toBeGreaterThan(0);
});
```

Fixes #8740
2023-01-06 16:56:24 -08:00
Dmitry Gozman b376110b77
docs: add proper usage for some test apis (#19925) 2023-01-06 10:26:23 -08:00
Dmitry Gozman 31a63b5c2a
fix(reuse): make reuse work with tracing (#19733)
Fixes #19059.
2023-01-05 14:50:47 -08:00
Yury Semikhatsky 2f3db200f6
chore(cli): filter matches against absolute path (#19900)
#19522
2023-01-05 13:39:39 -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
Grant Colestock a30aac5668
fix: make sure jsx fragments are transformed (#19755)
Fixes: #19142
2022-12-31 11:08:36 -08:00
Michael Glass 13c5019ac9
fix(playwright-test): _removeOutputDirs called without await always returns truthy (#19771) 2022-12-31 11:05:10 -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
Sander c5d9b8d0fb
chore: update to vite 4 (#19690) 2022-12-27 09:14:39 -08:00
Pavel Feldman 233664bd30
chore: report more fatal errors via reporter (#19640) 2022-12-22 17:31:02 -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 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
Andrey Lushnikov 0be1fc8559
chore: cut version 1.29 (#19489) 2022-12-15 11:22:35 -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
Dmitry Gozman 256e9fd443
feat(connect): allow exposing local network to the remote browser (experimental) (#19372)
`connectOptions: { _exposeNetwork: '*' | 'localhost' }`

References #19287.
2022-12-09 11:16:29 -08:00
Andrey Lushnikov 858c2453b3
feat(containers): implement reverse proxy for novnc and server (#18569)
This patch adds a reverse proxy in front of novnc and playwright
server inside the container.

As a result:
- container exposes a single HTTP port to the host
- all Playwright clients can connect using this exposed port, e.g.
  `http://127.0.0.1:5400`
- navigating to the exposed port in the browser lands on a nice HTML
page
  with a link to view container screen
- users can also manually navigate to `http://127.0.0.1:5400/screen` to
  view screen
2022-12-08 17:17:18 -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
Andrey Lushnikov cac67fb94f
chore: do not use "threshold" option for the ssim-cie94 comparator (#19314) 2022-12-06 17:03:13 -08:00
Yury Semikhatsky beb15bb504
chore: rename setup => setupMatch (#19309) 2022-12-06 14:55:22 -08:00
Yury Semikhatsky 1b3e53697b
chore: TestStorage => TestStore (#19308) 2022-12-06 13:33:43 -08:00
Yury Semikhatsky 8660288518
chore: use isProjectSetup instead of set (#19285) 2022-12-06 08:59:28 -08:00
Yury Semikhatsky 3c1b26b9f1
feat: make storage a global variable (#19283) 2022-12-05 21:37:37 -08:00
Yury Semikhatsky f9ef18912d
feat: use setup() instead of test() for project setup (#19281) 2022-12-05 18:15:01 -08:00
Andrey Lushnikov 6d82460a02
feat: implement a new image comparison function (#19166)
This patch implements a new image comparison function, codenamed
"ssim-cie94". The goal of the new comparison function is to cancel out
browser non-determenistic rendering.

To use the new comparison function:

```ts
await expect(page).toHaveScreenshot({
  comparator: 'ssim-cie94',
});
```

As of Nov 30, 2022, we identified the following sources of
non-determenistic rendering for Chromium:
- Anti-aliasing for certain shapes might be different due to the
  way skia rasterizes certain shapes.
- Color blending might be different on `x86` and `aarch64`
architectures.

The new function employs a few heuristics to fight these
differences.

Consider two non-equal image pixels `(r1, g1, b1)` and `(r2, g2, b2)`:
1. If the [CIE94] metric is less then 1.0, then we consider these pixels
   **EQUAL**. (The value `1.0` is the [just-noticeable difference] for
   [CIE94].). Otherwise, proceed to next step.
1. If all the 8 neighbors of the first pixel match its color, or
   if the 8 neighbors of the second pixel match its color, then these
   pixels are **DIFFERENT**. (In case of anti-aliasing, some of the
   direct neighbors have to be blended up or down.) Otherwise, proceed
   to next step.
1. If SSIM in some locality around the different pixels is more than
   0.99, then consider this pixels to be **EQUAL**. Otherwise, mark them
   as **DIFFERENT**. (Local SSIM for anti-aliased pixels turns out to be
   very close to 1.0).

[CIE94]: https://en.wikipedia.org/wiki/Color_difference#CIE94
[just-noticeable difference]:
https://en.wikipedia.org/wiki/Just-noticeable_difference
2022-12-02 15:22:05 -08:00
Dmitry Gozman 6471e8536e
feat(test runner): support jsconfig.json's baseUrl+paths (#19219)
Fixes #19129.
2022-12-01 16:42:25 -08:00
Shubham Kanodia 4679cfaeb9
fix: Fixes #19169 Issue with moving up a directory in snapshotPathTemplate (#19170)
Fixes #19169

Note, I'm not sure why it was done this way before — e.g. Why `testDir`
were considered for resolution, but `testFileDir` wasn't.

Looking for guidance on the approach here, because there are still some
template tokens outside `path.resolve`

Co-authored-by: Shubham Kanodia <skanodia@atlassian.com>
2022-12-01 10:05:15 -08:00
Max Schmitt 62b28c89b4
docs(assertions): fix wrong toHaveText param description (#19213)
Fixes https://github.com/microsoft/playwright/issues/19202
2022-12-01 09:14:06 -08:00
Yury Semikhatsky de1fc170b2
docs: TestProject.setup (#19152) 2022-11-30 09:18:47 -08:00
Pavel Feldman 89bdaf2441
chore: rename ScreenshotAssertions to SnapshotAssertions (#19150) 2022-11-29 16:57:03 -08:00
Yury Semikhatsky c9ec8b3e55
docs: clarify what is passed as Test.grep input (#19153)
Fixes https://github.com/microsoft/playwright/issues/18669
2022-11-29 16:03:30 -08:00
Dmitry Gozman b1b21bdac5
fix(shards): zero-sized shard should not include all tests (#19148)
Fixes #19073.
2022-11-29 16:02:11 -08:00
Shubham Kanodia 3d804ff7cd
chore: rewrite error message for missing snapshot (#19104) 2022-11-29 12:51:15 -08:00
Dmitry Gozman 4f72a895e9
fix(inspector): render expect.not correctly (#19125)
Also fixes the same in expect logs.

References #19083.
2022-11-28 20:50:16 -08:00
Dmitry Gozman 65b0fb055d
docs: note assertion methods that only work with playwright test runner (#19116)
Fixes #18963.
2022-11-28 10:32:48 -08:00
Dmitry Gozman bd07a63683
docs: highlight printsToStdio in reporter reference (#19118)
Fixes #18945.
2022-11-28 10:32:01 -08:00
Pavel Feldman be2139f0ac
docs: split assertions list into langs (#19039) 2022-11-24 08:25:24 -08:00
Pavel Feldman f9a32e0927
chore: follow up to deprecation changes (#19025) 2022-11-23 12:32:14 -08:00
Max Schmitt f8355b940e
chore: bump Babel dependencies (#19026) 2022-11-23 09:37:31 -10:00
Yury Semikhatsky 31d45ad4dc
chore(runner): add all setup files in separate pass (#18978) 2022-11-22 16:22:48 -08:00
Yury Semikhatsky 2dc51f6c46
fix(runner): run all setup files when there is test.only (#18967) 2022-11-21 16:33:23 -08:00
Andrey Lushnikov c0daeaa291
Revert "fix(webserver): do not spawn webserver as a new process group (#18564)" (#18968)
This reverts commit 26044c11c0.

Fixes #18865
2022-11-21 14:40:59 -08:00
Pavel Feldman 620e8547d4
chore: generate usage: sections based on snippets (#18965) 2022-11-21 10:40:21 -08:00
Pavel Feldman 3fb4b3bbf9
chore: normalize api markdown (#18942) 2022-11-21 09:30:32 -08:00
Yury Semikhatsky e1189a96b6
feat(runner): run all setup files if none matched the filter (#18922)
The behavior regarding filters (both in config, command line and .only)
is the following:
- if some of tests match and none of setup match then we'll run all
setup files and all matching tests
- otherwise the filters apply to setup files the same way as to regular
tests
2022-11-21 09:23:28 -08:00
Yury Semikhatsky c0d0f54a12
feat(runner): allow filtering setup and tests (#18900)
Running `npx playwright test file:123` will have the following behavior
- if only test files match then only matching subset of tests will run
but all setup files will run as well
- if only setup files match the filter then only those setup tests will
run
- if both setup and test files match an error will be thrown
2022-11-18 11:35:29 -08:00
Yury Semikhatsky 0f4b67bc6d
test(cli): setup files are in list-files and test --list output (#18890) 2022-11-17 16:31:04 -08:00
Pavel Feldman 4e58b0c2ea
chore: render timed out error message when expect timeouts (#18863)
Fixes https://github.com/microsoft/playwright/issues/18859
2022-11-16 17:00:42 -08:00
Yury Semikhatsky 05fb3e6de8
Revert "chore: hide TestProject.setup and TestInfo.storage (#18800)" (#18836)
Now that the patch has been cherry-picked to the release branch
reverting it on main.

This reverts commit 6deba5dc21.
2022-11-16 11:23:10 -08:00
Yury Semikhatsky 6deba5dc21
chore: hide TestProject.setup and TestInfo.storage (#18800) 2022-11-14 17:03:01 -08:00
Pavel Feldman 8e882fdd58
chore: make generated report writable (#18750)
Fixes: https://github.com/microsoft/playwright/issues/18747
2022-11-13 12:46:35 -08:00
Andrey Lushnikov bc78db07df
chore: cut 1.28 branch (#18746) 2022-11-11 15:30:15 -08:00
Andrey Lushnikov 251cc9e229
chore: fix docs (#18751) 2022-11-11 13:44:40 -08:00
sand4rt 46559a37c1
fix(ct): setting ctTemplateDir does not work (#18152)
closes: https://github.com/microsoft/playwright/issues/18116
2022-11-11 09:52:39 -08:00
Andrey Lushnikov 26044c11c0
fix(webserver): do not spawn webserver as a new process group (#18564)
This patch stops using `processLauncher` to launch web servers. Process
Launcher
will spawn a new process group which is separate from test runner.

This might result in unexpected behavior, e.g. `kill -sigkill
-<testrunnerpid>` will orphan web server process.

Instead, this patch simply spawns web server and sends `SIGTERM` to it
when ready.
2022-11-10 22:30:06 -08:00
Andrey Lushnikov f3a99fdd69
chore: address API review comments for the snapshotPathTemplate (#18716)
This patch:
- updates documentation to lead users from `TestConfig.snapshotDir` and
  `testInfo.snapshotSuffix` to `TestConfig.snapshotPathTemplate` as a
  better and more flexible alternative.
- drops `{snapshotSuffix}` from documentation
- stops using `snapshotSuffix = ''` in our own tests and switches us
  to the `snapshotPathTemplate`.
- adds `{testName}` token.
2022-11-10 17:23:57 -08:00
Chris Alley 1ec614bfc4
docs: fix grammar within class test API documentation (#18627) 2022-11-10 15:53:48 -08:00
Dmitry Gozman 194abc35cd
Revert #18561 "feat(test runner): test.reset() to reset options to default/config value" (#18704)
This reverts commit 6fef227f43.

Not shipping in 1.28.
2022-11-10 14:45:05 -08:00