27 Commits

Author SHA1 Message Date
Pavel Feldman
44887c237d
chore: reimplement socks to be readable (#8315) 2021-08-19 15:16:46 -07:00
Max Schmitt
ddcdb6d413
chore(protocol): do client hello instead of server hello (#8019) 2021-08-19 17:31:14 +02:00
Pavel Feldman
b2143a951b
chore: make tracing zero config (#6859) 2021-06-02 22:00:34 -07:00
Max Schmitt
e91e49e533
feat(port-forwarding): add playwrightclient support (#6786) 2021-06-02 23:35:17 +02:00
Max Schmitt
d21a72e7d5
chore: create new Playwright instance when launching server (#6820) 2021-06-01 21:21:24 +02:00
Max Schmitt
59d591bce6
chore(port-forwarding): validate forwarded ports on the client side (#6756) 2021-05-26 16:51:38 +02:00
Max Schmitt
3f43db5cc4
feat(browserServer): forward local ports (#6375) 2021-05-25 17:11:32 +02:00
Dmitry Gozman
b29b7df47e
fix(connect): handle disconnect in various situations (#6276)
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.
2021-05-06 09:34:06 -07:00
Dmitry Gozman
fff1f3d45c
chore: simplify remote connection protocol (#6164)
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)
```
2021-04-12 11:14:54 -07:00
Dmitry Gozman
9d9599c6a6
api(video): implement video.saveAs and video.delete (#6005)
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.
2021-03-31 10:38:05 -07:00
Pavel Feldman
bb2b29631a
feat(inspector): pause on page/context close (#5319) 2021-02-19 09:33:24 -08:00
Joel Einbinder
d8f637c239
chore(typescript): enable esModuleInterop (#5409) 2021-02-11 06:36:15 -08:00
Pavel Feldman
2e01fbdbec
chore: introduce instrumentation api (#5385) 2021-02-09 14:44:48 -08:00
Pavel Feldman
0652f3251f
chore: introduce sdk object base class (#5370) 2021-02-09 09:00:00 -08:00
Pavel Feldman
975519150e
chore: centralize playwright creation, bind context listeners to instance (#5217) 2021-01-29 16:00:56 -08:00
Dmitry Gozman
725191967b
fix(connect): provide an error message when ws endpoint is incorrect (#4978) 2021-01-11 15:53:45 -08:00
Dmitry Gozman
e9060dd68a
fix(launchServer): wait for the server to start before taking its address (#4513)
This is easily triggered by launching from a cluster's worker.
2020-11-23 15:23:31 -08:00
Dmitry Gozman
138680f93c
fix(launchServer): stream protocol logs into options.logger (#4403)
fix(launchServer): stream protocol logs into options.logger

This has regressed in v1.4.
2020-11-11 15:12:10 -08:00
Pavel Feldman
28f6547d67
chore: add adb-based connectivity (#4375) 2020-11-06 16:31:11 -08:00
Dmitry Gozman
1c39689dd6
api(videos): introduce a single recordVideo option bag (#4309)
api(videos): introduce a single recordVideo option bag

Currently contains `dir` and `size`, previously known as
`videosPath` and `videoSize`.
2020-11-02 19:42:05 -08:00
Pavel Feldman
5a7685665a
api(video): restore the missing video path accessor (#4132) 2020-10-13 22:15:51 -07:00
Dmitry Gozman
e214f795e0
feat(video): support videos in remote browser (#4042) 2020-10-02 17:27:56 -07:00
Dmitry Gozman
ed3b00efdf
chore: merge BrowserType and BrowserTypeBase, remove logName (#3837)
- We do not need the public BrowserType different from BrowserTypeBase anymore.
- Removing 'logName' parameter from runAbortableTask - it will
be used for metadata instead.
2020-09-10 15:34:13 -07:00
Dmitry Gozman
de547d7d65
fix(connect): make selectors.register work in connected browser (#3664)
This is a large rework of selectors:
- Each BrowserContext now has a separate Selectors instance that has its own registrations.
  Most of them share a single sharedSelectors instance, but contexts created for a connected
  browser have their own instance.
- Connected browser now gets a RemoteBrowser object that encapsulates Selectors and Browser.
  This Selectors object is registered with the api selectors.
- Public selectors.register api iterates over all registered Selectors channels
  and registers in each of them.
- createSelector testing method migrated to ElementHandle._createSelectorForTest.
2020-09-02 16:15:43 -07:00
Dmitry Gozman
b34d9aba25
feat(trace): experimental traces for our tests (#3567)
This introduces basic tracing enabled in our tests.

What is captured:
- network resources;
- snapshots at the start of most actions;
- snapshot after the test failure.

How this integrates with test runner:
- context fixture calls private method context._initSnapshotter() and uses Tracer to trace all events;
- all tests share a single test-results/trace-storage directory to store blobs;
- each test has its own trace file.
- npm run show-trace opens a bare-minimum trace viewer that renders snapshots.
2020-08-28 10:51:55 -07:00
Dmitry Gozman
744af78dc2
feat(rpc): simplify browser name detection on the client side (#3670) 2020-08-28 10:23:02 -07:00
Dmitry Gozman
a099e941d6
chore: move last rpc files to their place (#3604)
Also update check-deps to be more user-friendly.
2020-08-24 14:48:03 -07:00