Commit Graph

2392 Commits

Author SHA1 Message Date
Arjun Attam
6a1bd3ae6e
docs: add debugging docs page (#2865) 2020-07-08 08:59:58 -07:00
Joel Einbinder
8611ee8df7
chore(testrunner): typescript test files (#2751)
This lets our spec files be .ts instead of just .js. The typescript files will be checked against the public types. Tests are compiled with babel just in time before running them, emulating the jest experience. TypeScript tests are also linted with eslint.

I converted keyboard.spec.js as the first demo. I'll follow up converting some more more tests.
2020-07-08 00:20:36 -07:00
Ross Wollman
e97badcca8
docs(CONTRIBUTING.md): Add build step (#2869)
* docs(CONTRIBUTING.md): Add build step

Without the build step, a fresh install without any previous
builds would get:

```
$ npm test

> playwright-internal@1.2.0-post test /Users/pw/code/playwright
> cross-env BROWSER=all node --unhandled-rejections=strict test/test.js

internal/modules/cjs/loader.js:1033
  throw err;
  ^

Error: Cannot find module '../lib/rpc/server/dispatcher'
Require stack:
- /Users/pw/code/playwright/test/environments.js
- /Users/pw/code/playwright/test/test.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1030:15)
    at Function.Module._load (internal/modules/cjs/loader.js:899:27)
    at Module.require (internal/modules/cjs/loader.js:1090:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at Object.<anonymous> (/Users/pw/code/playwright/test/environments.js:23:34)
    at Module._compile (internal/modules/cjs/loader.js:1201:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Module.require (internal/modules/cjs/loader.js:1090:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/pw/code/playwright/test/environments.js',
    '/Users/pw/code/playwright/test/test.js'
  ]
}
npm ERR! Test failed.  See above for more details.
```

Fixes #2868.

Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2020-07-07 22:38:59 -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
Dmitry Gozman
2a86ead0ac
chore: replace FrameTask with internal events on Frame (#2856)
We now use a few helper.waitForEvent calls to wait for internal
events kNavigationEvent and kLifecycleEvent. With these events,
we should be able to replicate logic over rpc.
2020-07-07 15:22:05 -07:00
Dmitry Gozman
35cb20d5ad
test: unflake recorder tests (#2808)
We ensure that recorder is installed in the main frame before running the test.
2020-07-07 14:11:59 -07:00
Yury Semikhatsky
baaa65492b
browser(firefox): resize window when changing viewport (#2861) 2020-07-07 14:04:07 -07:00
Yury Semikhatsky
64f57216e2
browser(webkit): roll to 07-07-2020 (#2863) 2020-07-07 13:03:07 -07:00
Joel Einbinder
6ed8b5fcc6
chore(eslint): lint for copyrights on files (#2858) 2020-07-07 11:12:45 -07:00
Yevhen
de7969f0f5
docs(api/input): fix typo (#2837) 2020-07-07 10:46:13 -07:00
Yury Semikhatsky
9640dbf2a6
browser(firefox): exclude browser controls from screencast (#2855) 2020-07-07 09:40:09 -07:00
Yury Semikhatsky
39144dd5b2
feat(webkit): bump to 1302 (#2852) 2020-07-07 09:31:02 -07:00
Dmitry Gozman
0380400de4
chore: refactor waiting for lifecycle events (#2851)
Instead of checking lifecycle events on every change, we
notify precisely when lifecycle event in the subtree
is satisfied. This allows FrameTask to be later switched
to event-based approach, and will easily translate to the
rpc client.
2020-07-06 17:33:56 -07:00
Dmitry Gozman
db3439d411
chore: introduce DocumentInfo (#2765)
It encapsulates documentId and request.
2020-07-06 15:58:27 -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
ef125e13e2
chore: cut v1.2 (#2850) 2020-07-06 15:12:03 -07:00
Yury Semikhatsky
ea9b82d225
browser(webkit): properly disconnect signal handlers when closing browser (#2849) 2020-07-06 13:59:13 -07:00
Yury Semikhatsky
fc18f2f38a
browser(firefox): support screencast frame size and scale configuration (#2847) 2020-07-06 11:28:35 -07:00
Dmitry Gozman
ac2185a9d9
test: update http credentials tests (#2806) 2020-07-06 11:28:07 -07:00
Yury Semikhatsky
06957e8ed5
feat(firefox): bump to 1122 (#2844) 2020-07-06 11:12:43 -07:00
Pavel Feldman
6bbe7eb006
chore(rpc): inline options parameter in all rpc channels (#2842) 2020-07-06 10:04:09 -07:00
Arjun Attam
8d111a8820
docs(readme): add locale to geo example (#2845) 2020-07-06 09:43:35 -07:00
Pavel Feldman
241d39f904
chore(rpc): exit server upon pipe disconnect (#2836) 2020-07-04 09:52:38 -07:00
Pavel Feldman
2540805bf2
chore(rpc): misc serializer improvements (#2832) 2020-07-03 18:04:08 -07:00
Andrey Lushnikov
7f60c4df62
feat(webkit): roll webkit to r1301 (#2827)
References #2700
2020-07-02 18:51:03 -07:00
Andrey Lushnikov
3dd09f04ef
browser(webkit): close context menu on Windows when closing page (#2825)
Review URL: 358fd983a9
2020-07-02 15:21:12 -07:00
Yury Semikhatsky
6aef045fd4
browser(firefox): create new window for each new page (#2823) 2020-07-02 14:46:57 -07:00
Andrey Lushnikov
b1b6d3f531
devops: add signature to BUILD_NUMBER to force rebaseline (#2810)
Currently, it might happen that two different patches clash for the
same build number for the browsers. In this case, authors might
not even know that they need to rebaseline.

This patch starts adding a second line to `BUILD_NUMBER` files - the
signature and date of the `BUILD_NUMBER` change. These are guaranteed
to clash, so it should not be possible to land patches without
re-baselining them.
2020-07-02 12:09:27 -07:00
Yury Semikhatsky
605257b1a0
browser(firefox): Win build fix (#2822) 2020-07-02 11:20:25 -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
Yury Semikhatsky
024cb1ddc1
browser(firefox): basic screencast implementation for GTK (#2818) 2020-07-02 10:43:04 -07:00
Yury Semikhatsky
6329cbbbf8
chore: remove dead code from test (#2819) 2020-07-02 10:42:46 -07:00
Joel Einbinder
3d403cb2cd
browser(webkit): force wpe to use the complex text path (#2801) 2020-07-02 10:04:10 -07:00
Andrey Lushnikov
756d537324
feat(webkit): roll WebKit to r1298 (#2813) 2020-07-02 09:50:16 -07:00
Joel Einbinder
f484b20eea
fix(recorder): allow node to close gracefully (#2817) 2020-07-02 08:02:27 -07:00
Joel Einbinder
cb0c037e17
test(chromium): enable selectall test on mac (#2788) 2020-07-02 01:57:30 -07:00
Andrey Lushnikov
f9f3aeb0fe
test: add failing test for context menus that prevent browser close (#2811)
References #2700
2020-07-02 00:45:02 -07:00
Andrey Lushnikov
5484217c9f chore: make //utils/roll_browser.js executable 2020-07-02 00:40:47 -07:00
Andrey Lushnikov
43cdb3ba72
browser(webkit): revert #2755 (#2809)
Review URL: 7d35d22798

This reverts https://github.com/microsoft/playwright/pull/2755/files
Reason:
- it doesn't compile on Windows

References #2699
2020-07-01 22:40:33 -07:00
Dmitry Gozman
19abc9bd9f
fix(dialogs): let click timeout, log information about dialogs (#2781)
We should not stall selector actions because of dialogs
and properly timeout instead. For this, we should not await
the handle.dispose() call because it will never happen
while dialog is shown.

Also, log information about dialogs to make it easier to debug.
2020-07-01 22:10:37 -07:00
Dmitry Gozman
0d16b16e91
fix(firefox): unskip worker error test (#2805) 2020-07-01 22:07:53 -07:00
Dmitry Gozman
e12e2451e4
test: disable flaky test on chromium mac (#2807) 2020-07-01 22:01:44 -07:00
Dmitry Gozman
9d6eaadba7
fix(navigation): ensure that goBack/goForward work with file urls (#2792) 2020-07-01 19:17:27 -07:00
Pavel Feldman
c15dc94f8e
chore(rpc): explicitly create page dispatcher (#2799) 2020-07-01 18:36:09 -07:00
Pavel Feldman
d484e04a08
test(route): add another route test (#2800) 2020-07-01 18:31:08 -07:00
Andrey Lushnikov
14162f8923
browser(webkit): let web page close when it has open context menu (#2802)
Review URL: 42f86e9d77

Currently, if web page has an open context menu, then it won't close.
This prevents browser from quitting.

In stock safari, this behavior can also be observed in a way that
context menu will stay opened even if related page got closed.

While investigating this behavior on Mac, a crucial observation was
that `[NSMenu popUpContextMenu]` is spawning a nested event loop,
keeping reference to `WebContextMenuProxyMac` instance, which in turn
keeps references on associated `NSView` with `WKWebView`.

To exit the loop, we need to explicitly cancel context menu. For this,
this patch adds a method `hide` on `WebContextMenuProxy` that uses
port-specific code to cancel context menu.

Windows part of this patch is somewhat speculative: I didn't check
it, but given the same symptomps, I applied the same solution.

Fixes #2700
2020-07-01 18:12:11 -07:00
Dmitry Gozman
c188118d3a
browser(webkit): do not show popup menu in mac headless (#2803) 2020-07-01 17:52:25 -07:00
Dmitry Gozman
e8e45e8450
feat(dom): migrate innerText, innerHTML and getAttribute to tasks (#2782)
This ensures synchronous access to avoid element recycling.
2020-07-01 16:10:53 -07:00
Dmitry Gozman
ff1fe3ac39
fix(close): actually mark the page as closing (#2798)
Currently double-closing flakiness is seen on Firefox bots.
2020-07-01 16:05:56 -07:00