Commit Graph

56 Commits

Author SHA1 Message Date
Max Schmitt
371aa3dab2
feat: add browser.newContext({ baseUrl }) (#7409) 2021-07-06 21:16:37 +02:00
Dmitry Gozman
9f71c96740
api: remove timeout option from isVisible and isHidden methods (#7414)
It is unused and confusing.
2021-07-01 13:30:16 -07:00
Pavel Feldman
f43b4efbc9
fix(trace-viewer): include waitFor* in trace viewer (#7413) 2021-06-30 17:56:48 -07:00
Pavel Feldman
a8d48a1a48
chore: remove hard-coded wrapApi names (#7347) 2021-06-28 13:27:38 -07:00
Pavel Feldman
5732307280
feat(inputValue): implement *.inputValue() (#7285) 2021-06-23 22:19:20 -07:00
Dmitry Gozman
060f7ffa92
fix: specify the right apiName for artifact errors (#7119)
This produces errors like `download.saveAs: <error>` instead of `.saveAs: <error>`.
Drive-by: fix the flaky test.
2021-06-14 16:41:53 -07:00
Max Schmitt
064150f8dd
chore: use fs.promises API instead of promisify (#6871) 2021-06-03 18:55:33 +02:00
Max Schmitt
ba29e99ace
feat: added reduced motion media query emulation (#6646) 2021-05-22 01:56:09 +02:00
Sébastien Règne
e87fbfcc1d
feat(download): add Page in Download (#6501) 2021-05-13 14:18:21 -07:00
Vignesh Shanmugam
4b3e5e5c17
feat(network): expose network events via browser context (#6370)
- fix #6340
- Exposes all the network related events (request, response, requestfailed, requestfinished) through the browser context to allow for managing network activity even if the is any navigations through popups or to new tabs which could result in creation of multiple page objects.
2021-05-13 10:29:14 -07:00
Max Schmitt
dc7f7f9a8c
fix(chromium): handle backgroundPages() onClose (#6541) 2021-05-12 22:15:04 +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
243ede5dfb
feat(waitForEvent): allow async predicate (#6201)
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`).
2021-04-19 10:32:51 -07:00
Yury Semikhatsky
561cb23e8d
fix: dispatch popup event on the client end (#6044) 2021-04-02 11:15:07 -07:00
Pavel Feldman
a7630c91d5
api: remove Chromium* classes (#6040) 2021-04-01 18:47:14 -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
85ab1dc7a4
feat(waitForURL): add a new waitForURL api (#6010) 2021-03-30 21:51:22 -07:00
Yury Semikhatsky
67c29e8155
chore: add missing await to floating promises (#5813) 2021-03-22 09:59:39 -07:00
Pavel Feldman
600f731a67
feat(inspector): render api names from metainfo (#5530) 2021-02-19 18:12:33 -08:00
Pavel Feldman
f154a827c5
feat(inspector): send api names along with metainfo (#5518) 2021-02-19 16:21:39 -08:00
Dmitry Gozman
dc51536bca
feat(waitForResponse): print regex pattern when waiting for request/response (#5485) 2021-02-17 15:11:23 -08:00
Pavel Feldman
ae2ffb3fb9
feat(inspector): instrument wait for event (#5457) 2021-02-13 20:31:06 -08:00
Joel Einbinder
d8f637c239
chore(typescript): enable esModuleInterop (#5409) 2021-02-11 06:36:15 -08:00
Pavel Feldman
0652f3251f
chore: introduce sdk object base class (#5370) 2021-02-09 09:00:00 -08:00
Pavel Feldman
34adc28ed3
feat(pause): make page.pause public (#5288) 2021-02-03 16:01:51 -08:00
Dmitry Gozman
53ed35ef96
feat(dialogs): auto-dismiss dialogs when there are no listeners (#5269)
This makes dialogs disappear and prevents stalling.

Pros:
- No need to worry about dialogs for most users.
- Those that wait for a specific dialog still get to control it.

Cons:
- Those who use Playwright to show interactive browser will have
  to add an empty 'dialog' handler to prevent auto-dismiss.
  We do this in cli.
2021-02-03 10:34:45 -08:00
Pavel Feldman
ff6b2b1dd4
chore: make emulate media params be options (#5172) 2021-01-27 14:19:37 -08:00
Pavel Feldman
01d6f83597
chore: introduce debug toolbar (#5145) 2021-01-25 14:49:26 -08:00
Joel Einbinder
3e4e511d84
feat(pause): page._pause to wait for user to click resume (#5050) 2021-01-22 18:47:02 -08:00
Yury Semikhatsky
a4eb121399
fix: add parameter to close/crash/disconnected etc events (#5098) 2021-01-22 09:58:31 -08:00
Dmitry Gozman
a9b75365eb
feat(logs): add wrapApiCall for logging to many api methods (#5093)
Some methods (quite a few!) were missing the wrapper that produces the log.
2021-01-22 06:49:59 -08:00
Joel Einbinder
decf373c81
fix(electron): return a ChromiumBrowserContext for electron (#4913) 2021-01-13 12:08:14 -08:00
Dmitry Gozman
5a2cfdbd47
api: add isChecked method (#4953)
This adds `{Page,Frame}.isChecked(selector)` and `ElementHandle.isChecked()` methods.

Useful to do assertions in tests:
```js
await page.click('text="Add TODO"');
expect(await page.isChecked('.item-done')).toBe(false);
```
2021-01-08 17:36:17 -08:00
Pavel Feldman
b7e0b1b393
docs: annotate evaluate(pageFunction) js-specific (#4954) 2021-01-08 16:17:54 -08:00
Dmitry Gozman
3f904056ee
api: add isVisible, isHidden, isEnabled, isDisabled and isEditable (#4915)
These methods are useful for verification in tests, e.g.
```js
expect(await page.isEnabled(':text("Remove All")')).toBe(false);
await page.click(':text("Add Item")');
expect(await page.isVisible('.item:text("new item")')).toBe(true);
expect(await page.isEnabled(':text("Remove All")')).toBe(true);
```
2021-01-08 12:27:54 -08:00
Pavel Feldman
31ffeb32e3
doc: further align docs w/ playwright.dev (2) (#4871) 2021-01-04 13:50:29 -08:00
Dmitry Gozman
34c1b338be
feat(types): make our client classes implement public types (#4817)
This patch:
- introduces non-exported but used in api/impl struct types (e.g. Point);
- makes all client classes implement respective public api interface.

Pros:
- Typescript is now responsible for type checking.
  We can remove our doclint checker (not removed yet).
- Electron and Android types can be defined in the same way
  (this is not implemented yet).
- We can move most of the type structs like Point to the public api
  and make some of them available.

Cons:
- Any cons?
2020-12-26 17:05:57 -08:00
Yury Semikhatsky
0b8f34e726
docs: rename aggregate parameter objects to params (#4715) 2020-12-14 15:27:02 -08:00
Pavel Feldman
2452d07ff7
docs: generate method signatures in docs (#4590) 2020-12-03 22:28:11 -08:00
Pavel Feldman
7e30669eb0
fix(binding): catch binding resolution against the closed page (#4583) 2020-12-03 10:51:59 -08:00
Dmitry Gozman
e69315f711
fix(websocket): remove "skip frames" logic (#4435)
This optimization turned out to be racy, so better remove it for now.
2020-11-13 14:03:21 -08:00
Dmitry Gozman
c83ac444b4
api(websocket): do not send websocket frames without a listener (#4361)
Once user adds 'websocket' listener, we start sending the frames
for all websockets on the page.
2020-11-06 12:30:16 -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
1ef090c3ac
fix(screenshot): prioritize passed type over the extension mime (#4251) 2020-10-27 00:02:35 -07:00
Pavel Feldman
be8428475d
feat(websocket): implement Web Sockets for Chromium & WebKit (#4234) 2020-10-26 22:20:43 -07:00
Pavel Feldman
8a42cdad30
feat(timing): introduce resource timing (#4204) 2020-10-21 23:25:57 -07:00
Pavel Feldman
5d997ed28b
fix(video): make video path available in persistent profiles (#4182) 2020-10-19 14:35:18 -07:00
Joel Einbinder
92dda698f8
feat: tap (#4097) 2020-10-19 10:07:33 -07:00
Pavel Feldman
5a7685665a
api(video): restore the missing video path accessor (#4132) 2020-10-13 22:15:51 -07:00
Dmitry Gozman
5e42029fce
api: allow exposeBinding to pass handles (#4030)
This adds an option `{ handle: true }` to pass a single handle instead of arbitrary json values.
2020-10-01 22:47:31 -07:00