playwright/tests/page
Dmitry Gozman 61ff52704c
feat(input): perform hit target check during input (#9546)
This replaces previous `checkHitTarget` heuristic that took place before the action
with a new `setupHitTargetInterceptor` that works during the action:
- Before the action we set up capturing listeners on the window.
- During the action we ensure that event target is the element we expect to interact with.
- After the action we clear the listeners.

This should catch the "layout shift" issues where things move
between action point calculation and the actual action.

Possible issues:
- **Risk:** `{ trial: true }` might dispatch move events like `mousemove` or `pointerout`,
because we do actually move the mouse but prevent all other events.
- **Timing**: The timing of "hit target check" has moved, so this may affect different web pages
in different ways, for example expose more races. In this case, we should retry the click as before.
- **No risk**: There is still a possibility of mis-targeting with iframes shifting around,
because we only intercept in the target frame. This behavior does not change.

There is an opt-out environment variable PLAYWRIGHT_NO_LAYOUT_SHIFT_CHECK that reverts to previous behavior.
2021-11-05 17:31:28 -07:00
..
elementhandle-screenshot.spec.ts-snapshots test: roll to folio@0.4.0-alpha28 (#6918) 2021-06-04 20:54:58 -07:00
locator-misc-2.spec.ts-snapshots test: fix some failing locators tests (#7989) 2021-08-04 23:36:27 +02:00
page-request-fulfill.spec.ts-snapshots test: roll to folio@0.4.0-alpha28 (#6918) 2021-06-04 20:54:58 -07:00
page-screenshot.spec.ts-snapshots test: canvas updates are reflected on screenshots (#9180) 2021-09-27 13:45:03 -07:00
elementhandle-bounding-box.spec.ts test: prepare test to use options as passed (#6557) 2021-05-13 10:22:23 -07:00
elementhandle-click.spec.ts test: cleanup bad usages of pageTest (#6430) 2021-05-06 07:08:22 -07:00
elementhandle-content-frame.spec.ts test: cleanup bad usages of pageTest (#6430) 2021-05-06 07:08:22 -07:00
elementhandle-convenience.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
elementhandle-eval-on-selector.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
elementhandle-misc.spec.ts feat(api): introduce setChecked convenience method (#8525) 2021-08-29 20:00:40 -07:00
elementhandle-owner-frame.spec.ts test: cleanup bad usages of pageTest (#6430) 2021-05-06 07:08:22 -07:00
elementhandle-press.spec.ts test: cleanup bad usages of pageTest (#6430) 2021-05-06 07:08:22 -07:00
elementhandle-query-selector.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
elementhandle-screenshot.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
elementhandle-scroll-into-view.spec.ts test: cleanup bad usages of pageTest (#6430) 2021-05-06 07:08:22 -07:00
elementhandle-select-text.spec.ts test: prepare test to use options as passed (#6557) 2021-05-13 10:22:23 -07:00
elementhandle-type.spec.ts test: cleanup bad usages of pageTest (#6430) 2021-05-06 07:08:22 -07:00
elementhandle-wait-for-element-state.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
eval-on-selector-all.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
eval-on-selector.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
frame-evaluate.spec.ts fix(evaluate): reject all context operations when frame detaches (#9987) 2021-11-03 10:44:50 -07:00
frame-frame-element.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
frame-goto.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
frame-hierarchy.spec.ts chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
interception.spec.ts feat(chromium): roll to r936784 (#9986) 2021-11-04 12:35:31 -07:00
jshandle-as-element.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
jshandle-evaluate.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
jshandle-json-value.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
jshandle-properties.spec.ts chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
jshandle-to-string.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
locator-click.spec.ts chore: move locators to strict selectors (#7866) 2021-07-27 15:27:36 -07:00
locator-convenience.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
locator-element-handle.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
locator-evaluate.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
locator-misc-1.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
locator-misc-2.spec.ts test: remove stray logging (#9589) 2021-10-18 11:13:18 -07:00
locator-query.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
matchers.misc.spec.ts fix(expect): do not fail on navigated frames while polling (#9659) 2021-10-20 13:01:05 -07:00
network-post-data.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-accessibility.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-add-init-script.spec.ts test: cleanup bad usages of pageTest (#6430) 2021-05-06 07:08:22 -07:00
page-add-script-tag.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-add-style-tag.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-autowaiting-basic.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-autowaiting-no-hang.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-basic.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-check.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-click-react.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-click-scroll.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-click-timeout-1.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-click-timeout-2.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-click-timeout-3.spec.ts feat(input): perform hit target check during input (#9546) 2021-11-05 17:31:28 -07:00
page-click-timeout-4.spec.ts feat(input): perform hit target check during input (#9546) 2021-11-05 17:31:28 -07:00
page-click.spec.ts test: detach frame while clicking race (#10029) 2021-11-03 19:41:31 -07:00
page-close.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-dialog.spec.ts chore: align internal test harness w/ @playwright/test (#9796) 2021-10-26 13:45:53 -07:00
page-dispatchevent.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-drag.spec.ts chore: align internal test harness w/ @playwright/test (#9796) 2021-10-26 13:45:53 -07:00
page-emulate-media.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-evaluate-handle.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-evaluate-no-stall.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-evaluate.spec.ts fix(evaluate): reject all context operations when frame detaches (#9987) 2021-11-03 10:44:50 -07:00
page-event-console.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-event-crash.spec.ts chore: remove isContextDestroyedError heuristic (#8456) 2021-08-26 18:44:49 -07:00
page-event-network.spec.ts test(chromium): failing test for resolving responses after a navigation (#9651) 2021-10-21 08:29:04 -07:00
page-event-pageerror.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-event-popup.spec.ts feat(firefox): roll to r1298 (#9848) 2021-10-28 07:41:58 -07:00
page-event-request.spec.ts chore: roll Electron to 12.2.1 (#9271) 2021-10-01 19:40:47 -07:00
page-expose-function.spec.ts chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
page-fill.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-focus.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-goto.spec.ts test: goto finishes on window.stop() (#10070) 2021-11-05 16:51:22 -07:00
page-history.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-keyboard.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-mouse.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-navigation.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-network-idle.spec.ts chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
page-network-request.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-network-response.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-network-sizes.spec.ts test: request.sizes() sometimes hangs in CR (#9349) 2021-10-07 14:26:54 -07:00
page-request-continue.spec.ts feat(html): render the suite name before test title (#9909) 2021-11-01 10:53:42 -07:00
page-request-fulfill.spec.ts feat(webkit): roll to r1562 (#9476) 2021-10-14 02:00:25 +02:00
page-request-intercept.spec.ts test: skip interception tests in electron (#10056) 2021-11-04 13:36:04 -07:00
page-route.spec.ts test: add a couple more route+headers tests (#9322) 2021-10-06 09:35:54 -07:00
page-screenshot.spec.ts chore: roll Electron to 12.2.1 (#9271) 2021-10-01 19:40:47 -07:00
page-select-option.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-set-content.spec.ts feat: add "commit" to possible waitUntil options (#9892) 2021-11-01 17:12:19 -07:00
page-set-extra-http-headers.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-set-input-files.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-strict.spec.ts feat(strict): list ambiguous matches when throwing strict exception (#8449) 2021-08-25 14:51:03 -07:00
page-wait-for-function.spec.ts fix(evaluate): reject all context operations when frame detaches (#9987) 2021-11-03 10:44:50 -07:00
page-wait-for-load-state.spec.ts feat: add "commit" to possible waitUntil options (#9892) 2021-11-01 17:12:19 -07:00
page-wait-for-navigation.spec.ts feat: add "commit" to possible waitUntil options (#9892) 2021-11-01 17:12:19 -07:00
page-wait-for-request.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-wait-for-response.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
page-wait-for-selector-1.spec.ts chore(frame-selector): add more tests, use frame logic in element handle (#10097) 2021-11-05 16:36:01 -07:00
page-wait-for-selector-2.spec.ts chore(frame-selector): add more tests, use frame logic in element handle (#10097) 2021-11-05 16:36:01 -07:00
page-wait-for-url.spec.ts feat: add "commit" to possible waitUntil options (#9892) 2021-11-01 17:12:19 -07:00
pageTest.ts test: migrate to upstream fixtures (#9835) 2021-10-28 08:31:30 -07:00
pageTestApi.ts test: migrate to upstream fixtures (#9835) 2021-10-28 08:31:30 -07:00
queryselector.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
selectors-css.spec.ts tests: fix variety of tests (#9630) 2021-10-19 17:03:15 -07:00
selectors-frame.spec.ts chore(frame-selector): add more tests, use frame logic in element handle (#10097) 2021-11-05 16:36:01 -07:00
selectors-misc.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
selectors-react.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
selectors-text.spec.ts fix(selectors): empty text matcher (#9548) 2021-10-15 17:00:45 -07:00
selectors-vue.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
wheel.spec.ts test: unflake wheel test in ff (#9989) 2021-11-02 13:56:12 -07:00
workers.spec.ts fix(evaluate): reject all context operations when frame detaches (#9987) 2021-11-03 10:44:50 -07:00