Commit Graph

1136 Commits

Author SHA1 Message Date
github-actions[bot]
63a0b75186
chore(driver): roll driver to recent Node.js LTS version (#18636) 2022-11-08 03:31:27 -08:00
Yury Semikhatsky
d5494edf71
feat(runner): TestOptions.storageStateName (#18587) 2022-11-07 16:27:38 -08:00
Yury Semikhatsky
25dc0bfacb
feat(runner): change storage fixture to TestInfo.storage() (#18584) 2022-11-04 14:28:25 -07:00
Dmitry Gozman
6fef227f43
feat(test runner): test.reset() to reset options to default/config value (#18561) 2022-11-04 09:03:29 -07:00
Yury Semikhatsky
45aa82242d
feat(runner): storage fixture (#18522) 2022-11-02 20:22:35 -07:00
Dmitry Gozman
8292398692
docs: support custom hrefs for api links (#18514) 2022-11-02 13:35:51 -07:00
Pavel Feldman
2183d9e9a2
chore: use codemirror for editor (#18482) 2022-11-01 15:04:30 -07:00
Pavel Feldman
4d53fd9c63
chore: download android driver from the cdn (#18466) 2022-10-31 16:08:26 -07:00
Yury Semikhatsky
7337dd4e28
chore: revert project.{stage,run} (#18462) 2022-10-31 14:04:24 -07:00
Max Schmitt
490513a017
devops: update repo for internal tests 2022-10-30 21:33:30 -07:00
Dmitry Gozman
2d3b2a0768
feat(test runner): test.describe.configure({ retries, timeout }) (#18388)
References #10825.
2022-10-27 15:53:27 -07:00
github-actions[bot]
02499cf589
chore(driver): roll driver to recent Node.js LTS version (#18333)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-10-26 08:12:39 -07:00
Max Schmitt
5d99719f5d
chore: use Node.js 18 for Docker images (#18334)
Node.js 18 is now LTS and we follow LTS schedule.
2022-10-26 08:11:20 -07:00
Max Schmitt
805312b722
feat(android): add Android.{launchServer,connect} (#18263)
Fixes https://github.com/microsoft/playwright/issues/17538
2022-10-24 17:23:11 -07:00
Yury Semikhatsky
11eb719d13
feat(runner): project run: "always" (#18160)
Projects marked with `run: 'always'` are non shard-able and run after
failures.
2022-10-18 17:18:45 -07:00
Pavel Feldman
739b64a09a
chore: render typed locators in the recorder (#18162) 2022-10-18 16:39:58 -07:00
github-actions[bot]
3f2d58eeec
chore(driver): roll driver to recent Node.js LTS version (#18055)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-10-13 14:33:07 +03:00
Yury Semikhatsky
08a3a269cd
feat(runner): project.canShard (#18037) 2022-10-12 14:34:22 -07:00
Yury Semikhatsky
3b8f63d703
feat(runner): project.stopOnFailure (#18009) 2022-10-11 17:04:01 -07:00
Yury Semikhatsky
3592269caf
feat(runner): project.stage (#17971) 2022-10-10 17:56:18 -07:00
Yury Semikhatsky
3da72235e2
chore: add ts_to_java test conversion script (#17914) 2022-10-07 13:16:46 -07:00
Pavel Feldman
c81af6b2bd
chore: generalize branch name attr (#17898) 2022-10-06 21:58:30 -07:00
Dmitry Gozman
6750a02506
fix(api): hide TestConfig.groups (#17853)
Also fix types for `FullConfig.configFile`.
2022-10-05 14:24:14 -07:00
Max Schmitt
e8413264fa
chore: fix .NET generator (#17849) 2022-10-05 21:01:57 +02:00
Stephen Li
0b1b718afc
feat(core): type addInitScript function arg (#17651)
Allows autocomplete on the arg passed to the init script

```ts
await page.addInitScript((arg) => {
    window.localStorage.setItem('init_user_state', JSON.stringify(arg.initUserState)) // arg was previously 'any'
}, {
    initUserState: { foo: 'bar' },
})
```
2022-10-05 09:08:30 -07:00
Pavel Feldman
e09945c637
chore: handle unexpected ws response (#17714) 2022-09-29 14:04:19 -07:00
Pavel Feldman
a97deb1600
chore: hide reporter project id (#17710) 2022-09-29 12:51:06 -07:00
Yury Semikhatsky
9f17ee6871
feat: group filter (#17646) 2022-09-28 18:45:01 -07:00
Pavel Feldman
cadd4d1dd0
chore: migrate http server to ts (#17677) 2022-09-28 17:01:13 -07:00
Pavel Feldman
d8f67eb75d
feat(api): introduce getByTestId (#17645) 2022-09-27 21:06:07 -07:00
Pavel Feldman
8ad201b802
chore: add snippet to the json report (#17567) 2022-09-27 13:23:08 -07:00
Pavel Feldman
bfd38bf7df
chore: introduce md templates (#17632) 2022-09-27 10:29:34 -07:00
Pavel Feldman
0a3cfc1c21
chore: annotate md utils to compile with ts-check (#17600) 2022-09-27 09:27:23 -07:00
github-actions[bot]
15c6488c8f
chore(driver): roll driver to recent Node.js LTS version (#17620)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-27 13:53:07 +02:00
Max Schmitt
cf75f8ca20
chore: custom error if HTML report gets uploaded in Trace Viewer (#17558)
Fixes https://github.com/microsoft/playwright/issues/17309
2022-09-26 20:57:05 +02:00
Max Schmitt
a5eee6d960
fix(driver): with CWD which contained spaces (#17579)
Fixes https://github.com/microsoft/playwright-python/issues/1561
Fixes https://github.com/microsoft/playwright-python/issues/1565
2022-09-26 19:19:04 +02:00
Andrey Lushnikov
4cd2176155
feat(containers): introduce separate container commands (#17541)
This patch introduces hidden commands to control container
lifecycle:
- `npx playwright docker install-server-deps` to install fluxbox,
  vnc, novnc & to configure them.
- `npx playwright docker run-server` to run a server inside the
  container.

Drive-by: remove old version of container image when building a new
version with the same name. This way we won't pile up untagged
container images.
2022-09-22 13:38:54 -07:00
Andrey Lushnikov
d431958603
chore: move container integration back to playwright-core (#17487) 2022-09-21 12:45:43 -07:00
Pavel Feldman
53ab3d19e8
fix(protocol): update build tools (#17515) 2022-09-21 12:43:18 -07:00
Pavel Feldman
df143031e7
chore: move protocol and trace types into the top-level packages (#17486) 2022-09-20 18:41:51 -07:00
Pavel Feldman
854c783019
chore: project.id, configFile in reporter apis (#17346) 2022-09-14 14:56:28 -07:00
Andrey Lushnikov
462fa7d79d
devops: upload reports to a new container (#17298)
This patch:
- adds `gitBranchName` to the infra metadata to the report
- starts uploading persistent reports to a different container, prefixed
with utc year-month-date.
2022-09-13 10:55:39 -07:00
Max Schmitt
c7367b7065
chore(dotnet): no nested namespace in transport channels (#17273) 2022-09-12 23:13:59 +02:00
Max Schmitt
0b4de0df7f
chore(dotnet): use csharp 10 namespace declaration (#17248) 2022-09-12 11:01:49 -07:00
Andrey Lushnikov
af042beb13
feat: introduce docker integration (#16382)
This patch introduces the following commands:
- `npx playwright docker build` that builds a VRT docker image
  locally that is based off the `mcr.microsoft.com/playwright:jammy`
- `npx playwright docker start` that launches a docker container with
  browsers.
- `npx playwright docker stop` that stops given docker container.
- `npx playwright docker test` that runs all the tests inside a
  launched docker container.
2022-09-09 15:25:42 -07:00
Yury Semikhatsky
fbf9ca5316
fix: avoid using builtins in injected script bundles (#17145) 2022-09-06 17:25:02 -07:00
nate-ro
409bab59ea
chore: added starting time of test to the base json reporter (#16885) 2022-08-30 20:03:21 -07:00
sand4rt
ad46e980bc
feat(ct): initial solid (#16703) 2022-08-23 14:08:53 -07:00
Ross Wollman
aa23914659
chore: remove invalid device configurations (#16777)
Resolves #16622.

- removes current invalid configurations
- validates future changes
2022-08-23 14:03:41 -07:00
Andrey Lushnikov
e7fa9432fb
fix: ensure browser versions in browsers.json (#16760)
Fixes #15702
2022-08-23 09:22:54 -07:00
Yury Semikhatsky
b51b7e7f67
fix: devices is a map not an array (#16729) 2022-08-22 11:34:53 -07:00
github-actions[bot]
4a04d8d0b0
chore(driver): roll driver to recent Node.js LTS version (#16632)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-18 10:35:05 +02:00
Yury Semikhatsky
d133b58a96
fix(driver): PLAYWRIGHT_NODEJS_PATH test in sh (#16554) 2022-08-15 12:24:52 -07:00
Elizaveta Bezyaikna
9f22ae9aa9
chore: add id for each test to JSONReporter (#16494) 2022-08-15 09:28:21 -07:00
Yury Semikhatsky
ed1e5efc5c
feat: allow running driver with preinstalled node.js (#16518) 2022-08-15 09:27:35 -07:00
Max Schmitt
e725b5f8a9
fix(esm): fix TS type check with NodeNext mode (#16340) 2022-08-09 20:06:06 +02:00
Max Schmitt
841ee02dc2
test: add host GPU support on Android tests (#16241) 2022-08-04 09:36:04 +02:00
Dmitry Gozman
445fe032f5
feat(test runner): separate interrupted status from skipped (#16124) 2022-08-02 12:55:43 -07:00
Max Schmitt
153670978d
chore: fix Android 13 compatibility (#16139) 2022-08-02 18:22:27 +02:00
Pavel Feldman
5a79054544
feat(innerloop): allow reusing browsers over the remote connection (#16065) 2022-07-31 14:31:17 -07:00
Yury Semikhatsky
7d306bbc66
feat: return value from step (#16060) 2022-07-29 15:16:07 -07:00
Dmitry Gozman
e830fe821d
feat(test runner): introduce test.describe.fixme (#16059) 2022-07-29 12:44:22 -07:00
Yury Semikhatsky
af8e3e7afa
feat: print response text when toBeOK fails (#16040) 2022-07-29 11:46:48 -07:00
Max Schmitt
db5e097aca
chore: add 'gpg' package to Docker images (#15917) 2022-07-25 12:49:51 +02:00
Max Schmitt
004cd9273c
fix(test-runner): multiple webServer types (#15901) 2022-07-25 10:39:06 +02:00
Max Schmitt
501b24a078
test: android test enhancements (#15797) 2022-07-20 18:27:08 +02:00
Pavel Feldman
55cd3928b7
chore: reuse context in the innerloop mode (#15719) 2022-07-15 10:36:36 -07:00
Max Schmitt
98ea418124
fix(expect): expect.not types (#15487) 2022-07-11 18:31:53 +02:00
github-actions[bot]
88015d3791
chore(driver): roll driver to recent Node.js LTS version (#15534)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-07-11 15:56:07 +02:00
Max Schmitt
02ed5b4cd6 devops: auto roll Node.js version of driver follow-up 2022-07-11 15:54:46 +02:00
Max Schmitt
9110d64917
devops: add auto driver Node.js roll bot (#15531) 2022-07-11 15:27:44 +02:00
Ross Wollman
799d4703bc
feature(test-runner): multiple web servers (#15388)
Fixes #8206.

Since #8206 is a long-awaited (~ 1 year old), popular (~ 45 reactions, frequently requested in community channels, etc.), this PR aims to unblock folks.

Notably, we do not innovate on the `webServer` API, despite knowing we're not in love with it. We'll save the innovation for either Plugins or a new `LaunchConfigs` option. (We haven't yet arrived at a Plugin API we like, and instead of launching a new option guessing what the "better" launchConfig API would be, let's wait and see how folks use this new Array-variant of `webServer` which—despite its name—can be used for non-Web Server launches!
2022-07-07 15:27:21 -07:00
Dmitry Gozman
89c16cbc8b
feat(runner): anonymous describes (#15424)
Useful to set some options without coming up with an artificial name.

```js
test.describe(() => {
  test.use({ colorScheme: 'dark' });

  test('my test', () => {});
})
```
2022-07-06 13:54:11 -07:00
Pavel Feldman
6181b0dcaf
docs: annotate since (#15386) 2022-07-05 17:24:50 -07:00
Dmitry Gozman
4eccb89a79
chore: do not serialize buffers into base64 in local mode (#15316) 2022-07-05 08:58:34 -07:00
Dmitry Gozman
82032be368
chore(server): validate/convert protocol both ways (#14811)
Previously, we only validated/converted on the way to the server,
but not from the server.

Validating both ways catches issues earlier, and allows us to
perform automatic conversions, for example only converting
buffers to base64 when sending over wire.
2022-07-01 09:58:07 -07:00
Max Schmitt
f6bdf3a3cc
chore: generate types always with LF (#15245) 2022-06-29 23:19:49 +02:00
Ross Wollman
3805e942a1
docs(java): fix pom.xml (and auto-generate) (#15192) 2022-06-28 11:37:53 -07:00
Andrey Lushnikov
857d46ca93
docs: add Java release notes (#15158) 2022-06-27 15:31:41 -07:00
Pavel Feldman
d60f84d06a
chore: fix api.json (#15093) 2022-06-23 16:15:14 -07:00
Dmitry Gozman
033c250f6d
fix(har): remove types/har.d.ts, update har.ts per spec (#15046)
Drive-by: typo fix in `notFound` option name.
2022-06-22 12:16:29 -07:00
Pavel Feldman
9525bedc1f
feat(har): re-add routeFromHAR (#15024) 2022-06-21 22:12:37 -07:00
Dmitry Gozman
e3da3ebfa4
feat(har): do not expose HAR types, remove HARResponse fulfill (#14992) 2022-06-20 15:19:54 -07:00
Dmitry Gozman
5397394653
feature(har): add testOptions.har (#14991)
Can now be used with `test.use({ har })`.
Also added more tests for latest har features.
2022-06-20 13:37:31 -07:00
Pavel Feldman
225ab68d1c
fix(test): fix the route test (#14890) 2022-06-15 16:15:45 -07:00
Yury Semikhatsky
e00a26a11d
feat(route): fulfill with HARResponse (#14865) 2022-06-14 15:07:22 -07:00
Max Schmitt
4f1ab2fa62 devops: fix Docker publishing 2022-06-14 11:20:29 +02:00
Ross Wollman
b76d3f2b40
chore: fix publish_docker.sh (#14851)
Started failing a few days ago (https://github.com/microsoft/playwright/runs/6871909784?check_suite_focus=true)
with:

```
./utils/docker/publish_docker.sh: line 82: syntax error near unexpected
token `else'
```
2022-06-13 18:19:57 -07:00
Pavel Feldman
76abb3a5be
chore: unify tab generation (#14802) 2022-06-10 17:34:31 -07:00
Max Schmitt
d1a7fa2901
chore: add Ubuntu 22 Docker image (#14755) 2022-06-09 23:19:54 +02:00
Andrey Lushnikov
b1aa295923
devops: fix canary publishing (#14746)
The first time a scoped package is published, it is considered to be
private.

See https://stackoverflow.com/a/44862841/314883
2022-06-09 07:22:05 -07:00
Max Schmitt
3853014fa7
chore: add ubuntu 22 support (#14588) 2022-06-09 13:20:18 +02:00
Ross Wollman
85d03714d9
feat: add allow/block serviceWorkers option (#14714)
Adds cross-browser support for easily allowing/blocking Service Workers via a Context option.

Includes plumbing for Playwright Test's `use`.

Resolves #14522.

Relates #1090.
Supercedes #14321.
2022-06-08 18:27:51 -04:00
Pavel Feldman
ca2afaaebd
chore: update babel (#14646) 2022-06-06 15:49:31 -07:00
Pavel Feldman
74b846270b
feat(ct): support Vue2 (#14600) 2022-06-02 17:37:43 -07:00
Dmitry Gozman
dbcf039717
chore: remove experimental types (#14560) 2022-06-01 15:22:43 -07:00
Max Schmitt
88ba9c2ff2
docs(dotnet): fix APIResponse.headers type (#14518) 2022-05-31 17:46:03 +02:00
Ross Wollman
cfc9aa64a6
chore: produce meaningful bundle notice diffs (#14396) 2022-05-24 22:19:54 -07:00
Max Schmitt
7f640d8a49
docs(dotnet): add API testing (#13889) 2022-05-23 22:12:57 +03:00
Max Schmitt
806b9c8764
chore(dotnet): generate object types from protocol (#14342) 2022-05-23 19:10:46 +03:00
Dmitry Gozman
ba0cfaeb2d
fix(chromium): work around about:blank issue on Chromium (#14068)
fix(chromium): work around about:blank issue on Chromium

We don't receive the `loaderId` which translates to `newDocumentId`,
so we expect the same-document navigation. Instead, we can wait
for any new-document navigation as a workaround, only for `about:blank`.

This also reverts commit f0f65fa247.
2022-05-10 20:32:19 +01:00
Pavel Feldman
cf89a36181
chore: serialize circular objects (#14045) 2022-05-09 18:51:53 -07:00
Pavel Feldman
f0f65fa247 Revert "feat(chromium): roll to r1005 (#13999)"
This reverts commit 56b3bca8db.
2022-05-09 18:28:39 -07:00
Pavel Feldman
e9378ba5fc
chore: hide plugins again (#14038) 2022-05-09 10:06:13 -07:00
github-actions[bot]
56b3bca8db
feat(chromium): roll to r1005 (#13999)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-05-09 15:52:00 +01:00
Pavel Feldman
1bbefce9af
Revert "chore: use plugins for component testing again (#13977)" (#13998)
This reverts commit a2f9f15e3e.
2022-05-06 12:02:07 -07:00
Andrey Lushnikov
b07636d5a7
devops: fix flakiness dashboard (#13997)
These fields are crucial for report processing.
2022-05-06 10:58:15 -07:00
Pavel Feldman
a2f9f15e3e
chore: use plugins for component testing again (#13977) 2022-05-05 14:26:56 -07:00
Pavel Feldman
058f32caff
chore: fixtures-via-plugin implementation (#13950) 2022-05-05 10:14:00 -07:00
Andrey Lushnikov
bfafb2680d
fix: put browserVersion in the browsers.json (#13946)
This patch:
- adds `browserVersion` field to the `browsers.json`. This is
  updated every time we roll browser.
- starts using `browserVersion` to display browser version that's
  been downloaded.

The downloading output now looks like this:

```bash
Downloading Chromium 101.0.4951.41 (playwright build v1003) - 118.9 Mb [====================] 100% 0.0s
Chromium 101.0.4951.41 (playwright build v1003) downloaded to /Users/andreylushnikov/Library/Caches/ms-playwright/chromium-1003
Downloading FFMPEG playwright build v1007 - 1 Mb [====================] 100% 0.0s
FFMPEG playwright build v1007 downloaded to /Users/andreylushnikov/Library/Caches/ms-playwright/ffmpeg-1007
Downloading Firefox 99.0.1 (playwright build v1323) - 67.5 Mb [====================] 100% 0.0s
Firefox 99.0.1 (playwright build v1323) downloaded to /Users/andreylushnikov/Library/Caches/ms-playwright/firefox-1323
Downloading Webkit 15.4 (playwright build v1632) - 52.7 Mb [====================] 100% 0.0s
Webkit 15.4 (playwright build v1632) downloaded to /Users/andreylushnikov/Library/Caches/ms-playwright/webkit-1632
```

Fixes #13198
2022-05-05 04:17:13 -07:00
Ross Wollman
95f7acf1e4
chore: widen Metadata type (#13942) 2022-05-04 13:16:11 -07:00
Andrey Lushnikov
0dd8ab9c6d
devops: more compact commits for the flakiness dashboard (#13912)
- do not collect commit info since we don't use
- do not store CI plugin information
- do not store test timings
2022-05-04 09:43:07 -07:00
Ross Wollman
3b3cad7d69
feat: rewrite gitCommitInfo plugin, drop GlobalInfo & attachments (#13837) 2022-05-02 16:28:14 -07:00
Max Schmitt
2dafbfc2dc
chore(dotnet): do not rely on auto camel case for channel initializers (#13867) 2022-05-02 15:29:35 +01:00
Pavel Feldman
e756528ad2
feat(plugins): expose suite to plugin setup (#13807) 2022-04-28 08:16:17 -07:00
Dmitry Gozman
3aba94dbef
chore: remove unnecessary types from overrides-test (#13794) 2022-04-27 16:14:37 +01:00
Pavel Feldman
bc6f8e1f20
feat(poll): expose custom poll interval (#13776) 2022-04-26 21:32:38 -07:00
Dmitry Gozman
8e5854033a
fix: types generation for attach and GlobalInfo (#13727) 2022-04-25 13:56:37 +01:00
Ross Wollman
3eac9c694c
fix(test-runner): mark attach as async (#13687)
Also brings back generation of experimental types as part of lint.
2022-04-22 09:27:02 -07:00
Pavel Feldman
7989427ea6
chore: bundle core deps (#13621) 2022-04-18 20:20:49 -07:00
Pavel Feldman
58d79e5e4d
chore: add core utils bundle (#13615) 2022-04-18 13:47:23 -07:00
Pavel Feldman
4f0103fef0
chore: babel, expect, zip bundles (#13588) 2022-04-18 11:31:58 -07:00
Pavel Feldman
eafb92f6a3
chore: embed expect types (#13609) 2022-04-18 10:54:40 -07:00
Dmitry Gozman
02aa4fe617
chore: generate types for TestProject/TestConfig (#13574) 2022-04-15 10:27:38 -07:00
Dmitry Gozman
189a5fa0f8
chore: freez FullProject public type (#13570)
This is similar to FullConfig.
Properties `expect` and `fullyParallel` are not exposed.
2022-04-14 16:58:01 -07:00
Wojciech Jureczka
7ba527c65f
chore: expose JSON Reporter types (#13241)
Resolves #13208
2022-04-14 13:55:29 -07:00
Dmitry Gozman
c86c2e8762
feat: restore toHaveScreenshot as experimental feature (#13549)
- Restore docs.
- Make `TestConfig.expect` generated.
- Allow experimental properties with "e" marker: `- foo e<float>`.
2022-04-14 13:22:42 -07:00
Dmitry Gozman
20dcc45afa
feat: support experimental doc entries (#13446)
feat: support experimental doc entries

- Params/options/members are marked as experimental in the docs.
- `experimental.d.ts` is generated that contains all types and
  includes experimental features.
- `experimental.d.ts` is references in our tests so that we
  can test experimental features.
- `fonts` option is restored as experimental.
2022-04-13 16:13:30 -07:00
Dmitry Gozman
1e1df6395f
chore: generate expect types (#13439) 2022-04-11 10:42:19 -07:00
Ross Wollman
1af32e400f
feat(test-runner): introduce GlobalInfo (#13083) 2022-04-08 13:22:14 -07:00
Pavel Feldman
f0156d057e
chore: flatten supplements (#13437) 2022-04-08 12:52:40 -07:00
Max Schmitt
65395d651c
docs(dotnet): fix broken generated docs links (#13425) 2022-04-08 18:29:51 +02:00
Pavel Feldman
845e32cbb8
chore: use utils via index export (6) (#13417) 2022-04-07 21:48:41 -07:00
Dmitry Gozman
cef476b89f
docs: support optional methods (#13415)
So far, these are used in `Reporter`.
2022-04-07 18:51:05 -07:00
Andrey Lushnikov
e3450b86f9
devops: fix //utils/workspace.js --set-version script (#13409)
We use this script to update packages version across our repository.
It was broken because it did not account for the devDependencies.
2022-04-07 14:46:43 -07:00
Pavel Feldman
bde7bf4ea9
chore: move registry & dispatchers to under server (#13370) 2022-04-06 22:21:27 -07:00
Dmitry Gozman
c68f57d2d0
docs: mark optional properties/arguments explicitly with "?" (#13369)
Previously, we were guessing whether something is optional from the
comment (looking for stuff like "defaults to" or "optional").

To remove this error-prone technique, every optional property or
argument (but not option) is explicitly marked with "?".
2022-04-06 19:02:10 -07:00
Pavel Feldman
5ae2017a5b
chore: always import type (#13365) 2022-04-06 14:57:14 -07:00
Pavel Feldman
1c3db811f5
chore: move to folder-based deps lists (#13361) 2022-04-06 14:40:19 -07:00
Dmitry Gozman
4123a55be5
chore: generate more types (#13358)
As a result, fix documentation issues:
- Removed `TestStep.data` that is not a thing.
- Added `TestConfig.name` documentation.
- Refined a lot of optional types in the documentation.
- Aligned `test.fail()` and `test.slow()` docs with `test.skip()`.
- Strict set of docs vs types inconsistensies in the generator
2022-04-06 13:36:20 -07:00
Dmitry Gozman
e31a5b690a
chore: unrelease toHaveScreenshot and screenshotsDir (#13304) 2022-04-05 08:34:51 -07:00
Ross Wollman
16efbdef98
chore: remove/rename FullConfig._attachments (#13233)
This was originally introduced in #12734.

It will be replaced with GlobalInfo (#13083), but not before the 1.21
release.
2022-04-01 12:36:05 -07:00
Dmitry Gozman
a200fe3528
feat(screenshot): rename "size" option to "scale" (#13254)
Drive-by: fix `caret` handling in `toHaveScreenshot`.
2022-04-01 12:28:40 -07:00
Dmitry Gozman
ecc804d808
chore: prepare types to stricter checks in TS 4.7.0 (#13193) 2022-03-30 20:33:36 -07:00
Andrey Lushnikov
a9989852d5
feat(vrt): new option "caret" for taking screenshots (#13164)
This has two values:
- `"hide"` to hide input caret for taking screenshot
- `"initial"` to keep caret behavior unchanged

Defaults to `"hide"`.

Fixes #12643
2022-03-29 17:48:13 -07:00
Dmitry Gozman
eb09306db2
feat(connect): add connectOptions.timeout (#13163) 2022-03-29 15:03:43 -07:00
Pavel Feldman
1961959dcb
chore: migrate injected scripts to esbuild (#13143) 2022-03-28 23:10:17 -07:00
Pavel Feldman
8758cf8cbf
chore: migrate html reporter to vite (#13116) 2022-03-28 18:21:19 -07:00
Ross Wollman
ae365dda3b
chore: remove internal dep on FullConfig (#13074)
Resolves #13058.

This blocks adding #8206 since we don't want the new launch configs
publicly available on FullConfig.
2022-03-28 15:53:42 -07:00
Pavel Feldman
a454328c25
fix(test): follow up to tests refactoring (#13085) 2022-03-25 22:11:29 -07:00
Andrey Lushnikov
4ab4c0bda1
feat: detect docker version and Playwright version mismatch (#12806)
This patch prints a friendly instructions in case Docker image version
mismatches Playwright version and there are missing browser
dependencies.

With this patch, Playwright will yield the following error:

```
root@f0774d2b2097:~# node a.mjs
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

browserType.launch:
╔════════════════════════════════════════════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers.                                       ║
║ This is most likely due to docker image version not matching Playwright version:           ║
║ - Playwright: 1.22.0                                                                       ║
║ -     Docker: 1.21.0                                                                       ║
║                                                                                            ║
║ Either:                                                                                    ║
║ - (recommended) use docker image "mcr.microsoft.com/playwright:v1.22.0-focal"              ║
║ - (alternative 1) run the following command inside docker to install missing dependencies: ║
║                                                                                            ║
║     npx playwright install-deps                                                            ║
║                                                                                            ║
║ - (alternative 2) use Aptitude inside docker:                                              ║
║                                                                                            ║
║     apt-get install libgbm1                                                                ║
║                                                                                            ║
║ <3 Playwright Team                                                                         ║
╚════════════════════════════════════════════════════════════════════════════════════════════╝
    at file:///root/a.mjs:3:10 {
  name: 'Error'
}```

Fixes #12796

Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2022-03-25 14:45:53 -07:00
Pavel Feldman
6b81e76c2b
chore: migrate trace-viewer and recorder to vite (#13076) 2022-03-25 14:12:00 -07:00
Max Schmitt
c8cc62a2e6
chore: add link validation for docs (#13047) 2022-03-25 19:30:45 +01:00
Pavel Feldman
07c1a27732
chore(deps): prepare deps for monorepo (#13057) 2022-03-25 08:43:29 -07:00
Pavel Feldman
71dd960fec
fix(watch): throttle / batch watch processing (#13054) 2022-03-24 17:38:03 -07:00
Max Schmitt
1797c5c249
chore(test-runner): support self signed certificate in webServer (#13032) 2022-03-24 17:30:52 +01:00
Ross Wollman
541fb39a51
feat(html-reporter): add report context header (#12734)
Resolves #11318.

* Adds `TestConfig.attachments` public API. (We opted to not implement an analog to the async `TestInfo.attach(…)` API.)
* Adds `TestConfig.attachments` to common reporters.
* Dogfoods some git and CI-info inference to generate useful atttachments
* Updates HTML Reporter to include a side bar to present a pre-defined set of attachments (a.k.a git/commit context sidebar)

Here's what it looks like:

<img width="1738" alt="Screen Shot 2022-03-21 at 3 23 28 PM" src="https://user-images.githubusercontent.com/11915034/159373291-8b937d30-fba3-472a-853a-766018f6b3e2.png">

See `tests/playwright-test/reporter-html.spec.ts` for an example of usage (for dogfood-ing only). In the future, if this becomes user-facing, there the Global Setup bit would likely become unnecessary (as would interaction with attachments array); there would likely just be a nice top-level config and/or CLI flag to enable collecting of info.
2022-03-22 16:28:04 -07:00
Dmitry Gozman
209bde5000
feat(test runner): descrbe.skip (#12865)
`describe.skip` declares a test group that is skipped.
2022-03-18 16:07:11 -07:00
Yury Semikhatsky
a8d80621b2
feat(chromium): large file uploads (#12860) 2022-03-18 09:00:52 -07:00
Max Schmitt
f3ffd328dd
chore: fix modification dates in driver (#12864) 2022-03-18 13:03:09 +01:00
Dmitry Gozman
25483452c0
feat(fixtures): per-fixture timeout (#12751)
By default, fixtures share timeout with the test they are instantiated for.
However, for more heavy fixtures, especially worker-scoped ones, it makes
sense to have a separate timeout.

This introduces `{ timeout: number }` option to the list of fixture options
that opts the fixture into a dedicated timeout rather than sharing it
with the test.
2022-03-17 09:36:03 -07:00
Andrey Lushnikov
e16f3c46b4
docs: always keep docker references up-to-date in documentation (#12795)
References #12796
2022-03-16 13:51:39 -07:00
Pavel Feldman
25c0369eaf
chore: prepare to publish component packages (#12697) 2022-03-12 13:51:27 -08:00
Pavel Feldman
e9fa098bf3
chore: add ct examples (#12693) 2022-03-11 15:46:11 -08:00
Andrey Lushnikov
e3ab6388a9
feat(toHaveScreenshot): enable sensible defaults (#12675)
This patch:
- Enables configuration of certain defaults for some options of `expect.toHaveScreenshot` method via `TestProject.expect.toHaveScreenshot` property
- Sets sensible defaults for these options:
  * `fonts: "ready"`
  * `animations: "disabled"`
  * `size: "css"`
2022-03-11 08:45:36 -08:00
Pavel Feldman
af55f48754
chore: add experimental mount (#12657) 2022-03-11 08:00:46 -08:00
Andrey Lushnikov
b51157bdea
feat: bring back maxDiffPixels in toMatchSnapshot (#12627)
This patch reverts 2 commits that removed the feature from the method:
- "fix: explicitly ignore maxDiffPixels in toMatchSnapshot (#12570)"
  commit b8af8458d6.
- "chore: remove `maxDiffPixels` from toMatchSnapshot (#12539)"
  commit a3dff45974.
2022-03-10 18:41:16 -08:00
Andrey Lushnikov
12d8a262be
feat: support screenshotsDir option (#12642)
The `screenshotsDir` option controls the expectation storage
for `toHaveScreenshot()` function.

The new expectation management for screenshots has the following
key properties:
- All screenshots are stored in a single folder called `screenshotsDir`.
- Screenshot names **do not** respect `snapshotDir` and `snapshotSuffix`
  configurations.
- `screenshotsDir` is configurable per project. This way a "smoke tests"
  project can re-use screenshots from "all tests" project.
- Host platform is a top-level folder.

For example, given the following config:

```js
// playwright.config.ts
module.exports = {
  projects: [
    { name: 'Mobile Safari' },
    { name: 'Desktop Chrome' },
  ],
};
```

And the following test structure:

```
smoke-tests/
└── basic.spec.ts
```

Will result in the following screenshots folder structure by default:

```
__screenshots__/
└── darwin/
    ├── Mobile Safari/
    │   └── smoke-tests/
    │       └── basic.spec.ts/
    │           └── screenshot-expectation.png
    └── Desktop Chrome/
        └── smoke-tests/
            └── basic.spec.ts/
                └── screenshot-expectation.png
```
2022-03-10 16:50:26 -08:00
Max Schmitt
372a3219f3
chore: remove Python from main Docker image (#12431) 2022-03-10 19:51:35 +01:00
Yury Semikhatsky
79c8746fd2
docs: add name for screenshot animations option (#12601) 2022-03-08 16:02:31 -08:00
Andrey Lushnikov
a3dff45974
chore: remove maxDiffPixels from toMatchSnapshot (#12539)
References #12441
2022-03-04 18:27:04 -08:00
Andrey Lushnikov
4953fc4845
chore: introduce toHaveScreenshot configuration options (#12507)
References https://github.com/microsoft/playwright/issues/12441
2022-03-04 17:30:43 -08:00
Yury Semikhatsky
f96a1a3ccd
fix(devops): list dependencies error (#12521) 2022-03-04 09:23:05 -08:00
Andrey Lushnikov
279e579097
chore: address pixelCount and pixelRatio review comments (#12501)
- documentation fixes
- rename pixelCount to maxDiffPixels
- rename pixelRatio to maxDiffPixelRatio
2022-03-03 23:17:31 -08:00
Yury Semikhatsky
b96bbc6ad7
docs: simplify test-assertions.md, avoid duplication (#12475) 2022-03-03 10:06:14 -08:00
Pavel Feldman
34bf0d4b87
feat(test-runner): allow grepping in project (#12469) 2022-03-02 15:02:35 -08:00
Yury Semikhatsky
a413c0f94c
docs: restore assertions timeout option in js (#12467) 2022-03-02 12:43:16 -08:00
Pavel Feldman
4b19d59ec5
feat(test): introduce fully parallel mode (#12446) 2022-03-01 18:12:21 -08:00
Andrey Lushnikov
33655ff168
devops(flakiness-dashboard): another fix to support empty metadata (#12430) 2022-03-01 01:50:40 -08:00
Andrey Lushnikov
4a1878e00e
devops: fix flakiness dashboard for projects with no metadata (#12426) 2022-03-01 01:21:00 -08:00
Andrey Lushnikov
396d920145
feat(test-runner): implement expect(pageOrLocator).toHaveScreenshot (#12242)
Fixes #9938
2022-02-28 12:25:59 -08:00
Max Schmitt
428a014cad
devops: Docker publishing cleanups (#12341) 2022-02-24 18:10:34 +01:00
Max Schmitt
0b55950d6a
chore: fix Android tests (#12325) 2022-02-24 06:57:32 +01:00
Andrey Lushnikov
a98babec69
feat(test-runner): introduce pixelCount and pixelRatio options (#12169)
This patch adds additional options to `toMatchSnapshot` method:
- `pixelCount` - acceptable number of pixels that differ to still
  consider images equal. Unset by default.
- `pixelRatio` - acceptable ratio of all image pixels (from 0 to 1) that differ to still
  consider images equal. Unset by default.

Fixes #12167, #10219
2022-02-17 15:44:03 -08:00
Yury Semikhatsky
abd7084bcc
fix: match default font families in headless chromium (#11340) 2022-02-11 09:06:17 -08:00
Dmitry Gozman
66b5cf5ae1
feat(remote): make PlaywrightServer work with browserType.connect (#11849)
This changes PlaywrigtServer to serve connections like `ws://localhost:3333/?browser=chromium`:
- launches the browser;
- talks `browserType.connect`-style protocol over websocket;
- compatible with `connectOptions` fixture.

```js
await playwright.chromium.connect({ wsEndpoint: 'ws://localhost:3333/?browser=chrome' });
```
2022-02-10 16:36:23 -08:00
Max Schmitt
b8d588aa47
chore: fix .NET generation script for .NET 6 (#11965) 2022-02-09 18:03:37 +01:00
Dmitry Gozman
19368e93af
feat(test runner): support connectOptions (#11919)
This allows to specify `connectOptions` in the config that
switch built-in `browser` to be remotely connected.
2022-02-08 20:45:42 -08:00
Andrey Lushnikov
39ed705904
chore: unify workspace helper scripts (#11925)
This patch unifies a variety of different workspace
scripts into a single `//utils/workspace.js`.

Fixes #11362
2022-02-08 10:35:00 -08:00
Pavel Feldman
1215057ca1
chore: use ipc transport for out-of-process driver (#11826) 2022-02-02 21:26:45 -08:00
Pavel Feldman
fdda759a9d
feat(parallel): allow setting enclosing scope parallel mode (#11822) 2022-02-02 20:44:11 -08:00
Andrey Lushnikov
ba0c7e679b
feat(test-runner): support expect.soft (#11800)
Soft expects will still fail the test, but will not abort it's execution. As a consequence of this:
-  `TestResult` now might have multiple errors, which is reflected with a new `testResult.erros: TestError[]` field.
- `TestInfo` now might have multiple errors as well, which is reflected with a new `testInfo.errors: TestError[]` field.

Fixes #7819
2022-02-02 18:33:51 -08:00
Max Schmitt
c752b28516
chore: pin production dependencies (#11793) 2022-02-02 11:14:41 +01:00
Pavel Feldman
6e2fcc4700
chore: do not expose suite load error (#11797) 2022-02-01 15:34:16 -08:00
Max Schmitt
028afb167b
chore: bump production dependencies (#11787) 2022-02-01 21:27:34 +01:00
Pavel Feldman
2b55adaafa
feat(breaking): always report onBegin/onEnd, report file errors (#11758) 2022-01-31 17:09:04 -08:00
Xiaoxing Ye
a35c249fdc
fix: quote path to prevent space issue (#11733)
Co-authored-by: Xiaoxing Ye <xiaoye@microsoft.com>
2022-01-29 09:56:58 -08:00
dependabot[bot]
5635e840f8
chore(deps): bump node-fetch in /utils/flakiness-dashboard (#11732)
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-29 08:15:26 -08:00
divdavem
512a245f13
feat(test-runner): wait for a url before starting tests (#10138)
The webServer configuration in @playwright/test now accepts a url as an
alternative to a port number to wait for a url to return a 2xx status code.
2022-01-26 16:32:58 -08:00
Pavel Feldman
136fab7041
fix(prepare): don't change package files on prepare (#11579) 2022-01-24 11:25:24 -08:00