Commit graph

56 commits

Author SHA1 Message Date
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
Etienne 252b489a7f
feat(trace-viewer): allow host and port to be specified (#20258) 2023-01-27 14:20:25 -08:00
Dmitry Gozman 71798d658f
chore: remove separate network tethering client connection (#20267) 2023-01-21 18:18:22 -08:00
Max Schmitt ddccb59093
chore: fix Java CLI invocation on Windows (#19895)
For reference: https://stackoverflow.com/a/64300409
2023-01-05 10:55:07 -08:00
Dmitry Gozman 465278a54f
feat(tether): always enable socks proxy on the server (#19363) 2022-12-08 14:23:14 -08:00
Andrey Lushnikov 8538f61a72
feat(containers): implement global network tethering for playwright server (#17719)
This patch implements a new mode of network tethering for Playwright
server & its clients.
With this patch:
- playwright server could be launched with the
`--browser-proxy-mode=tether` flag to engage in the new mode
- a new type of client, "Network Tethering Client" can connect to the
server to provide network traffic to the browsers
- all clients that connect to the server with the `x-playwright-proxy:
*` header will get traffic from the "Network Tethering Client"

This patch also adds an environment variable
`PW_OWNED_BY_TETHER_CLIENT`. With this env, playwright server will
auto-close when the network tethering client disconnects. It will also
auto-close if the network client does not connect to the server in the
first 10 seconds of the server existence. This way we can ensure that
`npx playwright docker start` blocks terminal & controls the lifetime of
the started container.
2022-11-03 13:47:51 -07:00
Pavel Feldman 37250cde17
chore: switch to the new debug controller harness (#18308) 2022-10-25 09:55:20 -07:00
Pavel Feldman 37b04e5391
chore: better integrity error message (#17959)
Fixes https://github.com/microsoft/playwright/issues/17955
2022-10-10 12:34:25 -07:00
Andrey Lushnikov d431958603
chore: move container integration back to playwright-core (#17487) 2022-09-21 12:45:43 -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
Andrey Lushnikov b0ff4f58ce
feat: implement --dry-run for npx playwright install (#17158)
* feat: implement `--dry-run` for `npx playwright install`

The `--dry-run` command prints URLs for browsers to be installed.

Demo output:

```
browser: chromium version 106.0.5249.21
  Install location:    /Users/andreylushnikov/Library/Caches/ms-playwright/chromium-1023
  Download url:        https://playwright.azureedge.net/builds/chromium/1023/chromium-mac-arm64.zip
  Download fallback 1: https://playwright-akamai.azureedge.net/builds/chromium/1023/chromium-mac-arm64.zip
  Download fallback 2: https://playwright-verizon.azureedge.net/builds/chromium/1023/chromium-mac-arm64.zip

browser: firefox version 104.0
  Install location:    /Users/andreylushnikov/Library/Caches/ms-playwright/firefox-1350
  Download url:        https://playwright.azureedge.net/builds/firefox/1350/firefox-mac-11-arm64.zip
  Download fallback 1: https://playwright-akamai.azureedge.net/builds/firefox/1350/firefox-mac-11-arm64.zip
  Download fallback 2: https://playwright-verizon.azureedge.net/builds/firefox/1350/firefox-mac-11-arm64.zip

browser: webkit version 16.0
  Install location:    /Users/andreylushnikov/Library/Caches/ms-playwright/webkit-1714
  Download url:        https://playwright.azureedge.net/builds/webkit/1714/webkit-mac-12-arm64.zip
  Download fallback 1: https://playwright-akamai.azureedge.net/builds/webkit/1714/webkit-mac-12-arm64.zip
  Download fallback 2: https://playwright-verizon.azureedge.net/builds/webkit/1714/webkit-mac-12-arm64.zip

browser: ffmpeg
  Install location:    /Users/andreylushnikov/Library/Caches/ms-playwright/ffmpeg-1007
  Download url:        https://playwright.azureedge.net/builds/ffmpeg/1007/ffmpeg-mac-arm64.zip
  Download fallback 1: https://playwright-akamai.azureedge.net/builds/ffmpeg/1007/ffmpeg-mac-arm64.zip
  Download fallback 2: https://playwright-verizon.azureedge.net/builds/ffmpeg/1007/ffmpeg-mac-arm64.zip
```

Fixes #16926
2022-09-08 09:05:09 -07:00
Max Schmitt 74ab343e2b
feat(codegen): add NUnit/MSTest (#16803) 2022-08-25 11:58:58 +02:00
Max Schmitt 35a9daa425
chore: validate pw-core version when pwtest CLI gets executed (#16475) 2022-08-20 12:20:31 +02:00
Max Schmitt 7e2aec7454
chore: align more ESLint rules with VSCode formatting (#16647) 2022-08-18 20:12:33 +02:00
Max Schmitt 435272248f
docs(dotnet): PowerShell install enhancements (#16520) 2022-08-14 20:01:00 +02:00
Max Schmitt 1ca6635bb8
fix(cli): store trace/storage/har on SIGINT (#16339) 2022-08-09 00:13:38 +02:00
Pavel Feldman 8ed238843b
chore: allow inspecting element from server (#16324) 2022-08-05 19:34:57 -07:00
Pavel Feldman 5a79054544
feat(innerloop): allow reusing browsers over the remote connection (#16065) 2022-07-31 14:31:17 -07:00
Pavel Feldman d73f9b7b88
chore: experimental test server implementation (#16033) 2022-07-29 11:40:33 -07:00
Dmitry Gozman c4dae2a628
fix(cli): remove --save-trace from open command (#15905) 2022-07-25 09:16:20 -07:00
Dmitry Gozman ba3c8ffa5c
test: make sure browser crashes in CLI tests are marked as such (#15821) 2022-07-20 15:32:57 -07:00
Dmitry Gozman d60b8aba23
fix(codegen): handle more context options (#15319)
The following options now work across languages:
- `recordHar`
- `serviceWorkers`

In addition, object properties are now sorted alphabetically.
Drive-by: fixed `--target` help message to include all available targets.
2022-07-05 13:30:46 -07:00
Pavel Feldman 7bd72716f9
feat(har): introduce the slim mode (#15053) 2022-06-22 14:44:12 -07:00
Pavel Feldman eb87966441
feat(har): disambiguate requests by post data (#14993) 2022-06-20 14:14:40 -07:00
Yury Semikhatsky 2bdb0998bd
feat(cli): block-service-workers option (#14931) 2022-06-16 16:03:35 -07:00
Dmitry Gozman 6822d03f0b
fix(cli): default to no timeout (#14769) 2022-06-09 21:07:57 -07:00
Dmitry Gozman 6c739eb345
feat(cli): option to record har (#14696)
`npx playwright open --save-har=file.har` produces a HAR file that
can be later inspected or used for mocks.
`--save-har-glob="**/*.{png,woff2}"` option can be used to
produce a smaller har that only contains entries matching the glob.
2022-06-08 10:59:50 -07:00
Pavel Feldman 63ea81ec54
chore: make bundles typed (#13620) 2022-04-18 17:50:25 -07:00
Yury Semikhatsky e2fff31848
chore: send run_id from agent to server (#13542) 2022-04-13 12:13:35 -07:00
Max Schmitt 95d4041b8b
chore: fix mark-docker-image CLI command (#13499) 2022-04-12 10:10:34 -07:00
Yury Semikhatsky 9712b9ee08
fix: match against secure path (#13442) 2022-04-08 14:57:43 -07:00
Ross Wollman db7bd8ebd2
chore: don't auto-install browsers if global install (#13299) 2022-04-08 10:46:24 -07:00
Pavel Feldman e79b90f454
chore: use utils via index export (5) (#13413) 2022-04-07 20:18:22 -07:00
Yury Semikhatsky f803a929e4
feat: pass server address as argument (#13412) 2022-04-07 17:22:52 -07:00
Pavel Feldman a3c02222bf
chore: use utils via index export (4) (#13404) 2022-04-07 14:36:13 -07:00
Pavel Feldman 40d5e3a3c9
chore: use utils via index export (3) (#13403) 2022-04-07 13:55:44 -07:00
Pavel Feldman bde7bf4ea9
chore: move registry & dispatchers to under server (#13370) 2022-04-06 22:21:27 -07:00
Pavel Feldman 5ae2017a5b
chore: always import type (#13365) 2022-04-06 14:57:14 -07:00
Ross Wollman 42798b5857
chore: warn against using globally scoped install (#13196) 2022-04-03 20:26:23 -07:00
Andrey Lushnikov a87794dae6
fix: demand --force to re-install stable browser channels (#13200)
This patch will check if browser channel is already installed.
If it is, it'll abort installation with the following error:

```
aslushnikov:~/prog/playwright$ npx playwright install msedge
Failed to install browsers
Error:
╔═════════════════════════════════════════════════════════════════╗
║ ATTENTION: "msedge" is already installed on the system!         ║
║                                                                 ║
║ "msedge" installation is not hermetic; installing newer version ║
║ requires *removal* of a current installation first.             ║
║                                                                 ║
║ To *uninstall* current version and re-install latest "msedge":  ║
║                                                                 ║
║ - Close all running instances of "msedge", if any               ║
║ - Use "--force" to install browser:                             ║
║                                                                 ║
║     npx playwright install --force msedge                       ║
║                                                                 ║
║ <3 Playwright Team                                              ║
╚═════════════════════════════════════════════════════════════════╝
```

To re-install browser channel, use `--force`.

Fixes https://github.com/microsoft/playwright/issues/13061
2022-04-01 10:05:53 -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
Siddharth Singha Roy a2b3d4f570
feat(cli) : allow passing PlaywrightServer.startDefault parameters via cli (#12530) 2022-03-07 09:15:46 -08:00
Max Schmitt 3db4b48bd3
fix(cli): fix wrong property for passing browser name (#12489) 2022-03-03 17:17:23 +01:00
Pavel Feldman a612a3526a
chore: auto-detect ts esm mode (#12292) 2022-03-01 12:56:26 -08:00
Dmitry Gozman 3c2bca2768
fix(test loader): implement tsconfig paths through resolveFilename (#12357)
This uses `Module._resolveFilename` to intercept module resolution and
check `tsconfig.paths` similarly to pirates usage ot `Module._compile`.

Previously, we resolved during compilation that required reproducible
resolution due to caching. Now we can resolve as we go and support
all `tsconfig.paths`.
2022-02-25 15:43:58 -08:00
pierscowburn 5db7ce5964
fix: propagate exit code in experimental mode (#12070)
In experimental ESM mode a child process is forked in order to run the tests. Currently the exit code of this child process is not propagated to the exit code of the parent process, which means that the process exits with a status code of `0` even if some of the tests failed.

This makes it difficult to use Playwright in CI in experimental mode, as the CI pipeline as a whole will pass despite the test failures.

This change addresses this by propagating the exit code in the case where it is non-zero.
2022-02-15 13:10:35 -08:00
Pavel Feldman 5d19f16601
feat(esm): introduce experimental PW_EXPERIMENTAL_TS_ESM option (#10519) 2021-11-24 14:17:01 -08:00
Max Schmitt 14471fd79f
chore: fix CLI --help when used in driver (#10412) 2021-11-22 18:34:22 +01:00
divdavem 17a2454226
feat(cli): add --proxy-bypass option (#10181) 2021-11-18 15:41:16 -08:00
Pavel Feldman 1f907f0cfc
feat(html): render warning message when served off file:// (#9908) 2021-10-31 17:36:05 -07:00