With this patch:
- `npx playwright install-deps` will install deps on Ubuntu 21.04
- launch doctor knows the package<->lib mapping for Ubuntu 21.04
**NOTE:** our webkit build, however, doesn't work on Ubuntu 21.04. Since
this is not LTS release, we're doing best-effort here.
Fixes#6405
There are a few ways for `connect()` to finish:
- `Browser.close()` from the client side.
- Browser on the server side did exit (e.g. crashed).
- Connection was dropped by either of the sides.
We reduce all the cases to the last one by dropping the
connection when client wants calls `Browser.close()` or
server-side browser exits.
In all these cases we should properly cleanup on the server side,
and ensure that all promises reject on the client side.
We have `CRBrowserContext` that extends `BrowserContext`, and
it sometimes fails beacause `BrowserContext` is undefined, depending
on the require order. Below is the require cycle.
```log
server/browserContext.ts
server/supplements/recorderSupplement.ts
server/supplements/recorder/recorderApp.ts
server/playwright.ts
server/android/android.ts
server/chromium/crBrowser.ts
server/browserContext.ts
```
Fixing this by using `require`.
On a slow page that does a lot of things before navigating upon click,
it is common to move mouse away from the click point. Previously,
we would commit the click action and record a `page.goto()` for the
navigation. Now we attribute any signals, even after accidental mouse move,
to the previous action, in the 5-seconds time window.
This supports `PWDEBUG=console` that:
- runs headed;
- disables timeouts;
- adds `playwright` console helper.
When using `PWDEBUG=anything-but-console`, we open inspector.
Docs keep suggesting `PWDEBUG=1`.
This fixes the compatibility on Vercel with Next.js when it's used in
a serverless function.
Next.js uses https://github.com/vercel/nft to trace down the
dependencies which a serverless function is using which
is currently not capable of detecting the browsers.json in our current
setup. Previously we used require to load the browers.json which was
replaced by readFileSync in #5318. Since then it was broken.
Fixes#5862
We await the predicate now. For synchronous predicates,
nothing should change becase the await will finish before
the next protocol message arrives (thanks to `makeWaitForNextTask`).
Since check/uncheck does click under the hood, sometimes it might
need to click at a different position. One example would be a long
label that contains links inside, and clicking in the center happens
to hit the link instead of the label itself.
This changes the root object from RemoteBrowser to Playwright,
similar to local driver connection. This way, any remote connection
gets a Playwright object.
This also starts reusing PlaywrightServer class, and introduces
`cli run-server` hidden command that runs ws server on the
specified port.
Previous structure:
```
RemoteBrowser
- browser (using ConnectedBrowser for remote-specific behavior)
- selectors (special instance for this remote connection)
```
New structure:
```
Playwright
- ...
- selectors (special instance for this remote connection)
- preLaunchedBrowser (using ConnectedBrowser for remote-specific behavior)
```
This makes it much nicer to use `BrowserType` because it no longer has a template.
Technically a breaking change because of the rare edge case where someone used their own non-browser type inside the template, but I don't consider that intended behavior and think this is fine.
This roll required us pass a new flag - `--allow-pre-commit-input`. Otherwise, keyboard tests won't pass.
Co-authored-by: Joel Einbinder <joel.einbinder@gmail.com>
This patch adds support for `technology preview` webkit channel, which
we will keep close to the actual Safari Technology Preview releases.
This channel does not install by default. It is supposed to be installed
with the following CLI command:
```sh
$ npx playwright install webkit-technology-preview
```
Once the channel is installed, it can be used the following way:
```js
const browser = await playwright.webkit.launch({
channel: 'technology-preview',
});
```
**NOTE:** if clients attempt using the channel without installing it,
it'll throw an error with a copyable instructions to install via CLI.
References #5884
These methods are safe to call while the page is still open, or when it is
already closed. Works in remotely connected browser as well.
Also makes video.path() to throw for remotely connected browser.
Under the hood migrated Download and Video to use the common Artifact object.