playwright/tests
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
..
android chore: hide plugins for now (#13908) 2022-05-03 14:25:56 -07:00
assets test(stress): add stress tests (#14240) 2022-05-18 09:50:58 -07:00
components test(ct): test react native events (#14079) 2022-05-10 14:01:06 -07:00
config chore: fix wrong toHaveScreenshot defaults in docs (#14200) 2022-05-16 22:26:23 +03:00
electron chore: hide plugins for now (#13908) 2022-05-03 14:25:56 -07:00
installation devops: follow-up with installation tests on flakienss dashbaord (#14015) 2022-05-07 09:17:07 -07:00
library feat(chromium-tip-of-tree): roll Chromium TOT to 1008 (#14279) 2022-05-19 09:29:44 -07:00
page fix: page.locator.focus() and page.locator(…).type(…) (#14267) 2022-05-19 14:31:56 -07:00
playwright-test chore: pass fixture defaults different from falsy (#14237) 2022-05-18 12:03:47 -07:00
stress chore: ease the stress tests (#14260) 2022-05-18 12:01:18 -07:00
index.d.ts test: added tests for WebSocket over Socks proxy (#7235) 2021-06-24 18:50:16 +02:00
tsconfig.json chore: group tests under tests/ (2) (#13082) 2022-03-25 23:09:02 -07:00