Commit Graph

17 Commits

Author SHA1 Message Date
Dmitry Gozman
81c8620bfe
chore: upgrade internal types to support TypeScript 4.9.3 (#19280)
Fixes https://github.com/microsoft/TypeScript/issues/51619

Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-12-05 17:22:25 -08:00
Zihua Li
0c6a0f40c6
feat(keyboard): support simple cut-pasting using meta+x/v (#18756) 2022-11-29 12:58:14 -08:00
Max Schmitt
7e2aec7454
chore: align more ESLint rules with VSCode formatting (#16647) 2022-08-18 20:12:33 +02:00
Max Schmitt
ff5f241b84
chore: set --allow-pre-commit-input flag on Android/Electron (#16383) 2022-08-09 23:18:15 +02:00
Yury Semikhatsky
008a85b143
feat(webkit): roll to r1681 (#15577) 2022-07-12 14:07:56 -07:00
Ross Wollman
fbb364c1cd
fix: page.locator.focus() and page.locator(…).type(…) (#14267)
Fixes focus and blur management when `page.locator(…).focus()`  and  `page.locator(…).type(…)` are used which was regressed by 7a5b070 (#13510).

#13510 relied on an implicit assumption that this (conditional) [`blur`](7a5b070e95/packages/playwright-core/src/server/injected/injectedScript.ts (L672)) call would always be followed by a call that resulted in a newly focused element via this [`focus`](7a5b070e95/packages/playwright-core/src/server/injected/injectedScript.ts (L674)) call.

However, some elements are [not focusable](https://html.spec.whatwg.org/multipage/interaction.html#focusable-area), so we were blurring incorrectly, and losing focus that we should have maintained.

Two regression tests were added that pass on the commit prior to 7a5b070e95 (and match manual testing/expectations):

* `page.locator(…).focus()`: _keeps focus on element when attempting to focus a non-focusable element_
* `page.locator(…).type(…)`: _should type repeatedly in input in shadow dom_

Additionally, a third test (_should type repeatedly in input in shadow dom_) was added to check the invariant from #13510 that states:

> This affects [contenteditable] elements, but not input elements.

and allows us to introduce the targeted fix (contenteditble check before blur) without breaking FF again.

And _should type repeatedly in contenteditable in shadow dom with nested elements_ was added to ensure the above fix works with nest contenteditble detection.

Fixes #14254.
2022-05-19 14:31:56 -07:00
Andrey Lushnikov
80bc532874
fix: support undo/redo editing commands (#13606)
Fixes #13601
2022-04-18 22:22:52 -07:00
Dmitry Gozman
7a5b070e95
fix(type): focus switch between contenteditables in shadow dom (#13510)
Firefox has a bug: calling `node.focus()` does make the node focused,
but some internal "current contenteditable node" is not changed.
Blurring the previous one and focusing the new one helps.
2022-04-12 16:44:27 -07:00
Max Schmitt
90e76f9adb
test: rename #smoke to @smoke as test tags (#12652) 2022-03-10 19:42:52 +01:00
Mateusz Burzyński
eaa98ce53a
feat(keyboard): support simple copy-pasting using meta+c/v (#10828)
It's a straightforward change to support new, common, keyboard commands

Note that I've tested this locally with Chrome on my Mac but it seems that CI doesn't want to pass Chrome tests - it's running on ubuntu though. Does this mean that I should introduce per-platform editing commands? At the moment there is only a single [`macEditingCommands`](0ed33522c5/packages/playwright-core/src/server/macEditingCommands.ts) file.

References https://github.com/microsoft/playwright/issues/12000

Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2022-02-28 13:43:43 -08:00
Andrey Lushnikov
b6c2b32b53
test: introduce #smoke tests (#11135)
This patch introduces 109 "#smoke" tests - a subset of tests that makes
sure that basic Playwright functionality works. This set is loosely
defined; feel free to add/remove tests to the set. The only goal is to
keep this set minimal & fast to run.

I tried to pick tests so that various parts of Playwright functionality
are exercised.
2021-12-29 18:51:28 -08:00
Mateusz Burzyński
55fb53ef82
test(keyboard): add tests for click events being dispatched when Space/Enter gets pressed while focus is on a button (#10748) 2021-12-07 14:48:27 -08:00
Max Schmitt
cd22072685
chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
Dmitry Gozman
b30772c67e
fix(tracing): collect apiName for mouse/keyboard/touchscreen (#8755) 2021-09-07 13:48:30 -07:00
Dmitry Gozman
8b6b894dd8
test: prepare test to use options as passed (#6557)
This changes `headful` to `headless` to align with launch options.
Also replaces `isChromium` and friends with `browserName`.
2021-05-13 10:22:23 -07:00
Dmitry Gozman
217cbe3e21
test: cleanup bad usages of pageTest (#6430) 2021-05-06 07:08:22 -07:00
Dmitry Gozman
9433cae4fe
test: move all page tests to a subdirectory (#6427) 2021-05-05 19:10:28 -07:00