Commit graph

806 commits

Author SHA1 Message Date
Dmitry Gozman e3ebba5573
chore: cleanup code that is not used by cli anymore (#5005) 2021-01-13 17:02:53 -08:00
Andrey Lushnikov fcbfbe6fa1
devops: fix azure function bugs (#4998)
This patch:
- starts processing dashboards serially to avoid hitting node.js azure
  function heap limit
- fixes typo in the new `dashboards_raw` processor
2021-01-13 14:15:38 +03:00
Andrey Lushnikov 8316dee44d
devops(flakiness): persist all test reports, aggregated per commit sha (#4991)
We can either load it raw as-is and process later on the front-end side,
or post-process while experimenting with different storage solutions.
2021-01-13 04:31:48 +03:00
Pavel Feldman cac119f3bf
docs: python api review (#4986) 2021-01-12 12:14:27 -08:00
Pavel Feldman 7a8214cd95
chore: prepare non-api docs for non-js variants (#4969) 2021-01-11 09:34:49 -08:00
Pavel Feldman 4dbbb47583
docs: document Python's expect_event methods (#4963) 2021-01-10 21:00:52 -08:00
Pavel Feldman e67d89747a
chore: update docs to cover python specifics (#4960) 2021-01-10 18:18:35 -08:00
Pavel Feldman 3b617b3709
docs: validate member links (#4955) 2021-01-08 16:36:52 -08:00
Joel Einbinder 31d980fc92
chore(webpack): minify injected sources (#4946) 2021-01-08 16:15:05 -08:00
Pavel Feldman 114d586f07
chore: add python aliases (#4949) 2021-01-08 15:00:14 -08:00
Pavel Feldman 15c0a29526
docs: split nodejs and python links (#4942) 2021-01-07 23:37:53 -08:00
Dmitry Gozman 2e05feac25
feat(cli): bring in trace viewer (#4920) 2021-01-07 16:15:34 -08:00
Pavel Feldman 54c06a1b45
chore: mark methods as js-only, add python-specific methods (#4938) 2021-01-07 16:12:25 -08:00
Pavel Feldman e56832b646
chore: language-specific members api (#4936) 2021-01-07 15:00:04 -08:00
Dmitry Gozman ffa169ba92
chore: use chokidar for build (#4932) 2021-01-07 13:26:34 -08:00
Pavel Feldman bdf12e32e4
docs: split api-body into classes (#4931) 2021-01-07 11:46:05 -08:00
Pavel Feldman 4cd989c653
docs: introduce deprecation annotation and any type (#4930) 2021-01-07 11:11:40 -08:00
Pavel Feldman 913f85249f
docs: make all links relative (#4926) 2021-01-06 20:02:51 -08:00
Dmitry Gozman 4ff7e1a419
chore: cleanup our build system (#4903)
- Consolidate our build and watch to a single build.js file.
- Update contributing docs.
- Remove unused scripts and package.json script entries.
2021-01-06 12:41:17 -08:00
Pavel Feldman 2311c282d6
docs: pref docs to be language-specific (#4916) 2021-01-06 11:59:29 -08:00
Dmitry Gozman f672033e11
chore: bundle small build of highlight.js (#4907)
This follows the "build from source" configuration (https://highlightjs.org/usage/#source)
and reduces the footprint from 2mb to 100kb.
2021-01-06 09:31:42 -08:00
Andrey Lushnikov 6b3dcb01aa
chore: fix randomly crashing build-playwright-driver.sh (#4909)
Some googling showed that CI systems might not be capable of
handling too much STDOUT that `tar -v` produces.
([source](https://stackoverflow.com/questions/37540792/jenkins-script-tar-write-error)).

This patch:
- removes verbose flag from tar to reduce output
- sets `+x` to get some logging for the script
- silences zip output
2021-01-06 14:13:01 +03:00
Pavel Feldman b6cd385a67
docs: mark some paths as such (#4896) 2021-01-05 17:05:43 -08:00
Dmitry Gozman a9c776f56e
chore: watch to regenerate api.json (#4901) 2021-01-05 15:25:25 -08:00
Dmitry Gozman d47fb6a780
feat(cli): build driver and upload to cdn (#4841) 2021-01-05 14:04:47 -08:00
Pavel Feldman 4996eacd5b
docs: split numbers into integers and floats (#4887) 2021-01-05 09:42:49 -08:00
Joel Einbinder 4a89158293
fix(type-generator): make the generated by message consistent on windows (#4888) 2021-01-05 06:42:38 -08:00
Pavel Feldman 80f8a0fdf5
doc: further align docs w/ playwright.dev (3) (#4884) 2021-01-04 17:59:23 -08:00
Pavel Feldman 31ffeb32e3
doc: further align docs w/ playwright.dev (2) (#4871) 2021-01-04 13:50:29 -08:00
Dmitry Gozman 706c1e44d1
chore: use last commit timestamp for @next builds (#4876) 2021-01-04 11:12:42 -08:00
Pavel Feldman ae935a43d9
doc: further align docs w/ playwright.dev (#4866) 2021-01-03 08:47:29 -08:00
Pavel Feldman e0e836cb6e
doc: split classes into files (#4864) 2021-01-01 15:17:27 -08:00
Pavel Feldman ba291372e7
docs: generate all docs off docs-src (#4858) 2020-12-30 18:04:51 -08:00
Pavel Feldman a5bd415edc
doc: generate class toc as a part of the api generation (#4852) 2020-12-29 17:35:01 -08:00
Pavel Feldman 9817d1095a
doc: generator code health (3) (#4850) 2020-12-29 12:12:46 -08:00
Pavel Feldman 722db85e1c
doc: generator code health (2) (#4843) 2020-12-28 23:42:51 -08:00
Pavel Feldman 70c14e6b99
doc: generator code health (#4840) 2020-12-28 17:38:00 -08:00
Dmitry Gozman a1232b6980
chore: simplify and remove some scripts (#4838) 2020-12-28 16:19:28 -08:00
Dmitry Gozman 068d8612a7
feat(cli): make run-driver work (#4836) 2020-12-28 15:44:24 -08:00
Dmitry Gozman 293a7bdd4c
feat(cli): bring in codegen and tests (#4815) 2020-12-28 14:50:12 -08:00
Dmitry Gozman 94077e0e74
chore: remove JS types checker, rely on typescript (#4831)
chore: remove JS types checker, rely on typescript

We keep checking that all methods are documented, and no extra methods
are documented, but rely on typescript for everything else.
2020-12-28 10:54:47 -08:00
Pavel Feldman a446792c18
docs: generate api.md off documentation model (#4832) 2020-12-28 07:03:09 -08:00
Pavel Feldman fee7dd7cc1
chore: nit type validator fix (#4830) 2020-12-27 08:42:22 -08:00
Dmitry Gozman 905f28c339
feat(types): simplify android and electron types (#4829)
These now follow the scheme for regular types.
2020-12-26 20:25:18 -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
Pavel Feldman dc25173ae3
chore(docs): fix crlf (#4828) 2020-12-26 17:05:44 -08:00
Pavel Feldman 2cb5770183
docs: move playwright module into api-body.md (#4827) 2020-12-26 15:33:29 -08:00
Pavel Feldman 15cdfd1cc1
chore: generate types, api.json off md rather than html (#4825) 2020-12-26 14:31:41 -08:00
Dmitry Gozman 9dd982c508
chore: commit generated types to the repository (#4826)
Also check them during `npm run lint` and regenerate during `npm run watch`.
2020-12-26 13:52:05 -08:00
Pavel Feldman 277d255fc3
chore: brush up md processing (#4819) 2020-12-23 19:35:43 -08:00
Dmitry Gozman 225e65e076
feat(cli): share console api between cli and debug mode (#4807) 2020-12-23 14:15:16 -08:00
Dmitry Gozman f709e2300c
feat(cli): bring selector generator into playwright (#4795)
Also remove unused `SelectorEngine.create` function and add tests.
2020-12-23 12:44:47 -08:00
Dmitry Gozman d40afa2fbf
feat(cli): first few cli commands (#4773)
This sets up cli capabilities and brings in a few commands from playwright-cli.
2020-12-22 14:54:13 -08:00
Dmitry Gozman cc32217e84
chore: fix check-deps (#4801) 2020-12-22 11:01:25 -08:00
Yury Semikhatsky a7f4c69a60
docs: fix browser version generation script (#4797) 2020-12-21 18:09:55 -08:00
Pavel Feldman 2e220df7ac
docs: explicitly annotate methods and parameters (#4771) 2020-12-18 15:31:34 -08:00
Pavel Feldman 774eb53980
fix(adb): force page scale factor update on connection (#4755) 2020-12-17 18:28:49 -08:00
Pavel Feldman e02c54485c
chore(adb): make driver smaller (#4713) 2020-12-14 18:39:14 -08:00
Pavel Feldman 4799e8f20b
feat(adb): add screenshot (#4701) 2020-12-13 23:20:13 -08:00
Pavel Feldman 1596b53da2
test(adb): fix browser tests (#4700) 2020-12-13 22:33:00 -08:00
Max Schmitt b8112dedca
devops: fix Android tests on GHA (#4698) 2020-12-13 14:38:51 -08:00
Max Schmitt f4eff4dbe0
devops: add bot to test Android (#4693) 2020-12-13 14:13:50 -08:00
Pavel Feldman 2ba60e92e3
test(adb): add some adb tests (#4679) 2020-12-11 23:36:08 -08:00
Pavel Feldman aa1b546bd0
chore(android): respect timeout, add build script (#4690) 2020-12-11 23:35:25 -08:00
Pavel Feldman 616df7d2f4
fix(adb): minor fixes (#4678) 2020-12-10 16:37:18 -08:00
Andrey Lushnikov 84ff20f193
test: fix test server on Node 15 (#4668)
This patch fixes a bug in our test server that manifests itself in
Node 15.

Context: Node 14 does not support Apple Silicon (and probably will not),
so we currently have to run tests on Node 15 on new macs.
2020-12-10 09:47:06 -08:00
Pavel Feldman aacd8e633c
chore: expose adb devices and actions (#4647) 2020-12-09 15:06:57 -08:00
Pavel Feldman 1717cbd3d5
doc: describe return value as a part of method (#4608) 2020-12-05 15:29:16 -08:00
Pavel Feldman 96a1f79e96
docs: reformat api-body to allow multiline params documentation (#4604) 2020-12-04 18:05:35 -08:00
Pavel Feldman bf7dff80da chore: remove the --only-update-browsers option 2020-12-04 12:22:34 -08:00
Pavel Feldman 20c17d5470 chore: fix the doclint tests 2020-12-04 12:10:44 -08:00
Pavel Feldman 150d778ca7
docs: disambiguate events (#4597) 2020-12-04 11:09:20 -08:00
Pavel Feldman 761b78efc0
docs: generate links based on the method names (#4593) 2020-12-04 09:03:33 -08:00
Pavel Feldman 2452d07ff7
docs: generate method signatures in docs (#4590) 2020-12-03 22:28:11 -08:00
Pavel Feldman 0eb6f85617
docs: pretty-print api.md (#4588) 2020-12-03 18:05:36 -08:00
Pavel Feldman 5d47a9744c
docs: reformat template parameters (#4587) 2020-12-03 16:02:34 -08:00
Joel Einbinder bc701629db
fix(doclint): exit 1 when doclint throws an error (#4572) 2020-12-03 09:21:56 -08:00
Max Schmitt d2b7e0d1df
fix(types): add typed cb for Page.waitForResponse (#4575) 2020-12-03 09:20:53 -08:00
Pavel Feldman 95c502d274
docs: use templates to reuse documentation properties (#4578) 2020-12-03 09:11:48 -08:00
Pavel Feldman 1fa7e86ea9
docs: generate api.md (#4576) 2020-12-02 13:50:10 -08:00
Joel Einbinder d116787a4d
fix(lint): update check_deps for src/remote (#4547)
check_deps was throwing an error, but nobody was catching it and it still returned an exit code 0. I fixed that, and also fixed the error by adding deps for src/remote.
2020-11-30 14:57:17 -08:00
Andrey Lushnikov d104591aa1
devops(flakiness): azure function to store dashboard in a new format (#4540)
This refactors azure function and adds a new dashboard format implementation that is 15x smaller while tracking specs with non-empty annotations.

Old dashboard is still updated.
2020-11-30 10:16:03 -08:00
Andrey Lushnikov f916c98081
chore: update WebKit version to 14.1 (#4515)
Safari Technology Preview now reports WebKit 14.1
2020-11-23 16:21:42 -08:00
Andrey Lushnikov 06e0aa40eb
devops: add source code for flakiness dashboard (#4479)
This adds source code for the azure function that processes flakiness reports
2020-11-23 15:02:04 -08:00
Dmitry Gozman 38fadcaded
fix(chromium): use frameDetached reason (#4468)
This fixes the local -> remote frame swap when
Page.frameDetached arrives before Target.attachedToTarget.

Instead of error-prone logic we do currently, new CDP exposes
frame detach reason that we can use.
2020-11-17 10:24:13 -08:00
Andrey Lushnikov 2bfee8dc0a
chore: fix publishing @next from release branch (#4418) 2020-11-12 12:18:20 -08:00
Pavel Feldman 2158d6d073
feat(scopes): make page a scope (#4385) 2020-11-10 14:47:26 -08:00
Pavel Feldman 28f6547d67
chore: add adb-based connectivity (#4375) 2020-11-06 16:31:11 -08:00
Dmitry Gozman 12afb79e73
test: unflake har tests (#4335)
Our test server throws Parse Error when connection
aborts at unfortunate time.
2020-11-04 10:24:01 -08:00
Yury Semikhatsky 46e124a933
fix(api.json): use separate maps for methods and events (#4310) 2020-11-02 18:31:32 -08:00
Andrey Lushnikov 51f8f23c5d
devops(flakiness): collect more commit information (#4315)
Collect commit title and author details.
2020-11-02 18:28:03 -08:00
Pavel Feldman 333916a83d
infra: bump to next version on trunk at a branch point (#4288) 2020-10-29 17:46:07 -07:00
Andrey Lushnikov e62f27ac47
chore: eliminate dead code (#4253)
Remove a stray code from original experimentation with flakiness
dashboard.
2020-10-27 00:00:28 -07:00
Pavel Feldman be8428475d
feat(websocket): implement Web Sockets for Chromium & WebKit (#4234) 2020-10-26 22:20:43 -07:00
Andrey Lushnikov 86e1e3f3fe
devops: collect host os name and version (#4244)
Our test annotations don't provide (and don't require) a fine-grained
information regarding ubuntu version, so we collect it separately.
2020-10-26 16:44:32 -07:00
Pavel Feldman 7fc4b797eb
feat(har): allow saving har for context (#4214) 2020-10-26 14:32:07 -07:00
Andrey Lushnikov d5fbe3a662
devops: start uploading test reports to flakiness dashboard (#4239) 2020-10-26 13:46:26 -07:00
Pavel Feldman c2adc98cb0
chore: roll folio to 0.3.8 (#4113) 2020-10-12 13:48:56 -07:00
Dmitry Gozman 46b14bc740
chore: roll folio to 0.3.6 (#4110) 2020-10-12 09:16:02 -07:00
Pavel Feldman 0db09f8ed4
test: roll test runner to 0.9.20 (#4062) 2020-10-05 17:03:24 -07:00
Yury Semikhatsky fbe0fb2977
fix(api.json): do not copy documentation from base class members (#4048) 2020-10-02 19:19:19 -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
Dmitry Gozman 4a77363af7
api: update videos api, hide tracing (#4015) 2020-10-01 11:06:19 -07:00
Pavel Feldman d658b687ca
chore: refactor screencast tests (#4007) 2020-09-29 18:52:30 -07:00
Pavel Feldman 7ccdc5176d
chore: include api.json into the Playwright package (#4003) 2020-09-29 13:48:24 -07:00
Pavel Feldman 6102052832
Revert "chore: don't hold sourcemap reference in prod build (#3959)" (#3979)
I like my tests showing TS source lines more!
2020-09-25 15:25:54 -07:00
Pavel Feldman 970b011cba
chore: roll @playwright/test to 0.9.6 (#3977) 2020-09-25 12:52:06 -07:00
Max Schmitt 6d5ab534d9
chore: don't hold sourcemap reference in prod build (#3959) 2020-09-23 22:19:45 -07:00
Dmitry Gozman 0ade6af689
api(trace): introduce artifacts options (#3914)
api(trace): introduce artifacts options

This introduces launch({ artifactsPath }) and newContext({ relativeArtifactsPath, recordTrace }) options.
- artifactsPath option controls the directory where all artifacts go. If not passed, artifacts are not collected.
- relativeArtifactsPath can be used to put context-specific artifacts into a subfolder. If not passed, shared artifactsPath is used.
- recordTrace controls trace recording.

We also expose trace types under playwright/types/trace.d.ts.

In the follow up:
- videos will be put into artifactsPath;
- downloads will be put into artifactsPath, or keep using existing downloadsPath when artifactsPath is not specified.
2020-09-18 11:54:00 -07:00
Pavel Feldman c20cbae529
chore: remove trace viewer (#3869) 2020-09-14 07:56:04 -07:00
Pavel Feldman f94df318d5
chore: roll test runner to 0.3.9 (#3847) 2020-09-11 10:02:07 -07:00
Pavel Feldman a597004780
chore: roll test runner to 0.3.5 (#3832) 2020-09-10 21:31:46 -07:00
Dmitry Gozman 9e41518c92
feat(rpc): allow sending metadata with rpc calls (#3836)
Currently, metadata does only contain the stack trace,
and we send it from the JS client.
2020-09-10 19:25:44 -07:00
Andrey Lushnikov 45542a5334
docs: fix table-of-contents generation (#3840) 2020-09-10 15:14:00 -07:00
Andrey Lushnikov 868740067b
refactor: consolidate ffmpeg-related files in third_party/ffmpeg (#3815)
This patch:
- moves ffmpeg binaries from `//bin/` to `//third_party/ffmpeg`
- adds [COPYING.GPLv3](https://github.com/FFmpeg/FFmpeg/blob/master/COPYING.GPLv3)
ffmpeg license
- changes npm packaging to include `//third_party/ffmpeg` only in `playwright` and `playwrihgt-chromium` a
2020-09-09 09:51:28 -07:00
Andrey Lushnikov 143adc1634
refactor: bake ffmpeg into npm instead of CDN (#3799) 2020-09-08 15:10:36 -07:00
Joel Einbinder 658b34e3fe
fix(lint): fix doclint and preprocessor tests (#3793) 2020-09-08 10:19:26 -07:00
Dmitry Gozman 675ce00432
chore: introduce "instrumentation" that is used for debug and trace (#3775) 2020-09-04 16:31:52 -07:00
Max Schmitt 190d16daa3
feat: add browser type to device descriptors (#3731) 2020-09-03 13:12:43 -07:00
Andrey Lushnikov 8b9be6bbbe
devops: fix publishing of @next packages to NPM (#3759)
This patch:
- stop relying on stdout from `//packages/build_package.js` to get
output paths. This was a legacy code that's not needed anymore
- remove stray output from `//packages/build_package.js`
2020-09-03 11:59:58 -07:00
Dmitry Gozman a4563a85ce
fix(snapshot): remove integrity checksum for css (#3729)
Otherwise we cannot override css with cssom changes.
2020-09-02 10:20:52 -07:00
Yury Semikhatsky 8ec55e1fb2
feat(screencast): use ffmpeg to produce webm in chromium (#3668) 2020-08-31 08:43:14 -07:00
Joel Einbinder 3cc91093a1
chore(testrunner): move out of the repo (#3687) 2020-08-29 08:27:32 -07:00
Joel Einbinder 6a93cb9749
fix(types): don't show types that we don't export (#3185)
Today we have a bunch of types used by the d.ts file that are not exported. We don't want to export them because it would greatly increase our semver API surface area, so this patch inlines them. Now users will not see names of types they can't import.
2020-08-28 17:53:03 -07:00
Dmitry Gozman e5ff283a40
fix(trace): only enable on separate tracing bots (#3677) 2020-08-28 13:50:06 -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
Max Schmitt 254238cdce
enh: bake browser revisions and api into driver (#3514) 2020-08-26 16:01:42 -07:00
Yury Semikhatsky a2a96198e6
fix(devops): fix firefox protocol.ts location (#3630) 2020-08-25 16:23:43 -07:00
Dmitry Gozman bdbcae16cb
chore: remove injected -> types dependency (#3606)
This way, injected is self-contained and we can ensure it does not
depend on anything node-specific.
2020-08-24 15:30:45 -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
Dmitry Gozman cd220daa83
chore: move src files to server (#3593) 2020-08-24 06:51:51 -07:00
Dmitry Gozman 43893cc0f8
chore: improve check-deps (#3592) 2020-08-23 21:24:16 -07:00
Dmitry Gozman 73e53b21df
chore: move injected and debug to src/server (#3591) 2020-08-23 20:25:59 -07:00
Dmitry Gozman 847201b132
chore: move firefox to src/server/firefox (#3590) 2020-08-23 17:05:58 -07:00
Dmitry Gozman 6a53b205e5
chore: move webkit to src/server/webkit (#3589) 2020-08-23 15:39:03 -07:00
Dmitry Gozman 2e1493a5fa
chore: move browserPaths to utils, enforce more deps (#3584) 2020-08-22 21:15:03 -07:00
Dmitry Gozman f4e8f34c96
chore: move chromium to src/server/chromium, enfore installer deps (#3582) 2020-08-22 15:46:42 -07:00
Dmitry Gozman 9fca63f8ec
chore: move src/rpc/client to src/client (#3581) 2020-08-22 15:13:51 -07:00
Dmitry Gozman 655013d025
chore: move shared utilities to src/utils (#3575) 2020-08-22 07:07:13 -07:00
Dmitry Gozman 6fe1cd9812
chore: move protocol files to src/protocol (#3571) 2020-08-21 18:46:11 -07:00
Joel Einbinder 8ae3c4be06
feat(testrunner): delete types.d.ts (#3551) 2020-08-21 09:53:02 -07:00
Joel Einbinder 012f9425bf
chore(test-runner): move into its own folder and typescript project (#3548) 2020-08-20 16:04:27 -07:00
Joel Einbinder 0d03cc0f9a
feat(utils): add a script for watching various builds (#3545)
Watches our main typescript compilation, webpacks, type generation, and rpc channel generation.
2020-08-20 09:27:04 -07:00
Pavel Feldman 86815d70e0
test: convert rename options to parameters, remove options magic (#3543) 2020-08-19 21:32:12 -07:00
Dmitry Gozman 5aa4116204
docs: sort all enums in doclint (#3488)
Currently, the order depends on some internals of typescript compiler
and changes from time to time. Sorting makes it stable.
2020-08-17 10:47:21 -07:00
Joel Einbinder c0b9cecc65
feat(types): export ConnectOptions (#3147) 2020-08-16 16:40:25 -07:00
Joel Einbinder d516f81eeb
fix(rpc): add a custom toJSON to help jest's expect library (#3489) 2020-08-16 14:41:33 -07:00
Dmitry Gozman 85c93e91a7
api: introduce ElementHandle.waitForSelector (#3452)
This is similar to Frame.waitForSelector, but relative to the handle.
2020-08-14 14:47:24 -07:00
Pavel Feldman 6abc352498
test: remove output and golden directory notions (#3456) 2020-08-13 17:32:27 -07:00
Dmitry Gozman 9b52ca8676
chore: remove unused non-rpc code, test options, infra, bots (#3444) 2020-08-13 16:00:23 -07:00
Joel Einbinder 84441f8f77
chore(test): run doclint tests with mocha, delete testrunner again (#3447) 2020-08-13 13:57:27 -07:00
Andrey Lushnikov 4f05039944
devops: do not fail check when refusing to publish TOT revision (#3443) 2020-08-13 10:39:45 -07:00
Pavel Feldman 51bd3709ff
Revert "chore(test): run doclint tests with mocha, delete utils/testrunner (#3428)" (#3432) 2020-08-12 22:01:37 -07:00
Joel Einbinder 061ff25741
chore(test): run doclint tests with mocha, delete utils/testrunner (#3428) 2020-08-12 20:02:48 -07:00
Andrey Lushnikov 40f685226b
devops: migrate //utils/check_availability.js off browser fetcher (#3418)
The script is used to check the state of chromium CDN, whereas
our browser fetcher now defaults to Playwright CDN.
2020-08-12 15:01:07 -07:00
Joel Einbinder 6054f14794
chore(tests): convert all tests to typescript (#3384) 2020-08-11 15:50:53 -07:00
Joel Einbinder 55a78482e4
fix(types): fix type generation to make ts tests work (#3385) 2020-08-11 14:31:20 -07:00
Pavel Feldman 823ef86470
test: add support for mocha (#3376) 2020-08-10 20:10:39 -07:00
Joel Einbinder d76166beca
chore(test): require playwright fixtures from userland (#3355)
This patch moves fixtures.js to base.fixtures.ts that sits next to tests. All tests get an extra import to get the base fixtures (both types and implementations).
2020-08-10 16:48:34 -07:00
Dmitry Gozman 3179e71912
feat(rpc): in-process rpc on by default (#3104) 2020-08-10 14:18:58 -07:00
Dmitry Gozman ef76f5b922
feat(rpc): introduce JSON type in the protocol for arbitrary blobs (#3367) 2020-08-10 11:20:32 -07:00
Pavel Feldman 6f09590c9a
test: restore nojest runner (#3359) 2020-08-08 19:43:00 -07:00
Dmitry Gozman c6acc32889
docs(api): explicit nulls, use Serializable and EvaluationArgument more (#3358) 2020-08-07 20:55:22 -07:00
Joel Einbinder c9409bf1b3
fix(types): add missing properties to DeviceDescriptor (#3332) 2020-08-06 15:45:13 -07:00
Dmitry Gozman 126b1f79d4
feat(rpc): run doclint against rpc client (#3260) 2020-07-31 17:00:36 -07:00
Pavel Feldman 93056ed8ef
chore(rpc): more protocol nits (#3246) 2020-07-30 17:51:41 -07:00
Dmitry Gozman 6297f86cfa
feat(rpc): run generate-channels during lint (#3238) 2020-07-30 15:08:21 -07:00
Dmitry Gozman 3bd97776b8
feat(rpc): do not use server types and events in rpc/client (#3219)
This change removes almost all dependencies from rpc/client
to the rest of the project. The last ones would be utilities
like helper, converters, etc.
2020-07-29 17:26:59 -07:00
Andrey Lushnikov 487bc589b0
devops: re-factor list-dependencies script to output per-browser results (#3194)
This patch:
- refactors script to output per-browser package dependencies. This is to aid with
  per-browser docker setup and Playwright github action.
- sorts package maps for both Ubuntu 18.04 and Ubuntu 20.04 alphabetically (and removes a stray dependency)

References #2926
2020-07-29 13:38:54 -07:00
Max Schmitt 21b1be7351
docs(selectors): fixed selector register example (#3169) 2020-07-29 10:37:57 -07:00
Dmitry Gozman bdfde5cd5c
fix(firefox): roll firefox for postdata fix (#3196) 2020-07-28 18:47:25 -07:00
Dmitry Gozman 6cb1e03713
feat(rpc): disallow deps into rpc client from outside (#3199)
For this, common converters are extracted from rpc serializers.
2020-07-28 15:33:38 -07:00
Dmitry Gozman e406119f0c
chore: add check_deps script (#3182)
This will be used to disallow cross-directory imports,
for example from impl to rpc.
2020-07-27 13:02:28 -07:00
Dmitry Gozman 98cc9db8e8
chore: simplify doclint (#3162)
This renames CRBrowserContext events into ChromiumBrowserContext and
simplifies some doclint/coverage logic.
2020-07-24 20:40:21 -07:00
Dmitry Gozman fd2e65b73c
api: export all browsers from every package (#3128)
This makes it easier to reason about our packages.
The only difference is what each package downloads.
When the browser is not downloaded, it will fail to launch.

Each browser gets a 'download' attribute in the browser.json file.
2020-07-24 16:36:00 -07:00
Andrey Lushnikov c8c92c509d
fix(utils): fix check-availability script (#3158) 2020-07-24 16:22:52 -07:00
Dmitry Gozman 415e94f410
feat(rpc): server-side validator (#3150) 2020-07-24 15:16:33 -07:00
Pavel Feldman e7cca86757
fix(postData): allow overriding binary post data (#3120) 2020-07-24 12:16:45 -07:00
Dmitry Gozman 68c4f79b02
feat(rpc): convert protocol to yaml (#3102) 2020-07-22 19:38:19 -07:00
Dmitry Gozman b1a5a02154
feat(rpc): client-side parameters validation (#3069) 2020-07-22 18:05:07 -07:00
Dmitry Gozman 4db035dff4
chore: roll_browser to also update docs (#3088) 2020-07-22 11:03:35 -07:00
Andrey Lushnikov 47e30f047b
feat: introduce chromiumSandbox launch option (#3067)
The option is intended to be used instead of the `--no-sandbox`
argument that is accepted exclusively by Chromium and crashes
WebKit.

References #2745
2020-07-21 13:49:09 -07:00
Dmitry Gozman 3dead4c8d1
feat(rpc): remove last union types from the protocol (#3059) 2020-07-21 12:44:30 -07:00
Dmitry Gozman 5848ed8f41
feat(rpc): introduce protocol.pdl (#3054)
We now generate channels.ts from the protocol definition. There are still some shortcomings,
like union types - these will be addressed in follow ups.
2020-07-20 17:38:06 -07:00
Andrey Lushnikov 377404448c
devops: add script to generate shared object => package mapping (#3022)
We use this mapping to provide recommendations on which packages
to install on Linux distributions.

References #2745
2020-07-20 10:35:42 -07:00
Andrey Lushnikov 0346c3a1dc
chore: update release notes draft gen (#2932) 2020-07-13 14:48:29 -07:00
Joel Einbinder 040c6a6a41
chore(jest): run tests with jest (#2754)
Experimentally run `npx jest` to run our tests with jest.
2020-07-08 11:13:18 -07:00
Andrey Lushnikov 760283ea4e
testrunner: fix default environment name (#2870) 2020-07-07 22:14:04 -07:00
Dmitry Gozman 0c80c22716
feat(rpc): plumb CDPSession (#2862) 2020-07-07 18:47:00 -07:00
Joel Einbinder 6ed8b5fcc6
chore(eslint): lint for copyrights on files (#2858) 2020-07-07 11:12:45 -07:00
Andrey Lushnikov 15ddb5d32b
chore: update webkit version (#2804)
Safari Technology Preview reports WebKit 14.0. Align with them!
2020-07-06 15:13:53 -07:00
Andrey Lushnikov 05b019f1ba
reland: testrunner: make environment a simple class (#2812)
This re-lands PR https://github.com/microsoft/playwright/pull/2769

It was reverted before in https://github.com/microsoft/playwright/pull/2790
because it was breaking the new CHANNEL bot.
2020-07-02 11:05:38 -07:00
Andrey Lushnikov 5484217c9f chore: make //utils/roll_browser.js executable 2020-07-02 00:40:47 -07:00
Dmitry Gozman 5c4751d5dd
chore: generate protocol during browser roll (#2719)
We now commit protocol.ts files during the roll.
New utils/roll_browser.js helps with that.

This makes our installation very shallow:
- build installer;
- download browsers.
2020-07-01 15:22:29 -07:00
Pavel Feldman e467ea57e7
revert: testrunner: make environment a simple class (#2769) (#2790) 2020-07-01 10:56:19 -07:00
Andrey Lushnikov f00fc0760a chore: fix utils/check_availability.js 2020-06-30 16:54:52 -07:00
Andrey Lushnikov 1605cb453c
testrunner: make environment a simple class (#2769)
This patch:
- makes environment a simple class with optional methods `beforeEach`, `afterEach`, `beforeAll`, `afterAll`, `globalSetup` and `globalTeardown`
- removes capability to have multiple hooks of the same name inside suite
- removes default environment for test. (`dit` now adds a `TraceTestEnvironment` to the test)
- extracts all environments that we use in our tests in `//test/environments.js`

Downsides:
- we no longer know hook locations for the environments. This, however, should not be a big deal since stack traces (if any) will still point into it.
- this also regresses hook locations for suites for simplicity. We can get them back, but it shouldn't be pressing since we now have only one hook of each kind in every suite.
2020-06-30 16:51:03 -07:00
Andrey Lushnikov 1865c5685a
testrunner: support globalSetup and globalTeardown hooks. (#2686) 2020-06-24 22:08:46 -07:00
Andrey Lushnikov 07dbd0baae
testrunner: teach runHook to accept hook arguments (#2682) 2020-06-23 18:17:14 -07:00
Andrey Lushnikov c61e2d6cc9
testrunner: drop nested test environments (#2681) 2020-06-23 16:45:00 -07:00
Joel Einbinder fb84e19b6f
feat(types): autocomplete for default devices (#2198)
* feat(types): autocomplete for default devices

* don't export the extra Device type

Co-authored-by: Joel Einbinder <joel.einbinde@gmail.com>
2020-06-18 12:28:20 -07:00
Pavel Feldman f2c47b1d33
feat(cli): introduce basic playwright CLI tool (#2571) 2020-06-14 17:24:45 -07:00
Pavel Feldman 894826dec0
chore: form the debug script for authoring hints / helpers (#2551) 2020-06-11 18:18:33 -07:00
Pavel Feldman fb058ffe0d
feat(proxy): allow specifying proxy (#2485) 2020-06-05 13:50:15 -07:00
Dmitry Gozman 1d37a10558
chore: migrate navigations to Progress (#2463) 2020-06-04 16:43:48 -07:00
Dmitry Gozman 8e6375f532
chore: reduce the number of evaluate methods, improve types (#2454)
Types can now handle non-trivial tuples with handles inside.
2020-06-03 13:22:05 -07:00
Pavel Feldman 4ac30f354a
feat(webkit): roll WebKit to 1246 (#2400) 2020-05-28 22:35:01 -07:00
Andrey Lushnikov 43eed027bd
chore: rename root index-for-dev.js into index.js (#2337) 2020-05-23 00:03:57 -07:00
Andrey Lushnikov 3c84e9ec3a
devops: enable canary publishing (#2335) 2020-05-21 16:56:57 -07:00
Andrey Lushnikov 505d94ab1a
chore: drop dependency on playwright-core in all our packages (#2318)
This patch:
- drops dependency on playwright-core in all our packages. Instead of
  the dependency, packages are now built with `//packages/build_package.sh`
  script.
- unifies `browsers.json` - now there's a single `//browsers.json` file
  that is used to manage browser revisions.

This patch temporary switches canary publishing to `--dryn-run` from CI/CD so that we
can verify that it does sane things.

We'll unify all our package management scripts under `//packages/` in a
follow-up.

Fixes #2268
2020-05-21 13:18:15 -07:00
Pavel Feldman aa0d844c76
chore: introduce utility script for evaluate helpers (#2306) 2020-05-20 15:55:33 -07:00
Joel Einbinder 8e396fdac0
fix(types): add missing types for removing event listeners (#2307) 2020-05-20 07:34:36 -07:00
Pavel Feldman e558f0516b
chore: print the launch error message to console (#2304) 2020-05-20 00:10:10 -07:00
Pavel Feldman 99b7aaace8
chore: refactor injected script harness (#2259) 2020-05-15 15:21:49 -07:00
Andrey Lushnikov e035bf3b33
fix: update webkit version (#2250)
Fix #2245
2020-05-14 16:47:18 -07:00
Pavel Feldman c5b0baacd1
chore: remove main index.js from playwright-core (#2178) 2020-05-11 09:38:09 -07:00
Pavel Feldman d487a315b9
doc: fix the route docs (#2174) 2020-05-11 08:22:48 -07:00
Vasilii Artemchuk 4c4fa8d38c
docs: some syntax fixes (#2116) 2020-05-07 12:33:35 -07:00
Andrey Lushnikov 193924f405
chore: add script to generate release notes (#2099) 2020-05-04 22:28:09 -07:00
Dmitry Gozman 963dc72dd2
devops: add headful linux bot (#2060) 2020-05-04 15:15:51 -07:00
Pavel Feldman bcce48362a
api(waitForSelector): make "state: visible" default, includes rename to state (#2091) 2020-05-04 11:03:44 -07:00
Andrey Lushnikov a9f0c40af3
feat(testrunner): improvements to testrunner (#2070)
This patch:
- teaches test runner to understand custom argument spelling, e.g. `--file=evalu` and `-j10`
- fixes `--file` filter to actually focus file paths instead of focusing
all tests with given path
2020-05-01 10:09:45 -07:00
Andrey Lushnikov 3251465657
chore: add script to fetch closed bugs since git commit (#2066) 2020-04-30 17:57:45 -07:00
Pavel Feldman 2cdf297245
chore: remove uncompiled download-browser (#2018) 2020-04-28 17:06:01 -07:00
Pavel Feldman d52bd92983
chore: read browser revisions off browsers.json (#2009) 2020-04-28 10:37:23 -07:00
Pavel Feldman b60c006c63
chore: simplify and restructure downloads (#1974) 2020-04-24 19:14:10 -07:00
Andrey Lushnikov 4b263d6334
docs(releasing): update releasing docs according to new process (#1958) 2020-04-24 08:55:29 -07:00
Andrey Lushnikov 21dc346b16
devops: auto-correct links in our documentation (#1955) 2020-04-23 19:52:06 -07:00
Joel Einbinder 671cfa0a54
fix(types): support objects with typed keys and values (#1752)
There are a few places in the API where we use objects as maps. This patch adds them to docs and the types.

For `env`, we accept booleans and numbers as well because they are often used for their string values.
2020-04-23 14:45:57 -07:00
Andrey Lushnikov 511883d3f0
devops: fix checking if branch is tip-of-tree when publishing @next (#1926)
This should fix publishing @next from release branches.
2020-04-22 17:02:38 -07:00
Andrey Lushnikov 89007c8f3d
devops: make README.md to always reflect tip-of-tree (#1911)
As of today, we have tooling in place that makes sure that our
main README.md **roughly** represents the state of the last release:
- browser versions and browser badges are those that we released last
- links to our API point to the last-released API version

This tooling, however, relies on the fact that every release is a sequence
of two consecutive commits:
- one commit that sets `package.json` version to a released version
- the following that "bumps" version to `-post`.

This release process is very unfortunate, because:
- it made releasing from branch impossible
- it required "freezing" commits to the master branch

This patch removes all the tooling and transitions `README.md` to always
represent tip-of-tree state. We will fully rely on
`https://playwright.dev` to show versioned docs.
2020-04-21 22:08:56 -07:00
Andrey Lushnikov 2d68830411
feat(testrunner): support --file to filter tests by test file name. (#1903) 2020-04-21 16:47:38 -07:00
Andrey Lushnikov 96331de1f1
devops: start actually publishing @next versions for tip-of-tree commits (#1893)
The https://github.com/microsoft/playwright/runs/603719537 was pretty
successful.
2020-04-20 23:52:03 -07:00
Andrey Lushnikov 068e1e00af devops: fix next version generation 2020-04-20 17:53:08 -07:00
Andrey Lushnikov ac8a30c526
devops: start releasing from Github Actions (#1890)
This patch:
- removes releasing from Travis CI
- sets up a new GH Action that releases @next version from tip-of-tree

Once this GH Action proves to be working, we'll setup a `publish_release.yml`
workflow that will be triggered only by **release** github events
and that will publish released version with `LATEST` tag.

NOTE: this workflow does not actually run publishing - we're doing
`--dry-run` for now to see how it works in
`//utils/publish_all_packages.sh`.
2020-04-20 17:45:29 -07:00
Dmitry Gozman 948d51d52c
fix(types): export selected types (#1881)
Currently exports LaunchOptions, BrowserContextOptions, Cookie and their deps.
2020-04-20 17:30:57 -07:00
Pavel Feldman 0656771167
api(networkidle): remove networkidle2 (#1883) 2020-04-20 16:52:26 -07:00
Dmitry Gozman cf82e2c945
fix(testrunner): await terminations before reporting test results (#1855)
This way we ensure that all errors are picked up.
2020-04-17 18:42:12 -07:00
Andrey Lushnikov 51b8685a8c
feat(testrunner): support --repeat CLI flag to repeat tests (#1828)
This allows you to run `npm run cunit -- --repeat 10` to run
tests multiple times.
2020-04-16 18:09:25 -07:00
Andrey Lushnikov 167d265e56
fix(testrunner): make .repeat() retain test order (#1814) 2020-04-15 18:41:55 -07:00
Andrey Lushnikov 9efc66366c
chore: generate README.md for playwright package on prepublish (#1801)
This will ensure that `playwright` package always has a readme.

Fix #1798
2020-04-15 11:29:59 -07:00
Dmitry Gozman a3571c24c4
fix(testrunner): respect timeout=0 in hooks (#1764) 2020-04-13 14:30:51 -07:00
Dmitry Gozman 29a6cdff6b
fix(tests): fix a race with golden setup (#1757)
When running multiple browsers, we should take the golden information from the state.
2020-04-13 14:12:44 -07:00
Dmitry Gozman cd2ecb2212
fix(types): allow explicit subtypes for unwrapped handles (#1747) 2020-04-10 20:10:34 -07:00
Andrey Lushnikov 2fd7f4e111 devops: fix update_version.js script 2020-04-08 16:25:32 -07:00
Dmitry Gozman 2d57fff0be
fix(tests): fix multiple browsers tests (#1718)
- Use a server only once, not once per browser.
- Avoid require cache for test files.
- Improve testrunner hooks debugging.
2020-04-08 15:54:17 -07:00
Dmitry Gozman 2ef8e26602
test: structure tests to use environments, closer to end user (#1713) 2020-04-08 14:17:34 -07:00
Dmitry Gozman 20ff327827
feat(testrunner): catch delegate errors (#1704)
This ensures we get a proper error when something goes wrong. Should
also help with producing the right error code in the case of internal error.

Drive-by: fix location issue which manifests on the bots.
Drive-by: remove the use of Array.prototype.flat to make it work on bots.
2020-04-07 22:56:21 -07:00
Dmitry Gozman 39e06f0286
feat(testrunner): improve reporting of unhandled errors/rejections (#1697) 2020-04-07 16:02:33 -07:00
Dmitry Gozman cd39053ccc
feat(testrunner): make it easier to setup golden matcher (#1682) 2020-04-06 18:01:56 -07:00
Dmitry Gozman e519a3d762
fix(testrunner): better capture Location for hooks (#1680) 2020-04-06 17:47:17 -07:00
Dmitry Gozman f2b13c0e93
chore(testrunner): split TestRunner into parts (#1679) 2020-04-06 17:21:42 -07:00
Dmitry Gozman 823f961d8d
feat(testrunner): migrate from events to a delegate (#1647)
This allows an async handler for each event that can be awaited.
Drive-by: merge TestPass into TestRunner.
2020-04-03 15:47:25 -07:00
Dmitry Gozman 1f2803bbc6
feat(testrunner): removeEnvironment (#1650) 2020-04-03 09:48:01 -07:00
Dmitry Gozman ea16e55ba3
fix(lint): import errors (#1649) 2020-04-02 20:30:52 -07:00
Pavel Feldman 75571e8eb8
feat(downloads): support downloads on cr and wk (#1632) 2020-04-02 17:56:14 -07:00
Joel Einbinder 3d6d9db44a
fix: wait for the process to close when closing the browser (#1629) 2020-04-02 16:57:12 -07:00
Dmitry Gozman d38baae01c
feat(testrunner): nested environments (#1635) 2020-04-02 13:12:22 -07:00
Pavel Feldman e241c1bef8
chore: remove web mode (#1625) 2020-04-01 14:42:47 -07:00
Arjun Attam 1f0b7bff04
docs(api): update ordering for $eval and $$eval (#1623) 2020-04-01 13:09:24 -07:00
Dmitry Gozman f87e64544c
feat(testrunner): introduce environments (#1593) 2020-04-01 10:49:47 -07:00
Joel Einbinder a853690c16
fix(types): don't export derived types (#1598)
I was playing around today with different ways of changing the way we export types for #1439. I looked at only exporting 'Parameter' types, only exporting 'Return' types, only exporting a manual list of 'important' types. They all had different pros and cons, and it was very difficult to settle on a good answer.

For now, let's not export any parameter/return types. We can whitelist some types upon user request. I'm thinking `LaunchOptions` and `AccessibilitySnapshot` could be quite useful. We can always add new types after 1.0, but we can't remove them.

The patch looks funny because this was my original intent for the types, but I didn't know I had to `export {}` to tell typescript that my .d.ts shouldn't export everything.
2020-03-31 16:19:20 -07:00
Joel Einbinder 92c5ab3b7e
fix(types): correctly infer type in $eval and $$eval (#1603) 2020-03-31 13:22:38 -07:00
Joel Einbinder 08aebc72fa
fix(types): add types for waitForEvent (#1601) 2020-03-31 09:17:54 -07:00
Dmitry Gozman b6166c9669
chore(testrunner): introduce Location class (#1585)
Drive-by: fix an edge when testing continued after termination.
2020-03-29 21:38:30 -07:00
Dmitry Gozman c49b856d6d
chore(testrunner): remove setup() helper (#1584) 2020-03-29 11:37:45 -07:00
Dmitry Gozman a41836b1f1
chore(testrunner): introduce TestRun (#1582) 2020-03-28 14:25:57 -07:00
Dmitry Gozman b85ab891a1
chore(testrunner): make most modifiers external (#1581) 2020-03-28 08:49:00 -07:00
Dmitry Gozman 4bd46bafa9
feat(testurnner): allow multiple hooks isntances and per-test hooks (#1571) 2020-03-27 22:57:22 -07:00
Dmitry Gozman 6503c83302
fix(install): speculative fix for generateChromiumProtocol (#1583) 2020-03-27 22:42:39 -07:00
Pavel Feldman 6903496f2d
fix(build): generate protocol in chromium (#1579) 2020-03-27 17:11:54 -07:00
Dmitry Gozman a042466125
chore(testrunner): remove effectiveMode and effectiveExpectation (#1569) 2020-03-27 15:35:14 -07:00
Dmitry Gozman af7a16c360
chore(testrunner): merge test spec with test, suite spec with suite (#1566) 2020-03-26 22:47:13 -07:00
Dmitry Gozman aad82e00bd
chore(testrunner): decouple UserCallback from location and timeout (#1557)
This will make it easier to change lifetimes of Test and Suite.
2020-03-26 14:43:28 -07:00
Dmitry Gozman 81bd8de00b
feat(testrunner): composable and bindable attributes and modifiers (#1547)
This allows to make things like `fit`, `skip()` and soon even `dit` be implemented externally.
2020-03-25 22:42:09 -07:00
Andrey Lushnikov 7e75cefd20
devops: restore publishing @next version (#1540)
This merges the `//utils/apply_next_version.js` in to
`//utils/update_version.js`.
2020-03-25 17:31:19 -07:00
Dmitry Gozman b61198458c
feat(testrunner): modifiers and attributes (#1538)
This generalizes test modifiers to support custom ones.
2020-03-25 14:40:57 -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 6ee7852f0f
chore: update release guide and helper script (#1521) 2020-03-25 13:15:29 -07:00
Dmitry Gozman a2ee7a1f2a
fix(testrunner): do not spam output after termination (#1511) 2020-03-24 14:40:59 -07:00
Pavel Feldman 222560866a
chore: add logging to the testing server (#1505) 2020-03-24 09:11:56 -07:00
Joel Einbinder 5bf9f223db
fix(docs): consider argument to be optional in evaluate (#1500) 2020-03-23 17:22:10 -07:00
Pavel Feldman c0c9b7f137
test: make debugp collect IO (take 2) (#1493) 2020-03-23 15:08:02 -07:00
Joel Einbinder 1a25a4efcf
fix(doclint): support lists in comments (#1492)
Adds logging comments to the doclint tests, and adds a new one with a bulleted list in a comment. Lists can only be used in comments where extra properties would be unexpected.
2020-03-23 14:50:32 -07:00
Dmitry Gozman 63906454a7
fix(testrunner): attribute unhandle promise reject to a single worker (#1491)
When there is a single worker, we are almost sure the error originated in that worker. Attributing it helps with context by showing last run tests.
2020-03-23 14:45:21 -07:00
Pavel 1ddf05113b Revert "test: make debugp collect IO (#1485)"
This reverts commit b1bebdad2e.
2020-03-23 13:48:22 -07:00
Pavel Feldman b1bebdad2e
test: make debugp collect IO (#1485) 2020-03-23 13:42:51 -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
Joel Einbinder 825555cddf
types: better types (#1166)
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

#6
2020-03-20 01:30:35 -07:00
Andrey Lushnikov f5ecbff16e
devops: remake downloading logic (#1419)
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 #1085)
- 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 (#1376)
Currently in our API `?` means null, but sometimes it means optional. Linting optional/nulls with this patch is required for #1166 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 #1166. 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
Andrey Lushnikov a9ab9b0dc0
fix(testrunner): sourcemapify stack traces for test errors (#1409)
Fixes #1403
2020-03-17 09:04:44 -07:00
Dmitry Gozman 3960b179a1
fix(testrunner): fit.fail should run the test (#1407) 2020-03-16 19:12:52 -07:00
Andrey Lushnikov 5816ec53f7
fix(testrunner): dedup focused tests and suites by id (#1393) 2020-03-16 09:04:55 -07:00
Dmitry Gozman e7eeefe4c7
chore(testrunner): separate expectations from run mode (#1395)
Run/Focus/Skip is orthogonal to expect to Pass/Fail/Flake.
This change separates the two, in a preparation to run Fail/Flaky tests.
2020-03-15 23:10:49 -07:00
Pavel Feldman e692dd6e62
api(cdp): rename ChromiumSession to CDPSession (#1380) 2020-03-13 16:16:54 -07:00
Dmitry Gozman 0d7cb29329
test: continue running tests after crash, report crashes separately (#1362) 2020-03-12 17:32:53 -07:00
Joel Einbinder be83cba409
fix(doclint): correctly get versions on windows (#1350)
--version doesn't work on windows.
2020-03-12 14:03:01 -07:00
Andrey Lushnikov 704fe6dc73 fix(testrunner): fix reporting focused tests 2020-03-11 18:53:24 -07:00
Andrey Lushnikov 1cd00bd068
feat(testrunner): allow filtering by name and show all focused tests (#1354) 2020-03-11 18:30:43 -07:00
Max Schmitt a24cce8b74
devops: fix protocol generation with root on Linux (#1327)
Currently it was leading to an error if I tried to build it with a root user on a Linux environment. So in the end the type generation was just skipped:

```
22:51:55.757 $ node install-from-github.js
22:51:55.813 Building playwright...
22:52:14.094 chromium downloaded to /11994741/playwright/.local-chromium/linux-747023 22:52:14.123 Failed to launch browser!
22:52:14.123 [0310/215214.121201:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
22:52:14.123 TROUBLESHOOTING: https://github.com/Microsoft/playwright/blob/master/docs/troubleshooting.md
```

Maybe we should also exit the script with an error code if the protocol generation was not successful.
2020-03-10 15:21:08 -07:00
Yury Semikhatsky 16d5a9cb24
tests(runner): support DEBUGP for timing out tests (#1324) 2020-03-10 14:48:13 -07:00
Dmitry Gozman 0ce8efab7b
test: rework testrunner workers (#1296)
This change introduces a TestWorker that can be in a certain state,
meaning it has run some beforeAll hooks of a certain test suite stack.

TestWorker can be created at any time, which allows for a number of features:
- don't run hooks for suites with no runnable tests;
- smarter test distribution (and possibility for variuos strategies);
- recovering from hook failures and test failure by creating a new worker;
- possible isolation between workers by running them in separate environments.
2020-03-10 11:30:02 -07:00
Andrey Lushnikov d542ef849f
fix(testrunner): handle uncaught errors (#1317) 2020-03-10 11:16:54 -07:00
Andrey Lushnikov 3dc48f96c0
chore: output both received value and diff for string expected results (#1287) 2020-03-07 17:29:41 -08:00
Andrey Lushnikov c881248062
docs(contributing.md): update CONTRIBUTING.md (#1286)
Fixes #1257
2020-03-07 17:29:22 -08:00
Yohix bfd32fe6d2
doc: fix typos (#1284) 2020-03-07 08:37:47 -08:00
Pavel Feldman 3c35d7b058
api(waitFor): click(waitFor) -> click(force) (#1275) 2020-03-06 16:24:21 -08:00
Andrey Lushnikov a0e12e0a14
feat(testrunner): support .slow() for slow tests (#1274)
Slow tests have 3x timeout.
2020-03-06 15:52:24 -08:00
Joel Einbinder 8aa88d5021
fix(doc): check and update optional types in the api (#1206)
This adds a new check to doclint for whether a member is correctly marked as optional. 
part of #6
2020-03-03 17:29:12 -08:00
Andrey Lushnikov 019eaa4470 chore(ci): different attempt to publish on Travis 2020-03-02 19:00:47 -08:00
Andrey Lushnikov 01888897b7 chore(ci): fix publish_all_packages.sh on travis 2020-03-02 18:53:57 -08:00
Andrey Lushnikov 64e5e213d8 chore(ci): forcefully login NPM on CI if NPM_AUTH_TOKEN is set 2020-03-02 18:38:39 -08:00
Andrey Lushnikov a40f562662 chore(ci): add debug info for publish_all_packages 2020-03-02 18:35:04 -08:00
Andrey Lushnikov 497a74d8e2 chore(ci): fix publishing @next on travis 2020-03-02 18:26:45 -08:00
Andrey Lushnikov 62e2570e67 chore: fix utils/apply_next_version.js 2020-03-02 18:17:16 -08:00
Andrey Lushnikov 57c45f0d1f
fix: properly publish all packages on travis (#1187) 2020-03-02 17:40:48 -08:00
Pavel ba06fb2f0d test: mark some tests as skipped 2020-03-02 14:57:54 -08:00
Pavel Feldman 5bd6e4970b
test: it.skip skips and it.fail expects to fail now (#1178) 2020-03-02 13:47:08 -08:00
Pavel Feldman cbf65a9c56
test: chain test modifiers (#1175) 2020-03-02 11:18:42 -08:00
Andrey Lushnikov b20b323106 chore(ci): another attempt to program in .travis.yml 2020-02-28 16:17:59 -08:00
Dmitry Gozman ac2f04f10f
api(selectors): pass selector name when registering, allow file path (#1162) 2020-02-28 15:34:07 -08:00
Andrey Lushnikov d511d7dd99 chore(ci): use TRAVIS_NEXT_NUMBER instead of Date.now() 2020-02-28 15:20:07 -08:00
Dmitry Gozman c4f55bf22c
chore: guide for producing release notes (#1165) 2020-02-28 14:40:50 -08:00
Andrey Lushnikov 9b51febf50
feat: setup continuous deployment (#1159)
This patch sets continuous deployment of playwright packages
from tip-of-tree. These packages are released under the "@next",
so it should be possible to install tip-of-tree version of Playwright
from NPM using

```
npm i playwright@next
```

A few technical details:
- This uses travis to drive deployments
- This deploys from master and only if all browsers pass all tests on linux
- This is an attempt to deploy just two packages: `playwright-core` and `playwright-firefox`. If this works out, I'll follow-up with other packages as well
2020-02-28 11:02:42 -08:00
Joel Einbinder b50e8b377f
chore: fix doclint tests (#1098)
This fixes the doclint tests so that `npm test` works. It also adds all the browsers to npm test.

Fixes #8
2020-02-24 18:24:02 -08:00
Andrey Lushnikov 0ded511d0b
feat(testrunner): better matchers (#1077)
This patch re-implements matching and reporting for test runner.
Among other improvements:
- test failures now show a short snippet from test
- test failures now explicitly say what received and what was expected
- `expect.toBe()` now does text diff when gets strings as input
- `expect.toEqual` now does object diff
2020-02-20 22:55:39 -08:00
Andrey Lushnikov 53a7e342e9 fix(testrunner): support throwing non-errors 2020-02-20 17:06:05 -08:00
Andrey Lushnikov 8487ef2821
feat(testrunner): add DEBUG to testrunner (#1014)
The plan is to collect logs for the whole test run and upload it later on
using https://github.com/actions/upload-artifact

Produced log size:
- 163MB (8.5MB zipped) for Chromium: `DEBUG=* npm run unit 2>log`
- 135MB (4.8MB zipped) for WebKit: `DEBUG=*,-pw:wrapped* npm run wunit 2>log`
- 29MB (4.0MB zipped) for Firefox: `DEBUG=* npm run funit 2>log`
2020-02-14 15:21:08 -08:00
Andrey Lushnikov d29625c281
chore: generate browser versions when doing release (#999)
This introduces a handful of new markdown preprocessor commands to
insert browser versions:
- `GEN:chromium-version-if-release` - inserts current Chromium version
  if we're doing release; noop otherwise.
- `GEN:firefox-version-if-release` - inserts current Firefox version
  if we're doing release; noop otherwise.

And to generate badge links:
- `GEN:chromium-version-badge-if-release` - inserts current Chromium version
  badge if we're doing release; noop otherwise.
- `GEN:firefox-version-badge-if-release` - inserts current Firefox version
  badge if we're doing release; noop otherwise.

This doesn't touch webkit at all - we're yet to figure what to do with
webkit version.

NOTE: versions will be updated only once we release. This way our
README.md always represents last released version.
2020-02-13 18:26:38 -08:00
Joel Einbinder 251ad38824
fix(navigations): remove LifecycleWatcher, fix flakes (#882) 2020-02-10 18:35:47 -08:00
Joel Einbinder c03e8b7946
chore(tests): add types for tests (#915)
I enabled vscode autocomplete in our test files. Typechecking had too many errors to enable, but it caught some real bugs that I will fix in a follow up.

This patch contains:
* `test/types.d.ts` - d.ts file for our test runner.
* `test/tsconfig.json` - typescript project for our tests.
* JSDoc header in all specs to mark the describe as a TestSuite
* Drive-by fix of a launcher test that was using `if` instead of `it`
* Some drive-by fixes of unimpactful typos in tests.
2020-02-10 13:20:13 -08:00
Andrey Lushnikov 4fcc63f2e1 chore: remove usages of mime module from infrastructure
Follow-up to 4d84e35096
2020-02-10 11:26:08 -08:00
Andrey Lushnikov f4734ef570 feat(testrunner): show workerId in verbose mode 2020-02-07 17:16:31 -08:00
Joel Einbinder ffc1022717
fix(doclint): fix doclint for new typescript (#879)
Some types now have `innerTypeNames.length === 0`. Fun!
2020-02-06 16:26:36 -08:00
Pavel Feldman 99d06892c5
tests: explicitly close contexts for browser.newPage (#875) 2020-02-06 15:18:07 -08:00
Andrey Lushnikov cd68619786 chore: fix protocol-types-generator to work with new API
Follow-up to a2ab645e63
2020-02-05 16:51:16 -08:00
Pavel Feldman 55b6fe241e
feat(launch): introduce client, server & persistent launch modes (3) (#854) 2020-02-05 16:36:36 -08:00
Pavel Feldman a2ab645e63
feat(launch): introduce client, server & persistent launch modes (2) (#840) 2020-02-05 12:41:55 -08:00
Andrey Lushnikov 0f1a42a5d3 docs(readme): fix API link to always point to last released API 2020-02-05 12:05:36 -08:00
Pavel Feldman 0518625dcc
feat(launch): introduce client, server & persistent launch modes (1) (#838) 2020-02-04 19:41:38 -08:00
Andrey Lushnikov 7128628d70 feat(testrunner): ability to repeat test suites (#681)
Now you can `fdescribe.repeat(10)` to repeat test suites.
2020-01-27 12:48:11 -08:00
Pavel Feldman 5a5016fa7d docs: inline superclass toc into classes for convenience (#663) 2020-01-27 10:05:04 -08:00
Yury Semikhatsky b64604c1ea
chore: replace pptr with pw (#643) 2020-01-24 16:15:41 -08:00
Joel Einbinder ff877014cd
doc(troubleshooting): add note about lack of node 8 support (#623) 2020-01-24 09:04:54 -08:00
Dmitry Gozman 056fbbd53e
fix(api): make pipe connection the default, expose webSocket launch option (#562) 2020-01-23 17:45:31 -08:00
Joel Einbinder 3b2993ffe9 fix(docs): add back troubleshooting.md (#605)
This is mostly copied from Puppeteer's troubleshooting.md, with everything under a Chromium header and a few tweaks to make things make sense for Playwright.

We can add other browsers to this document once we figure out how to troubleshoot them.

Fixes #583
2020-01-23 15:54:09 -08:00
Dmitry Gozman ac2ba3cbd9
fix(api): BrowserServer -> BrowserApp, resuse it between browsers (#599) 2020-01-23 14:40:37 -08:00
Dmitry Gozman fa2f321fdd
fix(api): remove BrowserServer.connect (#574) 2020-01-23 08:51:43 -08:00
Andrey Lushnikov 710554bff5
feat(testrunner): add it.repeat to repeat test multiple times (#568) 2020-01-22 15:31:52 -08:00
Andrey Lushnikov eab8f92ac8 docs: create a single top-level TOC for api.md (#561)
This patch:
- creates a single top-level TOC for api.md
- adds a TOC for each class in the api.md
2020-01-22 12:21:45 -08:00
Joel Einbinder 4573cd3fec chore(packages): copy readme from root folder into packages/playwright (#552) 2020-01-21 17:24:47 -08:00
Joel Einbinder fa1d286d56
chore: npm packages (#525)
## playwright-chromium
- installs chromium
- exposes chromium api from playwright-core

## playwright-firefox
- installs firefox
- exposes firefox api from playwright-core

## playwright-webkit
- installs webkit
- exposes webkit api from playwright-core

## playwright-core
- downloads no browsers
- contains all of the js code
- designed for internal use

## playwright
- downloads all browsers
- exposes the entire api from playwright-core

## github
- downloads all browsers, generates protocol definitions, builds typescript
- exposes "playwright-core" api
2020-01-21 12:22:17 -08:00
Pavel Feldman 80c3b46a54
feat(websockets): implement support for ws on cr/wk (#542) 2020-01-21 11:48:48 -08:00
Yury Semikhatsky fc9ddb7c3c chore(webkit): simplify session init logic (#523)
* chore(webkit): simplify session init logic

* update remaining license headers
2020-01-17 14:02:57 -08:00
Andrey Lushnikov e03f1e4c2c feat(firefox): roll firefox to r1012 (#493)
This roll puts Firefox protocol types under related protocol domains,
so protocol type generator had to be updated as well.
2020-01-14 15:32:31 -08:00
Dmitry Gozman 5b1aef4c20 api: remove BrowserFetcher from api, update docs (#487) 2020-01-14 10:07:26 -08:00
Dmitry Gozman fb1b3d9a89 chore: finish strict type checks across src (#482) 2020-01-13 22:08:35 -08:00
Dmitry Gozman b388722777
chore: update top-level api (#479)
```
require('playwright').chromium.launch(...)
window.playwrightweb.chromium.connect(...)
```
2020-01-13 17:36:46 -08:00
Andrey Lushnikov 98bf9ac1d5
fix(testrunner): return correct exit code (#474) 2020-01-13 15:30:16 -08:00
Yury Semikhatsky 778ab3deff chore: replace CHROME with CHROMIUM (#465) 2020-01-13 10:13:28 -08:00
Dmitry Gozman c77fd5e6cb
feat(pw-web): generate playwright/web.js which can be used in the browser (#455) 2020-01-10 16:03:10 -08:00
Andrey Lushnikov 02c504ca59
feat(testrunner): "sourcemapify" crash error stacktraces (#441)
Whenever test runner crashes due to UnhandledPromiseRejection, the
related error should be run through "sourcemap decoding".
2020-01-09 16:37:19 +00:00
Dmitry Gozman 57c3916b0c
docs: support interfaces in doclint (#420) 2020-01-08 14:04:33 -08:00
Andrey Lushnikov a18777673e
devops(testrunner): support source maps (#340)
This patch adds a basic source map support to test runner.

SourceMap support is powered by Chromium DevTools source map
implementation (thus copyright). Unlike popular `source-map` npm
module, it's sync and pretty straight-forward.

The `SourceMap.js` file has a few modifications wrt upstream
Chromium version:
- reverse mappings API is removed. There's no need to ever compute them
- the `upperBoundary` function from DevTools' platform is inlined
2020-01-08 16:16:54 +00:00
Dmitry Gozman 6318b1de75 chore: move server-side code to src/server (#411) 2020-01-07 15:27:45 -08:00
Pavel Feldman e0693654b7 docs: do not yell at templated types in doc lint (#409) 2020-01-07 14:19:58 -08:00
Dmitry Gozman 9c966c8b19
feat(pw-web): introduce platform.ts to absract between node and browser platforms (#392) 2020-01-07 11:55:24 -08:00
Arjun Attam 562e6f5fe1 chore(license): use Apache 2.0 (#389) 2020-01-06 18:22:35 -08:00
Dmitry Gozman 04bf728364 test: make network cache test pass on all browsers (#374) 2020-01-03 15:34:51 -08:00
Joel Einbinder c749b7151b fix(install): don't crash generating chrome protocol (#342) 2019-12-28 16:38:37 -08:00
Pavel Feldman 0ffc9fd4f5 docs: more iterations on the docs 2019-12-20 20:28:35 -08:00
Pavel Feldman 8f480a3987 docs: more docs update (#327) 2019-12-20 16:57:21 -08:00
Pavel 2673ea90d9 doc: more documentation fixes 2019-12-20 15:26:18 -08:00
Pavel Feldman ad22a46fde
feat: move permissions back into the context (#320) 2019-12-20 13:07:14 -08:00
Pavel ae86a0be17 docs: started working on the api.md 2019-12-19 18:03:52 -08:00
Andrey Lushnikov a7f3490e48 feat(testrunner): implement "dit" command (#312) 2019-12-19 16:47:35 -07:00
Pavel Feldman 331f0e603a feat: introduce BrowserServer (#308) 2019-12-19 14:51:49 -08:00
Andrey Lushnikov 2acf36debc
fix(testrunner): xdescribe.skip should be a no-op 2019-12-19 00:46:03 -08:00
Pavel Feldman d570fc7809
feat: further strip the browser api (#304) 2019-12-18 18:07:11 -08:00
Andrey Lushnikov 8cc682c7b8 feat(testrunner): allow focusing all tests in a file
With this change, exporting a "fdescribe" function from a file
will focus all tests inside the file.
2019-12-18 17:13:39 -08:00
Andrey Lushnikov 44b39bad33 fix(testrunner): show maximum 10 skipped tests in test report
This is to save some terminal screen real estate.

Drive-by: remove async test suites from test runner.
2019-12-18 14:33:46 -08:00
Andrey Lushnikov 5d47a38c18 fix(testrunner): fix stack formatting 2019-12-18 13:55:28 -08:00
Dmitry Gozman 48be99a56e feat(selectors): add id selectors (#270) 2019-12-16 20:49:18 -08:00
Dmitry Gozman 59b0900321
feat(selectors): introduce zs selector engine (#214) 2019-12-12 09:02:37 -08:00
Dmitry Gozman f1f9dc166b
chore: remove unneeded files, reuse events between browsers, no implicit any (#191) 2019-12-10 11:15:14 -08:00
Joel Einbinder 57313e3f73
feat: basic d.ts file (#161)
`protocol.d.ts` had to move to `protocol.ts` otherwise typescript refuses to include it in the out directory.

Removed the old d.ts generator. It will need to be rewritten anyway.

These new types include private stuff that they probably shouldn't, and are missing documentation. I'll follow up with a better d.ts generator later.

#6
2019-12-06 11:28:23 -08:00
Dmitry Gozman d4f0084f67
chore: move element coordinates handling to common (#139)
Browser now implement boundingBox(), contentQuads() and layoutViewport().
2019-12-05 09:54:50 -08:00
Pavel Feldman e1c4eaae28
chore: make targets chromium feature (#137) 2019-12-04 16:12:43 -08:00
Dmitry Gozman fc5898892b
feat(selectors): support optional "visible" property in all selectors (#129) 2019-12-04 13:11:10 -08:00
Joel Einbinder 492f539310
chore(firefox): lint against the juggler protocol (#94) 2019-12-04 10:33:29 -08:00
Dmitry Gozman e124d44a55 chore: rework wait task to accept arbitrary task on dom world (#126) 2019-12-03 11:51:41 -07:00
Dmitry Gozman 8efd258e40
chore: encapsulate dom-related logic to DOMWorld, part 1 (#112) 2019-11-28 12:50:52 -08:00
Pavel Feldman 991f4a9072
docs: fix the docs validator (#86) 2019-11-26 08:52:47 -08:00
Dmitry Gozman 025c1fc7bc feat(engines): introduce xpath engine, switch $x to use it (#64) 2019-11-22 17:27:09 -08:00
Pavel Feldman ef464e447f
feat(input): dblclick/trippleclick feature parity (#60) 2019-11-22 14:46:34 -08:00
Dmitry Gozman 7783400156 feat(select): allow to select options by value/label/id/index (#46) 2019-11-21 21:19:21 -08:00
Joel Einbinder 6fcb4d2f30 feat: remove all environment variables and references to puppeteer-core (#47)
* feat: remove all environment variables and references to puppeteer-core

* fixup install
2019-11-21 21:17:23 -08:00
Pavel Feldman f223a98e3d
feat(chromium): roll Chromium to r717627 (#49) 2019-11-21 21:16:00 -08:00
Pavel Feldman e3dcac1d46
chore: move interception API into features/ (#43) 2019-11-21 14:41:38 -08:00
Andrey Lushnikov 43836c9178 Revert "docs: show browser test stats in the readme (#24)"
This reverts test stats from the README.md
The stats now leave in a designated status page.
2019-11-21 13:00:48 -08:00
Pavel Feldman f9a89eb313 chore: split vendor APIs (#38) 2019-11-20 15:16:57 -08:00
Joel Einbinder 0a8d55d954 docs: show browser test stats in the readme (#24) 2019-11-19 16:30:24 -08:00
Pavel Feldman 60f332d01b
doc: fix doc linter (#2) 2019-11-19 13:59:52 -08:00
Pavel Feldman 9ba375c063 Initial commit 2019-11-19 10:58:15 -08:00