1
1
mirror of https://github.com/microsoft/playwright.git synced 2024-12-15 14:11:50 +03:00
Commit Graph

227 Commits

Author SHA1 Message Date
Dmitry Gozman
16c7a5bd5c
api(eval): accept zero or one arguments in all evaluation functions () 2020-03-20 15:08:17 -07:00
Joel Einbinder
825555cddf
types: better types ()
This generates typescript definitions based on the api.md, instead of autogenerating them from the typescript source code.

Now types
 - only include the public api
 - work with older versions of typescript
 - include descriptions
 - are more consistent
 - are more complete

2020-03-20 01:30:35 -07:00
Yury Semikhatsky
f1d97b0466
chore(docs): remove remaining mentions of Chromium targets () 2020-03-19 20:25:31 -07:00
Yury Semikhatsky
535b484637
api(context): get rid of PageEvent () 2020-03-19 16:25:12 -07:00
Yury Semikhatsky
3ed9970b33
api(chromium): add ChromiumBrowserContext.serviceWorkers() () 2020-03-19 16:10:24 -07:00
Andrey Lushnikov
f5ecbff16e
devops: remake downloading logic ()
This patch:
- removes `browserType.downloadBrowserIfNeeded()` method. The method
  turned out to be ill-behaving and cannot not be used as we'd like to (see )
- adds a `browserType.setExecutablePath` method to set a browser
  exectuable.

With this patch, we take the following approach towards managing browser downloads:
- `playwright-core` doesn't download any browsers. In `playwright-core`, `playwright.chromium.executablePath()` returns `null` (same for firefox and webkit).
- clients of `playwright-core` (e.g. `playwright` and others) download browsers one way or another.
They can then configure `playwright` with executable paths and re-export the `playwright` object to their clients.
- `playwright`, `playwright-firefox`, `playwright-chromium` and `playwright-webkit` download 
browsers. Once browsers are downloaded, their executable paths are saved to a `.downloaded-browsers.json` file. This file is read in `playwright/index.js` to configure browser executable paths and re-export the API.
- special case is `install-from-github.js` that also cleans up old browsers.
2020-03-19 11:43:35 -07:00
Joel Einbinder
b0749e3a6d
fix(docs): fixup and lint optionals and return values in api.md ()
Currently in our API `?` means null, but sometimes it means optional. Linting optional/nulls with this patch is required for  to land nicely.

Previously, return types were not being linted in `api.md`. This is fixed, along with many broken return types.

This patch considers `?` to mean nullable, and has some heuristics to determine optionality. I believe this to be the minimal patch needed to unblock . After it lands, we can consider changing the api docs to hopefully remove some heuristics and strangeness.
2020-03-18 16:23:25 -07:00
Joel Einbinder
741e2d19d6
fix(docs): lint and fix all internal links in api.md
We have had a lot of churn in the api, which has caused a lot of our links to break.
2020-03-18 15:34:53 -07:00
Pavel Feldman
049b336800
api(devices): extract isMobile/hasTouch from viewport () 2020-03-17 18:21:02 -07:00
Joel Einbinder
39e5eb7eda
feat(devices): remove name from device objects () 2020-03-17 16:04:42 -07:00
Pavel Feldman
e4225adcc0
feat(permissions): make origin optional () 2020-03-17 15:32:50 -07:00
Pavel Feldman
64b175ce10
api(waitForLoadState): restore it () 2020-03-16 14:39:44 -07:00
Dmitry Gozman
6731d37546
api(network): replace redirectChain with redirectedFrom/redirectedTo () 2020-03-16 13:31:06 -07:00
Pavel Feldman
e692dd6e62
api(cdp): rename ChromiumSession to CDPSession () 2020-03-13 16:16:54 -07:00
Dmitry Gozman
69be12ae12
api(route): pass Route object instead of Request to route handlers ()
References .
2020-03-13 14:30:40 -07:00
Dmitry Gozman
9b86c631c8
api: make BrowserContext.pages() synchronous ()
Returns all pages which have been initialized already.

