Commit graph

2118 commits

Author SHA1 Message Date
Pavel Feldman 67f5fb6a4f
fix(webkit): add libevdev dep (#7630) 2021-07-14 20:20:03 -07:00
Pavel Feldman 3eb21e2322
feat(webkit): roll to r1515 (#7625) 2021-07-14 18:43:51 -07:00
Dmitry Gozman bb34d7a953
fix(test-runner): sanitize snapshot name before constructing a path (#7620)
This avoids problems with `toMatchSnapshot('../../dir/file.png')`
where we append this path to `snapshotDir` and end up in some random
place.

Also added a note to documentation.
2021-07-14 16:31:19 -07:00
Max Schmitt 6cc2fe178e
feat(test-runner): migrate to launch config/server (#7603) 2021-07-15 01:19:45 +02:00
Max Schmitt a26fe65db3
fix(test-runner): start webServer before globalSetup/teardown (#7604) 2021-07-14 19:01:46 +02:00
Dmitry Gozman d1170b30fc
Revert "api: remove timeout option from isVisible and isHidden methods (#7414)" (#7600)
This reverts commit 9f71c96740.
2021-07-14 10:46:00 +02:00
Dmitry Gozman 0742cb9076
chore: move working with browser channels to Registry Executables (#7581) 2021-07-13 19:03:49 -07:00
Dmitry Gozman 57c5e4d8cf
chore: replace Registry api with Executable list (#7544) 2021-07-13 15:57:40 -07:00
Max Schmitt 767e22c6b2
fix(network): process last inserted routes first in request interception (#7585) 2021-07-13 20:22:01 +02:00
Alex Plischke 27d89732ce
Use correct skip check when generating junit reports (#7571) 2021-07-13 05:05:34 -07:00
Joel Einbinder 9264a8d5b1
fix(chromium): disable use-zoom-for-dsf (#7407) 2021-07-12 22:56:00 -05:00
Joel Einbinder eb31b9e4a9
feat(test-runner): support esm modules in more places (#7542) 2021-07-12 11:59:58 -05:00
Dmitry Gozman 65606c093a
chore: simplify Registry api (#7451) 2021-07-09 16:10:23 -07:00
Max Schmitt 894ff15e65
Revert "chore(eval): merge internal evaluate functions (#7517)" (#7535)
This reverts commit 7a5ef0d157.
2021-07-09 16:19:42 +02:00
Joel Einbinder 7a5ef0d157
chore(eval): merge internal evaluate functions (#7517) 2021-07-08 23:55:01 -07:00
Dmitry Gozman 77deca1d6b
feat(test runner): export testInfo.data (#7525)
This is a key-value storage for any information that goes into the report.
Also export JSONReport types.
2021-07-08 17:16:36 -07:00
Max Schmitt e604f185ca
fix(test-runner): with automatic fixtures workerInfo was undefined after conditional skip (#7521) 2021-07-08 21:55:43 +02:00
Yury Semikhatsky b2742976a8
fix(runner): do not restart worker after skipping tests (#7511) 2021-07-08 09:36:28 -07:00
Max Schmitt ae489b1c43
fix(test-runner): do not override error with unhandled error (#7507) 2021-07-08 18:24:07 +02:00
Max Schmitt 1cc2a2dc59
feat(har): add bodySize, transportSize, headersSize (#7470)
Co-authored-by: tnolet <tim@checklyhq.com>
2021-07-08 18:22:37 +02:00
Dmitry Zakharov 5464ad849e
fix(test-runner): handle negated toMatchSnapshot result (#7345) 2021-07-07 18:51:38 -07:00
Max Schmitt 08da9d207e
chore: move processLauncher into src/utils (#7504) 2021-07-07 21:14:16 +02:00
Dmitry Gozman 2073193c36
fix(test runner): keep track of remaining tests on the runner side (#7486)
This fixes two issues:
- Sudden worker process exit is properly accounted for.
- We can stop() workers willy-nilly, e.g. after reaching maxFailures.

Details:
- DonePayload does not send `reamining` anymore, and worker does not track it.
- Instead, `Dispatcher._runJob` track remaining tests and acts accordingly.
- Upon worker exit, we emulate a fatal error for all remaining tests.

Drive-by:
- Do not report onTestBegin after reaching maxFailures to avoid confusion.
  Before, we did report onTestBegin, but not onTestEnd.
- List reporter aligned between "running" and "finished" state - it was
  one character misplaced.
- Added a SIGINT test.
2021-07-07 12:04:43 -07:00
Max Schmitt 98bcf26656
feat(test-runner): add webServer (#7368) 2021-07-07 20:19:42 +02:00
Max Schmitt ee0497c725
chore: do not log process not found warning on win when PID is not found (#7500) 2021-07-07 19:40:09 +02:00
Dmitry Gozman 47885db116
chore: move install to Registry (#7433)
This is an effort to consolidate all handling of browser binaries in a single place.
2021-07-06 20:59:16 -07:00
Max Schmitt 371aa3dab2
feat: add browser.newContext({ baseUrl }) (#7409) 2021-07-06 21:16:37 +02:00
Max Schmitt b846ddda04
feat(download): introduce Download.cancel (#7462) 2021-07-06 09:38:50 +02:00
Max Schmitt 2231992d74
feat(webkit): roll to 1507 (#7463) 2021-07-05 12:49:31 +02:00
Yury Semikhatsky 02ff213d4d
feat(webkit): intercepted response body (#7229) 2021-07-05 00:27:14 -07:00
Pavel Feldman f52a53e21e
feat(trace-viewer): add nicer params rendering (#7448) 2021-07-02 16:45:09 -07:00
Dmitry Gozman 444d1eb51a
feat(test runner): run modifier functions once if they do not depend on test fixtures (#7436) 2021-07-02 15:49:05 -07:00
Pavel Feldman 99d7d196c5
feat(trace-viewer): render call info w/ params, result (#7438) 2021-07-02 14:33:38 -07:00
Andrey Lushnikov ec8d0629f3
feat: support msedge-beta channel (#7442)
Fixes #7232
2021-07-02 12:55:46 -07:00
Dmitry Gozman 040d81052a
fix(cli): do not suggest internal tools in install command (#7437) 2021-07-02 11:22:26 -07:00
Andrey Lushnikov fe32d38414
feat: move browser fonts to tools section (#7443)
This way we not only fix Docker images, but also fix `npx playwright
install-deps` in virtual machines.
2021-07-02 02:09:31 -07:00
Pavel Feldman 82b21e912e
feat(trace-viewer): add error links to actions (#7434) 2021-07-01 20:46:56 -07:00
Dmitry Gozman 4c7343fe96
chore: move installDeps to Registry (#7431)
This is an effort to consolidate all handling of browser binaries in a single place.
2021-07-01 17:14:04 -07:00
Pavel Feldman e19d509c32
feat(icon): add an icon for trace viewer (#7430) 2021-07-01 17:05:14 -07:00
Dmitry Gozman d46eae44d1
chore: move validateHostRequirements to Registry (#7428)
This is an effort to consolidate all handling of browser binaries in a single place.
2021-07-01 16:17:59 -07:00
Pavel Feldman 8fb0454488
fix(trace-viewer): fall back to stable channels (#7429) 2021-07-01 15:26:55 -07:00
Pavel Feldman b9b0faf120
feat(trace-viewer): render console messages (#7418) 2021-07-01 14:31:20 -07: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
Max Schmitt dc1e5638bb
feat(webkit): roll to 1505 (#7421) 2021-07-01 19:26:02 +02:00
Max Schmitt b5d134d45b
feat(firefox): roll to 1271 (#7419) 2021-07-01 18:52:14 +02:00
Max Schmitt 027fc4c0b4
chore: hide request interception for 1.13 (#7425) 2021-07-01 18:33:47 +02:00
Pavel Feldman 9c3ae38914
fix(chromium): disable the new broken upstream feature (#7416) 2021-07-01 07:49:49 -07:00
Pavel Feldman f43b4efbc9
fix(trace-viewer): include waitFor* in trace viewer (#7413) 2021-06-30 17:56:48 -07:00
Dmitry Gozman 63e6e530ca
fix(launch): replace 'npm install playwright' with 'npx playwright install' (#7410)
... in the error message
2021-06-30 16:31:55 -07:00
Anirudh Modi 8f2bfed659
feat: added more logging info for $ (#7344) 2021-06-30 11:17:09 -07:00
Pavel Feldman e9246089d5
test(trace-viewer): start adding tests (#7393) 2021-06-29 22:35:50 -07:00
Joel Einbinder a1f9fc3f32
fix(test runner): properly match test suffix (#7392) 2021-06-29 17:49:56 -07:00
Dmitry Gozman fc0b8ad3f0
fix(tracing): record scroll position for all scrolled elements (#7388) 2021-06-29 16:20:15 -07:00
Joel Einbinder 7629587914
fix(test-runner): work with .mjs files (#7373) 2021-06-29 15:28:41 -07:00
Pavel Feldman b1d66d54f0
fix(tracing): explicitly list actions to snapshot (#7376) 2021-06-29 15:28:15 -07:00
Dmitry Gozman 3ce1f5c33e
chore: avoid execSync when determining hostPlatform (#7386) 2021-06-29 13:39:30 -07:00
Dmitry Gozman 6b3614fd4c
feat(test runner): support test.setTimeout for the whole block (#7387)
This enables `test.setTimeout()` outside of the test body, that
affects all tests in the block (either file or describe).
2021-06-29 13:33:13 -07:00
Joel Einbinder 368880962f
fix(test-runner): better test match glob (#7382) 2021-06-29 11:49:50 -07:00
Dmitry Gozman 6aefa02e91
feat(test runner): improve reporters api (#7370)
- onEnd may return a Promise
- onEnd now takes a result for the full run
- onTimeout is replaced with onEnd(result)
2021-06-29 10:55:46 -07:00
Pavel Feldman 7062278265
fix(trace): copy cached resources on write (optimization) (#7372) 2021-06-28 22:01:08 -07:00
Dmitry Gozman 1660334357
feat(install): docs and help (#7365)
Drive-by: remove test-intro and references to it.
2021-06-28 18:50:24 -07:00
Dmitry Gozman 530523cb67
feat(setInputFiles): support label retargeting (#7364)
This way `page.setInputFiles('label')` works, similarly to other input actions.
2021-06-28 14:18:01 -07:00
Pavel Feldman a8d48a1a48
chore: remove hard-coded wrapApi names (#7347) 2021-06-28 13:27:38 -07:00
Max Schmitt 0776cf76a2
feat(test-runner): do only allow unique spec titles per suite (#7300) 2021-06-28 22:13:35 +02:00
Max Schmitt 9f9201420a
fix(websockets): filter for text and binary frames (#7360) 2021-06-28 21:23:29 +02:00
Ronie Martinez 409aeaa443
feat(codegen): Add type annotations to Python output and make PEP8-compliant (#7337) 2021-06-26 13:11:32 -07:00
Pavel Feldman 02538fb587
fix(trace): account for last child node removal (#7332) 2021-06-25 18:52:36 -07:00
Pavel Feldman ec47b03722
fix(trace): show interrupted actions in trace (#7329) 2021-06-25 17:14:19 -07:00
Andrey Lushnikov 1157f622f3
fix(test-runner): default @playwright/test timeout to 0 (#7312)
All actions for the `@playwright/test` actions inside test should
have default 0 timeout. This way they will never clash with the
test timeout.
2021-06-24 23:28:01 -07:00
Max Schmitt 908ad6921f
fix(test-runner): make it compatible when running as a sub-process (#7298)
Works around the following bug: https://github.com/nodejs/node/issues/12921
2021-06-25 00:54:06 +02:00
Max Schmitt 4c6deaa449
test: added tests for WebSocket over Socks proxy (#7235) 2021-06-24 18:50:16 +02:00
Pavel Feldman e6bf0a07fe
feat(force): add fill, selectOption, selectText ({force}) (#7286) 2021-06-24 08:18:09 -07:00
Max Schmitt bd86e70465
feat(test-runner): allow to focus a test in a location (#7208) 2021-06-24 10:02:34 +02:00
Pavel Feldman 5732307280
feat(inputValue): implement *.inputValue() (#7285) 2021-06-23 22:19:20 -07:00
Joel Einbinder 1a6d46d844
chore(typescript): compile with babel, lint everything with tsc (#6872) 2021-06-23 18:01:48 -07:00
Dmitry Gozman 4c6fa42810
fix(test runner): expose real stack traces and speed up locations (#7265)
Stop wrapping/prepending error messages so that we do not loose the stack trace. For this, update a few manually thrown errors with better messages (usually including a file path).

Speed up locations by doing manual `sourceMapSupport.wrapCallSite()` for a single call site. Performance gain in the runner process with 100 files x 100 tests each:
- 25% on the fresh run without babel cache;
- 80% on the cached run where babel is almost instant.

Also some obvious cleanups around stack traces (removing unused code).
2021-06-23 10:30:54 -07:00
Max Schmitt 103f8ddd06
Revert "chore: update eslint config (#6840)" partly (#7268)
This reverts commit ec7d37d92f.
2021-06-23 11:08:35 +02:00
Max Schmitt 99bbc51760
fix(test-runner): support ANSII terminals with list reporter (#7258) 2021-06-22 19:04:24 +02:00
Dmitry Gozman 73a43fce60
chore(test runner): self profile under PWTEST_PROFILE_DIR (#7252)
`PWTEST_CLI_ALLOW_TEST_COMMAND=1 PWTEST_PROFILE_DIR=./profile node lib/cli/cli.js test -c <dir/config>`
2021-06-21 14:49:43 -07:00
Max Schmitt 143689e34f
fix: Jest isError handling to work with TypeError (#7251) 2021-06-21 21:48:24 +02:00
Dmitry Gozman 6118d16edd
fix(test runner): properly keep track of requireFile to support helpers/wrappers (#7243)
This fixes an issue where we incorrectly labeled and assigned ids for tests
that declared tests in require'd files or used test wrappers.
See new tests for examples.
2021-06-21 11:25:15 -07:00
Max Schmitt 590184998f
chore: improve connectOverCDP error handling (#7239) 2021-06-21 19:57:00 +02:00
Pavel Feldman ea4eebeb2d
feat(test-runner): document tagging, implement grep-invert (#7227) 2021-06-18 17:56:59 -07:00
Yury Semikhatsky c0cd2d4579
feat: response interception (#7122) 2021-06-18 11:04:48 -07:00
Yury Semikhatsky 79b2e5ddeb
feat(webkit): bump to 1500 (#7224) 2021-06-18 10:20:09 -07:00
Dmitry Gozman 388c6f5196
feature(test runner): capture error and pending calls when timing out (#7193) 2021-06-17 15:09:38 -07:00
Max Schmitt 5bf69b667e
fix(test-runner): allow additional params when pw-test is not installed (#7200) 2021-06-17 13:40:49 -07:00
Ross Wollman 219e5138be
feat(response): expose connection details in API (#7150) 2021-06-17 13:04:55 -07:00
Dmitry Gozman 5e471a3ece
feat(test runner): add type to TestInfo.error (#7207)
It has a very special `TestError` type, but we say it's `any` for some reason.
2021-06-17 12:14:28 -07:00
Joel Einbinder 10a82f862c
fix(snapshotter): support constructed CSSStyleSheet
Fixes #7085
2021-06-17 09:41:29 -07:00
Pavel Feldman 82a50b0e1d
fix(test-runner): property handle artifacts in context of preserveOutput (#7181) 2021-06-16 16:05:30 -07:00
Andrey Lushnikov 0cfea9a623
feat(chromium): roll to r891964 (#7185) 2021-06-16 16:00:54 -07:00
Pavel Feldman 184f2c2e93
feat(test-runner): allow specifying video size (#7158) 2021-06-16 07:51:54 -07:00
Andrey Lushnikov a3e4185b2f
chore: nuke 'webkit-technology-preview' experiment (#7164)
It proved to be unmaintainable due to the following reasons:
- determining upstream branch for the technology preview was a manual
and tedious process
- once determined, actual Safari Technology Preview occasionally
diverted from the branch
2021-06-15 23:58:30 -07:00
Andrey Lushnikov ec68b31dc4
feat: support chromium-with-symbols channel (#7135)
References #7130
2021-06-15 17:57:31 -07:00
Joel Einbinder 38e27c9c6c
fix(test-runner): case insensitive test filtering 2021-06-15 17:27:52 -07:00
Yury Semikhatsky e5d0a535a8
fix: return valid browser from context.browser() when connect over CDP (#7155) 2021-06-15 16:06:38 -07:00
Dmitry Gozman b74ca36fb3
chore: create Selectors for each Playwright object (#7154)
We currently have singleton `serverSelectors` that is shared between
the real Playwright and internal Playwrights.
2021-06-15 14:56:29 -07:00
Joel Einbinder 4c2a3fb443
fix(test-runner): accept relative paths for outputDir (#7149)
fixes #7124
2021-06-15 13:39:07 -07:00
Pavel Feldman 9550106e1d
fix(test-runner): video: 'retain-on-failure' leaves empty folders behind (#7125) 2021-06-15 10:06:49 -07:00
Ross Wollman 195eab8787
feat(har): record remote IP:PORT and SSL details (#6631) 2021-06-15 09:48:08 +02:00
Dmitry Gozman 742cce3a1d
feat(test runner): configurable reportSlowTests (#7120)
Also splits tests by projects and reports them with nice relative paths.
2021-06-14 22:45:58 -07:00
Joel Einbinder aa72b2b9bb
fix(pwt): max-failures should work with retries (#7127)
fixes #7112
2021-06-14 22:16:16 -07:00
Dmitry Gozman 2041aab010
fix(chromium): background pages on persistent close error (#7118)
This is a speculative fix that moves "background pages cleanup"
to `_didCloseInternal` so that it is only run once, but on both
context closure and browser closure.

Symptom from a flaky test:

```log
browserContext.close: page@18087c372d32819222707ca5e8fd1030 is sending "close" event after being disposed
    at PageDispatcher._dispatchEvent (D:\a\playwright\playwright\src\dispatchers\dispatcher.ts:86:15)
    at Page.<anonymous> (D:\a\playwright\playwright\src\dispatchers\pageDispatcher.ts:59:12)
    at Page.emit (events.js:314:20)
    at Page._didClose (D:\a\playwright\playwright\src\server\page.ts:220:10)
    at CRPage.didClose (D:\a\playwright\playwright\src\server\chromium\crPage.ts:165:16)
    at CRBrowserContext._onClosePersistent (D:\a\playwright\playwright\src\server\chromium\crBrowser.ts:476:24)
    at CRBrowserContext.close (D:\a\playwright\playwright\src\server\browserContext.ts:288:20)
```
2021-06-14 21:55:55 -07:00
Pavel Feldman 970bb6a70d
feat(test-runner): allow setting pixel match threshold for project (#7123) 2021-06-14 21:52:10 -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 ad5280e5cb
fix(trace-viewer): display trace without viewport (#7101) 2021-06-14 17:11:30 +02:00
Peng-Yu Chen 5f6d4a7b73
feat(download): adding a new Download._cancel method (#6236) 2021-06-12 22:23:22 +02:00
Andrey Lushnikov 8a8b3932f8
Revert "fix(test-runner): support passing slowMo option (#6991)" (#7077)
This reverts commit 178489d091.

Reason for revert: this clashes with testrunner options.
2021-06-11 16:19:50 -07:00
Andrey Lushnikov d6831df26f
feat: roll Firefox to r1271 (#7067)
References #7015
2021-06-11 10:50:02 -07:00
Yury Semikhatsky c903b04c7a
feat(webkit): bump to 1499 (#7001) 2021-06-11 09:35:48 -07:00
Pavel Feldman 49a8f67c0f
fix(test-runner): resolve global hooks relative to the config dir (#7061) 2021-06-10 22:31:27 -07:00
Pavel Feldman cbce7cbdec
fix(tracing): do not stall on dialogs (#7059) 2021-06-10 22:24:04 -07:00
Pavel Feldman e4d93cd1f3
fix(video): do not fail when removing non-existent video (#7060) 2021-06-10 22:23:02 -07:00
Andrey Lushnikov f52290d4ea
Revert "feat: add defaultTimeout browser context configuration option (#6944)" (#7057)
This reverts commit 617dfdef9e.

It turns out this might conflict with our bright testrunner future.
2021-06-10 18:38:56 -07:00
Amit Abershitz 617dfdef9e
feat: add defaultTimeout browser context configuration option (#6944)
Fixes #6940

Co-authored-by: Amit Abershitz <aabershitz@proofpoint.com>
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2021-06-10 18:10:20 -07:00
Pavel Feldman 3b1bae8a40
feat(codegen): allow generating tests (#7049) 2021-06-10 16:52:59 -07:00
Max Schmitt 05382c997b
fix(test-runner): do only match JS/TS files when collecting (#7014) 2021-06-10 16:41:57 +02:00
Andrey Lushnikov 3c7d2aae6a
fix: add best-effort support for MacOS beta versions (#7003)
Similarly to how we provide best-effort support for non-LTS ubuntu
versions, this patch adds support for beta versions of MacOS releases.
2021-06-09 14:58:20 -07:00
Max Schmitt 178489d091
fix(test-runner): support passing slowMo option (#6991)
Fixes #6984
Reverts #6967
2021-06-09 14:02:05 -07:00
Pavel Feldman 19d69b792d
fix(tracing): do not merge srcset urls (#6995)
Fixes #6982
2021-06-09 12:05:21 -07:00
Joel Einbinder 6788b9cf8c
fix(@playwright/test): plumbing (#6992)
`npx playwright test` should find and forward to the @playwright/test package.
2021-06-09 11:18:32 -07:00
Pavel Feldman 521153844a
docs: fix the nunit example (#6978) 2021-06-08 19:14:18 -07:00
Dmitry Gozman ff3f951dc8
fix(firefox): race between markAsError and Page.ready (#6976)
When new page turns into download, we can have `_markAsError` followed
by the `Page.ready` signal and report the page twice (as an error and
as a real page). This is flaky and depends on whether `Page.ready` is
fast enough before the page closes or not.

Exposed by the "should report new window downloads" test.
2021-06-08 17:28:24 -07:00
Dmitry Gozman 6eeafc171b
fix(chromium): fix a race when intialization does not finish before page close (#6975)
This is exposed by the flaky "should report new window downloads" test.
In this test a new page is created, initialized and closed before initialization
finishes. If `lifecycleEventsEnabled` fails with "Target closed error",
we correctly ignore the initialization failure, but a single usage of the
failed promise with `.then` fails anyway.
2021-06-08 17:28:16 -07:00
Pavel Feldman 021f51cc1f
feat(trace): add a trace option into the test runner (#6961)
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2021-06-08 11:22:07 -07:00
Joel Einbinder 93f6b57ca5
feat(playwright-test): scan the world (#6935)
Running `npx playwright test` results in a cryptic error message that says to check `--help` for more information.

I started to rewrite it, but I think instead it would be much nicer if we just treated `npx playwright test` as an alias for `npx playwright test -c .`. There is a comment in the code that worries this will be slow because it will scan the world. However we need to support this case anyway for the tests-next-to-code pattern.

It looks like this should be fast because we ignore node_modules/.gitignore entries. If this is still too slow we should make it faster. If we can't make it faster we should throw a more specific error telling the user how to make it faster.
2021-06-08 11:02:16 -07:00
Andrey Lushnikov 53d68bdb38
feat: firefox is stable by default (#6953)
This patch:
- rolls Firefox to v1269 which is now a firefox-stable build.
- introduces a new channel, `firefox-beta`, for our internal needs.

Fixes #6817
2021-06-08 09:34:17 -07:00
Andrey Lushnikov 55da16d8cd
Revert "feat: switch to the Firefox Stable equivalent by default (#6926)" (#6947)
This reverts commit a25b11659be8887b700311180fcd3653aa9e472b.

In a discussion with Dmitry Gozman we decided to revert this and instead
proceed with the following approach:
- rename `//browser_patches/firefox` to `//browser_patches/firefox-beta`
- rename `//browser_patches/firefox-stable` folder to
  `//browser_patches/firefox`

In all of the folders, we will keep the `BUILD_NUMBER` original so that
it doesn't clash on the CDN.
2021-06-07 15:55:01 -07:00
Andrey Lushnikov a1e8d2d531
feat: switch to the Firefox Stable equivalent by default (#6926)
This patch:
- starts downloading Firefox Stable equivalent by default
- starts running Firefox-Stable on our smoke tests (tests-1)
- starts running Firefox-Beta on our CQ1 tests (tests-2)

Note: there's a little confusion right now with browser names:
- `firefox-stable` - firefox-stable equivalent
- `firefox`- firefox-beta equivalent

I'll rename `firefox` to `firefox-beta` in a follow-up.

Fixes #6817
2021-06-07 15:00:23 -07:00
Andrey Lushnikov d0eaec368b
chore: clarify that we download Playwright browser builds (#6938) 2021-06-07 14:16:42 -07:00
Joel Einbinder 8960584b78
fix(chromium): drag and drop works in chromium (#6207)
Waiting for #6203 to percolate to the cdn. But this all works locally.

Fixes #1094
2021-06-07 10:27:34 -07:00
Andrey Lushnikov cfd49b5c01
feat: support npx playwright install msedge (#6861) 2021-06-07 00:23:22 -07:00
Dmitry Gozman b556ee6f5b
chore: brush up playwright-test types (#6928) 2021-06-06 20:18:47 -07:00
Dmitry Gozman f745bf1fbc
chore: bring in folio source (#6923)
- Source now lives at `src/test`.
- Former folio tests live at `tests/playwright-test`.
- We use `src/test/internal.ts` that exposes base test without
  Playwright fixtures for most tests (to avoid modifications for now).
- Test types live in `types/testFoo.d.ts`.
- Stable test runner is installed to `tests/config/test-runner` during `npm install`.
- All deps including test-only are now listed in `package.json`.
  Non-test deps must also be listed in `build_package.js` to get included.
2021-06-06 17:09:53 -07:00
Dmitry Gozman 82041b2f74
test: roll to folio@0.4.0-alpha28 (#6918) 2021-06-04 20:54:58 -07:00
Dmitry Gozman 69b734629c
fix: various test-related fixes (#6916)
- Closing inspector window resumes the script.
- Replace FOLIO_WORKER_INDEX with TEST_WORKER_INDEX.
- Account for `@playwright/test` stack traces.
2021-06-04 18:43:54 -07:00
Dmitry Gozman a83646684a
fix(tracing): error handling (#6888)
- Reject when ZipFile signals an error.
- Make sure snapshotter does not save trace events after stop().
- Await pending blob writes on stop().
2021-06-04 14:52:16 -07:00
Max Schmitt ff3ad7a3d1
fix(android): to not call Browser.setDownloadBehavior (#6913) 2021-06-04 21:46:53 +02:00
Dmitry Gozman 233f1874da
feat(inspector): remove snapshots (#6909) 2021-06-04 10:47:19 -07:00
Yury Semikhatsky a96491cbbb
feat(downloads): subscribe to download events in Browser domain instead of Page (#6082) 2021-06-04 09:54:29 -07:00
Dmitry Gozman 21b00d0bcc
test: roll to folio@0.4.0-alpha27 (#6897) 2021-06-03 22:06:59 -07:00
Dmitry Gozman 85786b1a11
feat(trace viewer): fix UI issues (#6890) 2021-06-03 21:52:29 -07:00
Dmitry Gozman d4482f3ad3
chore: do not use Array.from in injected script (#6876)
This method is most often overridden by some bad polyfill that
does not work correctly and breaks `$eval` and `$$eval` methods.

As a best-effort fix, use a `[...iterable]` throughout the code.
2021-06-03 15:10:02 -07:00
Max Schmitt 064150f8dd
chore: use fs.promises API instead of promisify (#6871) 2021-06-03 18:55:33 +02:00
Dmitry Gozman 3de3a88930
feat(test): introduce npx playwright test (#6816) 2021-06-03 08:07:55 -07:00
Pavel Feldman b2143a951b
chore: make tracing zero config (#6859) 2021-06-02 22:00:34 -07:00
Dmitry Gozman 837ee08a53
fix(waitForSelector): retry when context is gone during node adoption (#6851)
There is a small window after finishing the "rerunnable task" where
we adopt the node to the main world and navigation could destroy the context.
2021-06-02 20:17:24 -07:00
Max Schmitt c09726b023
test: add tests for port-forwarding via playwrightclient (#6860)q 2021-06-03 02:19:01 +02:00
Max Schmitt e91e49e533
feat(port-forwarding): add playwrightclient support (#6786) 2021-06-02 23:35:17 +02:00
Dmitry Gozman 33c2f6c31e
chore: do not bundle api.json and protocol.yml (#6841)
These are only needed for the driver, so bundle them
in the driver explicitly.
2021-06-02 14:01:05 -07:00
Karan Shah 254ec155eb
feat(user-agent): Adding User-Agent in headers while making connection to browser (#6813) 2021-06-02 11:36:58 -07:00
Andrey Lushnikov 17b6f06b98
feat: install media pack on windows with npx playwright install-deps (#6836)
Chromium on Windows requires Media Pack to be installed. This patch
moves media pack installation under the `npx playwright install-deps`
umbrella.
2021-06-02 10:47:10 -07:00
Yury Semikhatsky 2fde9bc13f
fix(webkit): use new awaitPromise parameter instead of separate command (#6852) 2021-06-02 10:04:47 -07:00
Pavel Feldman d28f45b6ee
api(tracing): export -> stop({path}) (#6802) 2021-06-02 10:04:25 -07:00
Yury Semikhatsky f9c8b78c07
feat(webkit): bump to 1490 (#6842) 2021-06-02 09:08:55 -07:00
Andrey Lushnikov 919d258356
feat: support npx playwright install chrome (#6835)
This will install latest-and-greatest chrome stable.
2021-06-01 23:16:55 -07:00
Andrey Lushnikov cb4adb1446
feat: install chrome-beta via cli (#6831)
This patch starts introduces `npx playwright install chrome-beta`
command and switches our Chrome Beta tests to it.
2021-06-01 18:26:12 -07:00
Andrey Lushnikov 3c3a7f9293
feat(chromium): roll Chromium to r888113 (#6832)
References #6818, references #6390
2021-06-01 18:06:44 -07:00
Max Schmitt d79110dcc1
fix(port-forwarding): close socket on unexpected payloads (#6753) 2021-06-01 23:13:23 +02:00
Max Schmitt d21a72e7d5
chore: create new Playwright instance when launching server (#6820) 2021-06-01 21:21:24 +02:00
Joel Einbinder 2951f4b065
chore(evaluate): remove private _evaluateInUtility methods (#6815) 2021-06-01 08:36:16 -07:00
Pavel Feldman 9f3e66566b
fix(inspector): do not pause while recording (#6604) 2021-05-26 15:49:30 -07:00
Pavel Feldman 95bd4b315c
chore: fix codegen to emit new C# api (#6763) 2021-05-26 15:44:40 -07:00
Dmitry Gozman d36bffb9a9
fix(connect): respect timeout in all scenarios (#6762)
Drive-by: fix console error in test arising from bad usage
of test websocket server in `connect()` calls.
2021-05-26 15:18:52 -07:00
Andrey Lushnikov 3aa1471489
chore: better logging for Windows CrashPad problem (#6758)
References #6123
2021-05-26 10:49:38 -07:00
Max Schmitt 1d0cdb352d
chore(chromium): disable GlobalMediaControls feature (#6754) 2021-05-26 18:47:00 +02:00
Max Schmitt 1778e117f7
fix(port-forwarding): on WebKit Win (#6745) 2021-05-26 16:51:55 +02:00
Max Schmitt 59d591bce6
chore(port-forwarding): validate forwarded ports on the client side (#6756) 2021-05-26 16:51:38 +02:00
Pavel Feldman f7f08c9c02
api(dotnet): normalize enums, remove browser channel enum (#6738) 2021-05-25 14:33:27 -07:00
Dmitry Gozman 9dd2f83361
fix(codegen): update csharp boilerplate (#6742) 2021-05-25 10:59:17 -07:00
Max Schmitt 3f43db5cc4
feat(browserServer): forward local ports (#6375) 2021-05-25 17:11:32 +02:00
Anže Vodovnik 01d8f87923
chore(CLI): let other langs specify exec name (#6719) 2021-05-25 16:49:24 +02:00
Max Schmitt 39a8abd9ab
fix(install): prevent new-lines on CI/without TTY (#6703) 2021-05-25 07:10:45 +02:00
Max Schmitt ac0980e1ee
chore(linting): enable required semicolons rule in TS (#6701) 2021-05-24 00:09:46 +02:00
Max Schmitt ba29e99ace
feat: added reduced motion media query emulation (#6646) 2021-05-22 01:56:09 +02:00
Dmitry Gozman af2fec6bcf
fix(codegen): generate all options for java (#6698) 2021-05-21 16:17:25 -07:00
Dmitry Gozman f529f0a25d
fix(codegen): generate acceptDownloads option for download signals (#6697) 2021-05-21 15:08:39 -07:00
Andrey Lushnikov d1d49b3412
feat(chromium): roll Chromium to r884693 (#6686) 2021-05-21 11:05:44 -07:00
Dmitry Gozman e4946b79e6
fix(codegen): update csharp scripts to new syntax (#6685)
Drive-by: fix middle/right button clicks in codegen.
2021-05-20 15:47:14 -07:00
Max Schmitt 88591d49eb
feat(firefox): roll to 1265 (#6678) 2021-05-20 08:06:05 -07:00
Max Schmitt bae579440c
feat(webkit): roll to 1482 (#6676) 2021-05-20 09:27:31 +02:00
Yury Semikhatsky 2ef47b95f2
fix: wait for video to finish when persistent context closes (#6664) 2021-05-19 16:26:10 -07:00
Joel Einbinder 754ee13c93
feat(electron): accept BrowserContextOptions in electron.launch (#6621) 2021-05-19 06:56:29 -07:00
Yury Semikhatsky b94643786b
fix: wait for ffmpeg to finish writing even if page was closed (#6648) 2021-05-18 22:29:39 -07:00
Yury Semikhatsky 475a417dfc
fix: compute payload mime type on server (#6647) 2021-05-18 18:30:20 -07:00
Andrey Lushnikov 33a505b1e5
chore: add logging for installation steps (#6565)
This patch:
- adds debug logging
- sets up our workflows to use `DEBUG=pw:install` on CI
2021-05-18 17:38:02 -07:00
Andrey Lushnikov dc4f37c923
feat(chromium): roll Chromium to r879910 (#6635) 2021-05-18 17:36:50 -07:00
Yury Semikhatsky 345f7da573
fix(codegen): move injected recorder scripts to utility world (#6187) 2021-05-18 09:40:24 -07:00
Max Schmitt b52cbfdb16
fix(chromium): close background pages on close (#6608) 2021-05-18 18:07:45 +02:00
Max Schmitt 9592486225
feat: use up2date Chromium user-agents for device descriptors (#6594) 2021-05-18 09:29:48 +02:00
Yury Semikhatsky c4b7818379
feat(webkit): bindings in util world (#6592) 2021-05-17 11:32:29 -07:00
Yury Semikhatsky be8d836443
feat(webkit): bump to 1480 (#6605) 2021-05-17 09:38:04 -07:00
Pavel Feldman d7c6720ce7
chore: include context options into the trace (#6572) 2021-05-13 22:36:34 -07:00
Pavel Feldman 7b844c5fab
chore(tracing): simplify resource treatment (#6571) 2021-05-13 20:41:32 -07:00
Joel Einbinder 9b0aeeffae
fix(install-deps): install deps on mint (#6569) 2021-05-13 20:13:11 -07:00
Pavel Feldman 0678f48289
chore(tracing): trim network urls for readability (#6566) 2021-05-13 16:07:38 -07:00
Dmitry Gozman fbae295ce2
fix(har): save popup's main request/response (#6562)
This migrates server side code from networks events on the Page
to network events on the BrowserContext.
2021-05-13 15:02:10 -07:00
Sébastien Règne e87fbfcc1d
feat(download): add Page in Download (#6501) 2021-05-13 14:18:21 -07:00
Joel Einbinder 3bded35834
fix(chromium): wait for existing pages when connecting (#6511) 2021-05-13 14:10:52 -07:00
Andrey Lushnikov 92fa7ddead
feat(firefox): roll to latest Firefoxes (#6561)
Fixes #4704
2021-05-13 13:42:25 -07:00
Pavel Feldman 6a39b86640
chore: GoToAsync -> GotoAsync (#6563) 2021-05-13 11:57:02 -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
Pavel Feldman 17e9dd95f7
feat(trace): support loading trace from zip (#6551) 2021-05-12 21:31:34 -07:00
Pavel Feldman a7ea00d02e
chore: show preview for page under cursor (#6548) 2021-05-12 20:54:17 -07:00
Pavel Feldman cc43b0d23f
chore: remove storybook (#6549) 2021-05-12 19:55:49 -07:00
Pavel Feldman 1a39843df5
docs: follow up on adding trace dir, unify launch options (#6545) 2021-05-12 16:16:36 -07:00
Yury Semikhatsky 41df6607b0
fix: enable util world bindings in firefox (#6546) 2021-05-12 15:19:27 -07:00
Max Schmitt dc7f7f9a8c
fix(chromium): handle backgroundPages() onClose (#6541) 2021-05-12 22:15:04 +02:00
Pavel Feldman 21cb726b7d
chore(tracing): expose tracing api (#6523) 2021-05-12 12:21:54 -07:00
Yury Semikhatsky 460cc31941
fix: propagate custom executable path to codegen (#6509) 2021-05-12 11:45:57 -07:00
Yury Semikhatsky ab55918979
feat(firefox): bump to 1259 (#6510) 2021-05-12 09:03:15 -07:00
Pavel Feldman 45ee257a26
chore(test): fix some screencast tests (#6522) 2021-05-12 08:35:19 -07:00
Anx 1c10c4cbe8
fix: fix har entry time calculation (#6472) 2021-05-11 13:28:17 -07:00
Pavel Feldman d08c50d277
feat(screencast): scale fixes (#6475) 2021-05-11 13:21:01 -07:00
Fili f1a888de02
feat: support Moto G4 device in emulated devices for performance testing (#5946)
Adding Moto G4 to deviceDescriptors.
2021-05-10 09:33:11 -07:00
Andrey Lushnikov 5c1ddc7f0a
fix: fix method elementHandle.frameElement() for framesets (#6468)
Playwright clicks did not work in regular frames due to a bug
in `frameElement` method.

Fixes #6453
2021-05-08 21:25:12 -07:00
Pavel Feldman a9523d9d8f
feat(ff): roll to 1256/1246 (#6466) 2021-05-08 11:35:36 -07:00
Andrey Lushnikov 5e4badd654
feat(firefox-beta): roll Firefox to 1254 - v89.0b9 (#6454) 2021-05-07 00:49:43 -07:00
Andrey Lushnikov aab602cc3b
fix: use old screencast protocol calls for Mac 10.14 (#6440)
This is a quick workaround to be cherry-picked in the release branch.
We'll align protocols in a follow-up.

References #6439
2021-05-06 10:38:46 -07:00
Andrey Lushnikov 7906a8f2f5
feat: add best-effort support for Ubuntu 21.04 (#6429)
With this patch:
- `npx playwright install-deps` will install deps on Ubuntu 21.04
- launch doctor knows the package<->lib mapping for Ubuntu 21.04

**NOTE:** our webkit build, however, doesn't work on Ubuntu 21.04. Since
this is not LTS release, we're doing best-effort here.

Fixes #6405
2021-05-06 10:37:06 -07: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
Max Schmitt d902b06fd1
test: fixed flaky connectOverCDP tests (#6436) 2021-05-06 18:18:56 +02:00
Pavel Feldman 791443d71f
feat(webkit): roll to r1472 (#6425) 2021-05-05 15:35:10 -07:00
Michael Rienstra 8737207d5a
feat(devices): add more Android device descriptions (#6413)
Adds device descriptions for:
- Galaxy S8
- Galaxy S9+
- Galaxy Tab S4
- Pixel 3
- Pixel 4
These devices are regarded as worthy of targeting by BrowserStack.

Sources (both have identical data for these 5 devices):
1. https://github.com/aerokube/moon-deploy/blob/master/moon-local.yaml#L199
2. https://www.danhendricks.com/2018/04/adding-iphone-galaxy-chrome-mobile-emulated-devices/#heading_device_data
2021-05-05 14:02:28 -07:00
Yury Semikhatsky 47cf9c3e8f
feat(chromium): bump to r878941 (#6216)
This roll was blocked by a few upstream bugs that were crashing Chromium on Windows.
- https://bugs.chromium.org/p/chromium/issues/detail?id=1198567#c33
- https://bugs.chromium.org/p/chromium/issues/detail?id=1200964
2021-05-05 09:47:34 -07:00
Max Schmitt ab850afb45
fix: support relative downloadsPath directory for downloads (#6402) 2021-05-05 17:07:10 +02:00
Joel Einbinder 6219042c74
fix(webkit): swallow requests from detached frames (#6242) 2021-05-03 12:34:09 -07:00
Pavel Feldman 1a859ebe68
chore(electron): fix node/browser race conditions, expose browser window asynchronously (#6381) 2021-05-02 22:45:06 -07:00
Yury Semikhatsky 07fb81a4ef
fix(launcher): improve error message for missing channel distribution (#6380) 2021-04-30 19:39:52 -07:00
Gnome Bard 018f3146a8
fix(electron): deliver promised _nodeElectronHandle (#6348) 2021-04-30 18:46:27 -07:00
Pavel Feldman 934bc672f7
test(tracing): start adding tracing tests (#6369) 2021-04-30 07:40:22 -07:00
Max Schmitt 1c40c94ed7
chore: only throw the proxy on launch required on win/CR (#6350) 2021-04-30 00:02:48 +02:00
Dmitry Gozman 263a0fd2e1
fix: evaluate in utility for screenshots (#6364)
We use `waitForFunctionValue` in the main world that may be corrupted.

References #6356.
2021-04-29 14:53:53 -07:00
Pavel Feldman 434f474ce8
chore(evaluate): implement non-stalling evaluate (#6354) 2021-04-29 09:28:19 -07:00
Pavel Feldman 06a92684f3 Reapply #6363 w/ modification--amend 2021-04-28 22:18:05 -07:00
Pavel Feldman 0becd9428a Revert "Revert "fix: break require cycle (#6353)""
This reverts commit 17e966bc2e.
2021-04-28 22:16:53 -07:00
Pavel Feldman 17e966bc2e Revert "fix: break require cycle (#6353)"
This reverts commit 0bcfa92360.

Inspector no longer opens.
2021-04-28 22:10:50 -07:00
Dmitry Gozman 0bcfa92360
fix: break require cycle (#6353)
We have `CRBrowserContext` that extends `BrowserContext`, and
it sometimes fails beacause `BrowserContext` is undefined, depending
on the require order. Below is the require cycle.

```log
server/browserContext.ts
server/supplements/recorderSupplement.ts
server/supplements/recorder/recorderApp.ts
server/playwright.ts
server/android/android.ts
server/chromium/crBrowser.ts
server/browserContext.ts
```

Fixing this by using `require`.
2021-04-28 20:39:01 -07:00
Yury Semikhatsky 560bea5f8d
fix: do not close stream until all bytes have been read (#6351) 2021-04-28 14:54:51 -07:00
Pavel Feldman 922d9ce1fb
chore(tracing): fix some of the start/stop scenarios (#6337) 2021-04-27 11:07:07 -07:00
Yury Semikhatsky 5be005b1c6
Revert "fix: increas recent logs buffer (#6330)" (#6332)
This reverts commit 3c126024ca.
2021-04-26 16:20:49 -07:00
Yury Semikhatsky b6b2366d2c
fix: browser logging (#6331) 2021-04-26 16:20:38 -07:00
Yury Semikhatsky 3c126024ca
fix: increas recent logs buffer (#6330) 2021-04-26 13:58:52 -07:00
Joel Einbinder a51dc50d85
fix(accessibiltiy): ignore new roles that came with new chromium (#6329) 2021-04-26 12:02:54 -07:00
Pavel Feldman be27f47309
feat(tracing): introduce context.tracing, allow exporting trace (#6313) 2021-04-24 20:39:48 -07:00
Pavel Feldman a9219aa8b6
chore: start / stop context tracing (#6309) 2021-04-23 20:39:09 -07:00
Pavel Feldman 97cf86d20a
chore: make instrumentation per-context (#6302) 2021-04-23 18:34:52 -07:00
Yury Semikhatsky fd31ea8b0d
feat: support extra http headers in browserType.connect() (#6301) 2021-04-23 14:52:27 -07:00
Yury Semikhatsky cc4782a718
Revert "fix(chromium): force --use-gl=swiftshader on Windows (#6272)" (#6300)
This reverts commit 357224d6b1.
2021-04-23 10:09:55 -07:00
Pavel Feldman 0ed328f6de
chore(tracing): include events in the trace (#6285) 2021-04-23 09:28:18 -07:00
Yury Semikhatsky 357224d6b1
fix(chromium): force --use-gl=swiftshader on Windows (#6272) 2021-04-22 10:06:39 -07:00
Yury Semikhatsky 3a93c419f8
chore: remove stack from WaitForEventInfo (#6259) 2021-04-22 10:05:37 -07:00
Pavel Feldman fe4fba4a16
chore: extract debugger model from inspector (#6261) 2021-04-21 20:46:45 -07:00
Max Schmitt 7053ac9097
chore(types): add channel to launchServer (#6256) 2021-04-21 21:23:08 +02:00
Dmitry Gozman 6bdc67ac6a
feat(actions): trial option that only performs the checks (#6246)
Available for check, click, dblclick, hover, tap, uncheck.
2021-04-21 12:22:19 -07:00
Dmitry Gozman 640b10c70f
fix(codegen): missing await before newPage.goto (#6253) 2021-04-21 07:59:38 -07:00
Pavel Feldman 85e2db2416
chore: push dispatcher guid into object, reuse it in trace (#6250) 2021-04-20 23:03:56 -07:00
Dmitry Gozman 06b0619260
fix(codegen): do not commit last action on mouse move (#6252)
On a slow page that does a lot of things before navigating upon click,
it is common to move mouse away from the click point. Previously,
we would commit the click action and record a `page.goto()` for the
navigation. Now we attribute any signals, even after accidental mouse move,
to the previous action, in the 5-seconds time window.
2021-04-20 18:45:52 -07:00
Dmitry Gozman ad731c1535
feat(debug): PWDEBUG=console vs PWDEBUG=inspector (#6213)
This supports `PWDEBUG=console` that:
- runs headed;
- disables timeouts;
- adds `playwright` console helper.

When using `PWDEBUG=anything-but-console`, we open inspector.
Docs keep suggesting `PWDEBUG=1`.
2021-04-20 15:58:34 -07:00
Max Schmitt 9cd89ae052
fix: host dependency validation (#6227) 2021-04-20 18:54:53 +02:00
Pavel Feldman f9af4c3755
chore(tracing): render error snapshot as Action (#6241) 2021-04-20 00:19:17 -07:00
Andrey Lushnikov 23dfaf9e9b
feat: start downloading firefox-stable channel (#6177)
This patch adds support for downloading and running Playwright with
firefox-stable channel.

References #5993
2021-04-19 21:26:33 -07:00
Pavel Feldman 033bc9bfcc
chore(tracing): sync timeline and list highlight (#6235) 2021-04-19 19:50:11 -07:00
Pavel Feldman 27e720f23a
feat(tracing): keyboard navigate lists (#6224) 2021-04-19 14:09:50 -07:00
Max Schmitt 8ca58e344e
fix(page): add name property to pageerror event (#5970) 2021-04-19 22:37:38 +02:00
Max Schmitt 7ec57c0c18
chore: read browsers.json with require (#6186)
This fixes the compatibility on Vercel with Next.js when it's used in
a serverless function.
Next.js uses https://github.com/vercel/nft to trace down the
dependencies which a serverless function is using which
is currently not capable of detecting the browsers.json in our current
setup. Previously we used require to load the browers.json which was
replaced by readFileSync in #5318. Since then it was broken.

Fixes #5862
2021-04-19 22:06:04 +02:00
Andrey Lushnikov 329980be2a
feat: use --no-service-autorun in Chromium (#6232)
See https://chromium-review.googlesource.com/c/chromium/src/+/2436773 for details
2021-04-19 13:01:41 -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
Pavel Feldman 90913160c4
chore: render wait for on trace timeline (#6222) 2021-04-18 20:02:34 -07:00
Yury Semikhatsky 17ead28285
fix(server): disconnect ws clients on server close (#6215) 2021-04-16 17:07:56 -07:00
Yury Semikhatsky e4ae6503d7
fix(inspector): fall back to custom executable path for UI (#6214) 2021-04-16 15:19:44 -07:00
Dmitry Gozman ce96914292
fix(remote): unregister selectors after client disconnect (#6195) 2021-04-16 11:14:57 -07:00
Dmitry Gozman e81a3c5901
api: add option position to check/uncheck (#6153)
Since check/uncheck does click under the hood, sometimes it might
need to click at a different position. One example would be a long
label that contains links inside, and clicking in the center happens
to hit the link instead of the label itself.
2021-04-12 12:41:25 -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
Joel Einbinder b3b87f6c69
fix(codegen): ignore AltGraph when typing (#6086) 2021-04-12 09:00:29 -07:00
Dmitry Gozman b62a436041
feat(selectors): support max distance in layout selectors (#6172)
Supports `div:near(button, 120)` with configurable distance in pixels.
2021-04-10 15:20:26 -07:00
Ross Wollman bba7ca34c8
feat(chromium): roll to r869727 (#6170)
Fixes #5952
Fixes #6016
2021-04-09 20:57:41 -07:00
Yury Semikhatsky f3b44d18be
fix(screencast): wait for ffmpeg to finish before reporting video (#6167) 2021-04-09 14:09:45 -07:00
Dmitry Gozman bd8433ba49
test: cleanup various testing env variables (#6155) 2021-04-09 07:59:09 -07:00
Yury Semikhatsky f6606d505b
fix: finish all artifacts when browser exits (#6151) 2021-04-08 18:56:09 -07:00
Pavel Feldman e6f5ce9044
chore: allow running multiple snapshotters for tests (#6147) 2021-04-08 17:27:55 -07:00
Joel Einbinder 63d0d466e3
feat(cdp): replace wsEndpoint with protocol neutral endpointURL (#6141) 2021-04-08 14:55:28 -07:00
Yury Semikhatsky 53d50f9b72
fix(screencast): properly stop screencast on context closure (#6146) 2021-04-08 14:01:05 -07:00
Joel Einbinder 779355ad51
feat(types): make the template on BrowserType optional (#6142)
This makes it much nicer to use `BrowserType` because it no longer has a template.

Technically a breaking change because of the rare edge case where someone used their own non-browser type inside the template, but I don't consider that intended behavior and think this is fine.
2021-04-08 10:27:24 -07:00
Dmitry Gozman 310692b101
test: run page tests on electron bot (#6122) 2021-04-08 10:26:26 -07:00
Pavel Feldman d9546fd098
chore: read all traces from the folder (#6134) 2021-04-08 07:59:05 -07:00
Pavel Feldman d0db4f6737
feat: include screencast in trace (#6128) 2021-04-07 14:32:12 -07:00
Yury Semikhatsky 09c175914e
feat(webkit): bump to 1460 (#6124) 2021-04-07 08:55:16 -07:00
Pavel Feldman 0dfde2e975
fix(screenshot): never throw page is navigating (#6103) 2021-04-06 16:01:38 -07:00
Andrey Lushnikov 112ac2f98c
feat(chromium): roll Chromium to r867878 (#6065)
This roll required us pass a new flag - `--allow-pre-commit-input`. Otherwise, keyboard tests won't pass.

Co-authored-by: Joel Einbinder <joel.einbinder@gmail.com>
2021-04-06 15:56:41 -07:00
Pavel Feldman 481034bd0d
chore: trace viewer actions sidebar (#6083) 2021-04-05 20:27:57 -07:00
Dmitry Gozman 5afe282fbb
test: move remaining files from old test/ directory (#6081) 2021-04-05 15:51:45 -07:00
Yury Semikhatsky e9f0f6c894
fix: mark disposed dispatchers as such (#6051) 2021-04-05 11:50:28 -07:00
Dmitry Gozman 4f7e7450e2
test: migrate last tests to new folio (#6071) 2021-04-05 09:18:56 -07:00
Andrey Lushnikov da1dafcadb
fix: start downloading firefox build for ubuntu 20.04 (#6064)
Custom firefox build for Ubuntu 20.04 fixes WebGL on headful.
2021-04-02 22:08:04 -07:00
Andrey Lushnikov 4da2d6e104
feat(firefox): roll Firefox to r1244 (#6052)
Fixes #5929
Fixes #6001
2021-04-02 15:41:54 -07:00
Yury Semikhatsky 561cb23e8d
fix: dispatch popup event on the client end (#6044) 2021-04-02 11:15:07 -07:00
Yury Semikhatsky 4f2827f302
fix(dom): click on links inside shadow dom (#5850) 2021-04-02 10:36:24 -07:00
Pavel Feldman a7630c91d5
api: remove Chromium* classes (#6040) 2021-04-01 18:47:14 -07:00
Max Schmitt d862deeadf
fix(deps): added missing unicode and emoji dependencies (#6039)
Fixes #6033
2021-04-01 17:54:19 -07:00
Dmitry Gozman 8f71f5971b
fix(input): do not retarget from input/textarea/select to an ancestor button (#6036)
Although such markup is not expected, it happens in the wild. Retargeting
in this case in unexpected, so we check/click/etc the control itself.
2021-04-01 12:30:05 -07:00
Yury Semikhatsky 16d98cb48a
chore(launcher): add more logging to processKill (#6025) 2021-03-31 12:17:16 -07:00
Andrey Lushnikov f472c96129
feat: support webkit technology preview (#5885)
This patch adds support for `technology preview` webkit channel, which
we will keep close to the actual Safari Technology Preview releases.

This channel does not install by default. It is supposed to be installed
with the following CLI command:

```sh
$ npx playwright install webkit-technology-preview
```

Once the channel is installed, it can be used the following way:

```js
const browser = await playwright.webkit.launch({
  channel: 'technology-preview',
});
```

**NOTE:** if clients attempt using the channel without installing it,
it'll throw an error with a copyable instructions to install via CLI.

References #5884
2021-03-31 11:32:10 -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
Yury Semikhatsky 9532d0bde0
feat(webkit): bump to 1457 (#6021) 2021-03-31 10:29:43 -07:00
Yury Semikhatsky 587682e024
feat(chromium): bump to r865012 (#5963)
References #5858

Co-authored-by: Andrey Lushnikov <lushnikov@chromium.org>
2021-03-31 09:51:18 -07:00
Pavel Feldman 85ab1dc7a4
feat(waitForURL): add a new waitForURL api (#6010) 2021-03-30 21:51:22 -07:00
Dmitry Gozman 98f1f715c5
chore: ensure we emit Page event before resoliving pageOrError (#6012)
Internal callers of pageOrError should be able to rely on the
Page being already reported.
2021-03-30 17:35:42 -07:00
Yury Semikhatsky 77993c3ebb
fix(installer): add libx11-xcb1 to the list of chromium deps (#6003) 2021-03-30 11:29:21 -07:00
Yury Semikhatsky 28b14fc5f7
feat(docker): use playwright install-deps for building docker image (#5995) 2021-03-29 23:48:54 -07:00
Pavel Feldman f1c0d09765
feat(size): emulate window.screen size (#5967) 2021-03-29 14:10:58 -07:00
Yury Semikhatsky 8c6822bd32
fix(docker): update native deps and docker files for chromium (#5989) 2021-03-29 13:43:31 -07:00
Mosan 2262d8739f
Update nativeDeps.ts (#5988) 2021-03-29 12:19:34 -07:00
Yury Semikhatsky 0943af2806
fix: kill browser if process doesnt exit for 30s after close (#5968) 2021-03-27 09:59:04 -07:00
Max Schmitt dfe07818e6
docs: fixed various typos (#5958) 2021-03-26 10:47:16 -07:00
Joel Einbinder 3ce02a95c8
fix(selectors): properly generate selectors for tricky ids (#5940) 2021-03-25 18:43:33 -07:00
Dmitry Gozman 6b3f4cd12b
chore: calculate video size in a single place (#5942) 2021-03-24 10:56:20 -07:00
Dmitry Gozman 8e97607389
fix(viedo): do not stall video in popups (#5941)
There are two problems, exposed by existing tests:

- We do not send Page.startScreeencast before Runtime.runIfWaitingForDebugger
  because we launch video recorder in between. This stalls when the page is busy
  immediately after resuming, e.g. with alert().
  Fixed by starting video recorder in advance.

- We wait for the first frame that may not come - for example, context-wide interception
  is blocking essential resource and first frame.
  Fixed by only waiting for the first frame before reporting the video, not the page.
2021-03-24 09:36:46 -07:00
Dmitry Gozman 2cf4caa4cf
chore: implement mixins in protocol.yml (#5932) 2021-03-24 06:37:10 -07:00
Pavel Feldman 543582b4ca
chore: expose channel name literals for types (#5922) 2021-03-23 13:21:03 -07:00
Andrey Lushnikov ec6453d1b2
fix: installer compilation (#5908)
For some reason typescript can't find electron types when using
nested tsconfig - workaround the bug.

Drive-by: surface installer compilation problems.
2021-03-22 17:39:03 -07:00
Andrey Lushnikov 2064d27dc6
fix(installer): retain browsers installed via Playwrigth CLI (#5904)
Browser registry is responsible for 3 things:
1. Remove downloaded browsers if there are no packages that refer to them
2. Install default browsers needed for the current package
3. Install browsers on-demand when used through Playwright CLI

Currently, registry relies on a single "download" field in `browsers.json`
to carry both (1) and (2). However, browsers in (3) are marked as
`download: false` so that they aren't installed automatically in (2), so
auto-remove procedure in (1) removes them on subsequent installation.

One possible approach to fix this would be modifying package's `browsers.json` to
change `download: false` to `true` when browsers are installed with
Playwright CLI. This approach was explored here:
bc04a51800

We decided against this since we have a history of issues related to
package modifications after NPM installation. This breaks all
sorts of yarn/npm caching mechanisms.

Instead, this patch is a two-step refactor:
- remove the "download" field in `browsers.json`. Now, all registries
(including old ones from previously-released versions) will retain any
browsers that are mentioned in the `browsers.json`.
- add a new flag "installByDefault", that is **only used** for default
installation.

With this change, the registry tasks are done like this:
- (1) auto-removal: if browser has a back reference, it is retained,
otherwise it is removed from registry
- (2) default installation: use only `installByDefault` to carry default installations
- (3) CLI installation: simply installs browsers. Since we retain
everythings that's referenced in (1), browsers aren't removed.

Fixes #5902
2021-03-22 11:43:29 -07:00
Yury Semikhatsky 67c29e8155
chore: add missing await to floating promises (#5813) 2021-03-22 09:59:39 -07:00
Andrey Lushnikov 9a50304dc1
fix: work-around electron's broken event loop (#5867)
Since `setImmediate` doesn't create a new task in Electron,
we have to fallback to `setTimeout` instead.

See https://github.com/electron/electron/issues/28261 for details.

Fixes #5228
2021-03-18 09:29:37 -07:00
Pavel Feldman d53cea7029
fix(pageOrError): throw in launchPersistentContext if context page has errors (#5868) 2021-03-18 08:14:57 -07:00
Andrey Lushnikov bb21faf450
fix: disable firefox's webrender on Darwin (#5870)
References #5721
2021-03-18 00:23:23 -07:00
Pavel Feldman 2367039a2c
chore(stable): throw user-friendly message when ffmpeg is missing (#5865) 2021-03-17 19:19:44 -07:00
Pavel Feldman 84efdfcbc9
chore(autowait): auto-wait for top level navigations only (#5861) 2021-03-17 14:47:51 -07:00
Pavel Feldman 5ae731a3fb
chore(evaluate): respect signals when evaluating on handle (#5847) 2021-03-17 12:03:21 -07:00
Pavel Feldman 7011e5737a
chore(evaluate): explicitly annotate methods that wait for signals (#5859) 2021-03-17 10:47:07 -07:00
Andrey Lushnikov ae460f01fc
devops: start downloading webkit fork on Mac 10.14 (#5837)
References #5833
2021-03-17 09:34:09 -07:00
Andrey Lushnikov e8a33c4039
feat(firefox): roll Firefox to r1237 (#5849)
This patch rolls Firefox to r1237. Upstream firefox still struggles
with crashes with certain videos: https://bugzilla.mozilla.org/show_bug.cgi?id=1697004

This PR also workarounds this crash by disabling webrender.

References #5721
2021-03-16 23:27:39 -07:00
Pavel Feldman bf36b487fc
fix(rimraf): allow 10 retires when removing the profile folder (#5826) 2021-03-16 19:31:35 -07:00
Yury Semikhatsky 8df4dcb0de
feat(webkit): bump to 1446 (#5844) 2021-03-16 17:23:42 -07:00
Pavel Feldman d81ebff414
fix(inspector): do not collect action signals while on pause (#5843) 2021-03-16 12:06:12 -07:00
Pavel Feldman 5cf13612cf
chore: pretty print storage state (#5830) 2021-03-15 19:03:09 -07:00
Pavel Feldman c2db8da4df
fix(inspector): await inspector init to avoid races (#5829) 2021-03-15 19:02:38 -07:00
E 095ad6339c
chore: update error message when using userDataDir arg (#5814) 2021-03-15 16:58:46 -07:00
Pavel Feldman ea32ad2b09
infra(channel): add edge stable bot (#5825) 2021-03-15 16:00:52 -07:00
Pavel Feldman 95affe9387
chore: do not delete unused browsers when PLAYWRIGHT_SKIP_BROWSER_GC is specified (#5827) 2021-03-15 16:00:18 -07:00
Joel Einbinder defd1a33be
fix(chromium): fix crash if connecting to a browser with a serviceworker (#5803) 2021-03-15 09:50:17 -07:00
Pavel Feldman 1dd6bd3316
infra(channel): wire release channel to all tests (#5820) 2021-03-15 08:07:57 -07:00
Pavel Feldman a96d6a7dbb
feat: allow to pick stable channel (#5817) 2021-03-13 14:02:39 -08:00
Pavel Feldman c4578f19f2
chore: organize per-browser dependencies (#5787) 2021-03-11 20:22:50 -08:00
Oleg Lebedev a185da9d14
chore: allow skipping host requirements validation (#5806) 2021-03-11 18:46:31 -08:00
Gilberto Saraiva 7fcb89269e
fix(firefox): ensure a exception catch when async send call to a dead object; (#5805) 2021-03-11 16:04:08 -08:00
Pavel Feldman ad69b2af83
chore: unify recorder & tracer uis (#5791) 2021-03-11 11:22:59 -08:00
Yury Semikhatsky ddfdf8a76a
fix: install chromium along with ffmpeg (#5774) 2021-03-10 14:01:35 -08:00
Pavel Feldman fea6669473
feat(trace): highlight action target (#5776) 2021-03-10 11:43:26 -08:00