Commit graph

133 commits

Author SHA1 Message Date
Andrey Lushnikov 7a785ac268
fix: properly rewrite error message (#2392)
Error message is included in error's stack, so we should
re-write stack as well.

Fixes #2373
2020-05-28 16:33:31 -07:00
Andrey Lushnikov e312845ba9
fix: less confusing error message (#2305)
Fixes #2283
2020-05-19 17:47:46 -07:00
Andrey Lushnikov f24696be62
feat: add page convenience methods for textContent and getAttribute (#2235)
This patch adds:
- `page.innerText()` / `frame.innerText()`
- `page.innerHTML()` / `frame.innerHTML()`
- `page.textContent()` / `frame.textContent()`
- `page.getAttribute()` / `frame.getAttribute()`

Fixes #2143
2020-05-18 17:58:23 -07:00
Pavel Feldman 2bd427ad1d
feat(exposeBinding): a more powerful exposeFunction with source attribution (#2263) 2020-05-18 14:28:06 -07:00
Dmitry Gozman 4bf5742d47
fix(chromium): abort fetch requests that lack networkId (#2254)
These requests are usually internal ones, and we can safely abort them.
An example would be DevTools loading cached resources to show the content.
There will never be a matching Network.requestWillBeSent event, so we do not
report them to the user.
2020-05-15 15:22:29 -07:00
Pavel Feldman 99b7aaace8
chore: refactor injected script harness (#2259) 2020-05-15 15:21:49 -07:00
Dmitry Gozman 650d73445c
fix(actions): do not wait for the created popups (#2219)
Since we are recommending Promise.all pattern anyway, this special
logic just adds to the possibility of timeout if something goes wrong.

For example, Firefox sometimes send Page.willOpenNewWindowAsynchronously
later than the new target arrives and input action just hangs.
2020-05-13 17:20:33 -07:00
Pavel Feldman 8e59031078
chore: introduce debugAssert (#2160) 2020-05-08 10:37:54 -07:00
Pavel Feldman 1c17929bd8
chore: add input logging and timeout debugging hints (#2109) 2020-05-04 21:44:33 -07:00
Pavel Feldman bcce48362a
api(waitForSelector): make "state: visible" default, includes rename to state (#2091) 2020-05-04 11:03:44 -07:00
Dmitry Gozman 953dd36d38
feat(api): remove 'mutation' polling option (#2048)
It is not compatible with shadow dom.
2020-04-29 21:34:14 -07:00
Yury Semikhatsky 5993a6a0e0
fix: throw from eval methods if >1 argument is passed (#2043) 2020-04-29 18:35:04 -07:00
Pavel Feldman 7f8aa703dd
api(waitFor): remove waitFor, use specialized wait functions (#1995) 2020-04-27 12:08:29 -07:00
Pavel Feldman c1c0237d4e
api(dispatchEvent): page, frame and handle versions added (#1932) 2020-04-23 14:58:37 -07:00
Yury Semikhatsky 00e8d88777
fix: do not auto wait for downloads (#1921) 2020-04-22 15:08:39 -07:00
Pavel Feldman 6ecac8c164
chore: restore networkidle0 alias (#1920) 2020-04-22 10:52:01 -07:00
Pavel Feldman 0656771167
api(networkidle): remove networkidle2 (#1883) 2020-04-20 16:52:26 -07:00
Pavel Feldman 1f43ae692f
feat(logging): introduce logger sink api (#1861) 2020-04-20 07:52:26 -07:00
Dmitry Gozman 55b4bc99bd
feat(actions): requery the element when it was detached during the action (#1853) 2020-04-18 18:29:31 -07:00
Yury Semikhatsky 2b96b85e05
fix(firefox): throw error when added script blocked by CSP (#1841) 2020-04-17 08:51:54 -07:00
Pavel Feldman a248430af8
reapply api(waitUntil): remove waitUntil options from the actions (#1842) 2020-04-16 20:31:04 -07:00
Andrey Lushnikov 31460b18b8
Revert "api(waitUntil): remove waitUntil options from the actions (#1834)" (#1840)
This reverts commit d0b8710670.

Reason: multiple test failures on all Linux bots
- https://app.circleci.com/pipelines/github/microsoft/playwright/613/workflows/50dc6e2d-23b0-41d2-9765-42983b0ed91d/jobs/610
- https://travis-ci.com/github/microsoft/playwright/builds/160648417
- https://github.com/microsoft/playwright/pull/1839/checks?check_run_id=594015893
2020-04-16 18:46:10 -07:00
Pavel Feldman d0b8710670
api(waitUntil): remove waitUntil options from the actions (#1834) 2020-04-16 16:04:10 -07:00
Dmitry Gozman f5942295d4
feat(api): wait for popups and downloads when performing actions (#1744) 2020-04-16 13:09:24 -07:00
Pavel Feldman 2280126344
api(setInputFiles): introduce page/frame helpers, document, break compat (#1818) 2020-04-16 10:25:28 -07:00
Pavel Feldman 9d05038a82
feat(hints): hint at how waitFor(time) is bad for production (#1781) 2020-04-14 15:00:10 -07:00
Joel Einbinder a7572c7f09
feat: nicer error message for page.addScriptTag (#1754) 2020-04-12 18:46:53 -07:00
Pavel Feldman 3584205086
fix(chromium): associate navigation requests with navigations (#1724) 2020-04-09 19:03:06 -07:00
Pavel Feldman c6f580faf8
chore: migrate from timeouts to deadlines internally (#1695) 2020-04-07 14:35:34 -07:00
Dmitry Gozman aeeac55732
feat(chromium): support oopifs (#1664)
Splits CRPage into CRPage and FrameSession, carefully broadcasting or picking the right session for each operation.
2020-04-06 15:09:43 -07:00
Pavel Feldman e241c1bef8
chore: remove web mode (#1625) 2020-04-01 14:42:47 -07:00
Dmitry Gozman 60942d0af5
chore(selectors): move selectors logic to selectors.ts (#1536)
This encapsulates selectors logic in one place, in a preparation for more complex scenarios like main-world selectors or piercing frames.

Note: we had `Page.fill should wait for visible visibilty` test, but we do not actually wait for visible in page.fill(). It happened to pass due to lucky evaluation order.

References #1316.
2020-03-25 14:08:46 -07:00
Dmitry Gozman de0a2d1081
api(waitForLoadState): move waitUntil to be a first parameter (#1490) 2020-03-23 13:51:11 -07:00
Dmitry Gozman 670ce7a591
chore: remove various watchers, use FrameTask directly (#1460) 2020-03-21 13:02:37 -07:00
Dmitry Gozman 16c7a5bd5c
api(eval): accept zero or one arguments in all evaluation functions (#1431) 2020-03-20 15:08:17 -07:00
Pavel Feldman 2af07ce475
chore: rework disposers into a frame task (#1413) 2020-03-18 20:05:35 -07:00
Pavel Feldman 64b175ce10
api(waitForLoadState): restore it (#1390) 2020-03-16 14:39:44 -07:00
Dmitry Gozman 6731d37546
api(network): replace redirectChain with redirectedFrom/redirectedTo (#1401) 2020-03-16 13:31:06 -07:00
Dmitry Gozman 26479119b6
fix(setContent): handle inner _waitForLoadState rejection (#1382) 2020-03-13 13:09:06 -07:00
Pavel Feldman b1a3b23c38
api(request): make request.response a promise (#1377) 2020-03-13 08:54:19 -07:00
Pavel Feldman 24d4fb1e5c
api(click): remove tripleclick, respect clickCount (#1373) 2020-03-13 08:09:48 -07:00
Pavel Feldman 8c532bd8da
api(press): remove text option (#1372)
#1348
2020-03-12 22:02:19 -07:00
Pavel Feldman e1d3196460
api(*.selectOption): renamed from *.select (#1371) 2020-03-12 21:30:12 -07:00
Dmitry Gozman e382bb329b
api: remove 'commit' phase, actions to wait until 'domcontentloaded' by default (#1358) 2020-03-12 11:20:03 -07:00
Dmitry Gozman c1ef683373
api: remove waitForLoadState() in favor of PageEvent.page(options) (#1323) 2020-03-11 14:46:52 -07:00
Dmitry Gozman 23cf3be828
api: make request.frame() non-null (#1319) 2020-03-10 11:39:35 -07:00
Pavel Feldman 78bd29d558
fix(click): work around input alignment on chromium (#1282) 2020-03-07 08:19:31 -08:00
Pavel Feldman 3c35d7b058
api(waitFor): click(waitFor) -> click(force) (#1275) 2020-03-06 16:24:21 -08:00
Pavel Feldman 3fa000f5f4
api(waitForSelector): bring it back (#1272) 2020-03-06 15:02:42 -08:00
Pavel Feldman 119df5a985
feat(nowait): allow waitUntil:nowait for actions (#1264) 2020-03-06 14:32:15 -08:00