References .
2020-03-13 11:33:33 -07:00
Pavel Feldman
8aba111f1e
api(cdp): rename createSession to newCDPSession () 2020-03-13 09:00:03 -07:00
Pavel Feldman
b1a3b23c38
api(request): make request.response a promise () 2020-03-13 08:54:19 -07:00
Pavel Feldman
24d4fb1e5c
api(click): remove tripleclick, respect clickCount () 2020-03-13 08:09:48 -07:00
Pavel Feldman
8c532bd8da
api(press): remove text option ()
2020-03-12 22:02:19 -07:00
Pavel Feldman
e1d3196460
api(*.selectOption): renamed from *.select () 2020-03-12 21:30:12 -07:00
Pavel Feldman
064099ab3c
api(keyboard.insertText): renamed from sendCharaters () 2020-03-12 20:56:52 -07:00
Pavel Feldman
9aa56a6b9e
api(browserType): remove devices, errors () 2020-03-12 17:58:00 -07:00
Pavel Feldman
cfd3ae25fb
api(addCookies): setCookies -> addCookies ()
2020-03-12 17:32:33 -07:00
Dmitry Gozman
3fa4255bc5
api: make request.postData() return null instead of undefined () 2020-03-12 16:53:04 -07:00
Dmitry Gozman
e382bb329b
api: remove 'commit' phase, actions to wait until 'domcontentloaded' by default () 2020-03-12 11:20:03 -07:00
Pavel Feldman
b43f33f4d3
api(review): misc changes to API. () 2020-03-11 18:10:48 -07:00
Kevin Wang
b3f87e8360
docs(api.md): Fix incorrect link to PageEvent ()
Minor typo :)
2020-03-11 17:51:19 -07:00
Dmitry Gozman
c1ef683373
api: remove waitForLoadState() in favor of PageEvent.page(options) () 2020-03-11 14:46:52 -07:00
Dmitry Gozman
23cf3be828
api: make request.frame() non-null () 2020-03-10 11:39:35 -07:00
Dmitry Gozman
ea6978a3d8
api(popups): expose BrowserContext.route() () 2020-03-09 21:02:54 -07:00
Dmitry Gozman
eb2ca70955
api(route): allow fulfilling with a file path () 2020-03-09 16:12:00 -07:00
Andrey Lushnikov
d1ef0c8694
fix(wk,ff): properly support getting and setting non-session cookies () 2020-03-07 08:41:57 -08:00
Pavel Feldman
3c35d7b058
api(waitFor): click(waitFor) -> click(force) () 2020-03-06 16:24:21 -08:00
Pavel Feldman
3fa000f5f4
api(waitForSelector): bring it back () 2020-03-06 15:02:42 -08:00
Pavel Feldman
119df5a985
feat(nowait): allow waitUntil:nowait for actions () 2020-03-06 14:32:15 -08:00
Andrey Lushnikov
c494944b46
api(popups): move Page.authenticate to BrowserContext.setHTTPCredentials ()
Drive-by: fixes  since it rolls past r1037. 

Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2020-03-06 13:50:42 -08:00
Pavel Feldman
49c1161e00
api(press): bump .press to the page/frame level () 2020-03-06 09:38:08 -08:00
Pavel Feldman
2724157c22
feat(waitUntil): allow waiting for navigation from clicks, etc () 2020-03-06 08:24:32 -08:00
Dmitry Gozman
1d770af804
api: waitForElement accepts waitFor: attached|detached|visible|hidden ()
This includes rename waitForSelector -> waitForElement and removes $wait.
2020-03-05 17:45:41 -08:00
Yury Semikhatsky
9bc6dcea1d
feat(api): introduce BrowserContext.waitForEvent () 2020-03-05 17:22:57 -08:00
Dmitry Gozman
e5f82af47c
api(popups): emit PageEvent immediately, and resolve page() once initialized ()
This way we do not miss any popups, even immediately closed ones.
2020-03-05 15:18:27 -08:00
Yury Semikhatsky
aabdac8380
api: remove Page.setCacheEnabled () 2020-03-05 10:09:04 -08:00
Dmitry Gozman
7f9df9488e
api(popups): move Page.setOfflineMode -> BrowserContext.setOffline () 2020-03-04 17:58:12 -08:00
Dmitry Gozman
5ee744cd26
api(page.frame): allow looking up frames by name () 2020-03-04 17:53:39 -08:00
Pavel Feldman
5ff660de15
feat(navigation): waitForNavigation/goto should not wait until response finished () 2020-03-04 15:59:26 -08:00
Yury Semikhatsky
2d4317dc9a
docs: fix browser.contexts() description () 2020-03-04 12:05:18 -08:00
Joel Einbinder
8aa88d5021
fix(doc): check and update optional types in the api ()
This adds a new check to doclint for whether a member is correctly marked as optional. 
part of 
2020-03-03 17:29:12 -08:00
Dmitry Gozman
f4e9b5079d
api: declare not supporting isMobile on Firefox () 2020-03-03 17:28:31 -08:00
Dmitry Gozman
6c6cdc033b
api(popup): introduce BrowserContext.exposeFunction () 2020-03-03 16:46:06 -08:00