Commit graph

23 commits

Author SHA1 Message Date
Dmitry Gozman f587a43932
feat(locator): "has" option (#11411)
This introduces `locator('div', { has: locator })` syntax that matches elements containing other elements.
Can be used together with `hasText`.

Internally, has selector engine takes an inner selector escaped with double-quotes:
`div >> has="li >> span >> text=Foo" >> span`.
2022-02-02 16:55:50 -08:00
Pavel Feldman 815e121445
feat(highlight): update highlight from raf (#11443) 2022-01-17 18:33:35 -08:00
Pavel Feldman a12e76b52b
chore: implement locator._highlight / playwright._hideHighlight (#11339) 2022-01-12 07:37:48 -08:00
Dmitry Gozman 976dedda45
feat(input): restore modified layout shift check (#11032)
This changes previous layout shift attempt (see #9546)
to account for more valid usecases:
- On the first event that is intercepted we enforce the hit target. This
  is similar to the current mode that checks hit target before the action,
  but is better timed.
- On subsequent events we assume that everything is fine. This covers more
  scenarios like react rerender, glass pane on mousedown, detach on mouseup.

This check is enabled by default, with `process.env.PLAYWRIGHT_NO_LAYOUT_SHIFT_CHECK`
to opt out.
2022-01-03 17:46:04 -08:00
Dmitry Gozman ec74fa6a76
feat(fill): support color and range input types (#10736) 2021-12-06 15:43:10 -08:00
Pavel Feldman 31e0a63fcd
feat(toBeChecked): allow passing checked: false (#10665) 2021-12-02 10:31:26 -08:00
Pavel Feldman 2ac9c08d0c
feat(inputValue): allow on labels, retarget (#10666) 2021-12-02 10:31:06 -08:00
Pavel Feldman 127dacf5d4
fix(toHaveText): normalize zero width white space (#10623) 2021-12-01 09:21:21 -08:00
Joel Einbinder 06ab3c0fda
feat: consider fieldset and aria-disabled when checking if an element is enabled (#9927)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2021-11-22 20:25:06 +01:00
Dmitry Gozman 9ec3e7cd52
fix(click): account for detached elements and iframe overlays (#10206) 2021-11-10 12:14:06 -08:00
Pavel Feldman 4553d76fce
api(frame-locator): introduce frame locators (#10102) 2021-11-08 09:58:24 -08:00
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
Pavel Feldman 2ae2136810
chore: do not carry selector next to parsed selector (#10004) 2021-11-03 08:35:01 -07:00
Dmitry Gozman 9cfbc0c171
chore(expect): simplify expect array edge cases (#9942) 2021-11-01 16:42:13 -07:00
Dmitry Gozman 50f7477906
chore: use progress.continuePolling instead of passing it around (#9929) 2021-11-01 13:57:13 -07:00
Dmitry Gozman 4ff69529d4
chore: detect document open for inspector (#9901)
To be used later for other global event listeners.
2021-10-30 16:06:52 -07:00
Dmitry Gozman b244f035bc
chore: small cleanups around actions (#9895) 2021-10-29 22:27:57 -07:00
Yury Semikhatsky 1886897e5c
fix(matchers): support builtin types (#9865) 2021-10-28 18:45:59 -07:00
Pavel Feldman ff16ac0351
chore(html): html report polish (#9600) 2021-10-18 18:33:38 -07:00
Yury Semikhatsky fd81982c33
fix(selectors): combine visible with other selectors (#9585) 2021-10-18 10:47:37 -07:00
Dmitry Gozman 64a3099655
chore(expect): simplify expect implementation (#9459) 2021-10-13 08:56:57 -07:00
Pavel Feldman 876e08315b
fix(expect): continue polling in array-based matchers, fix edge cases (#9430) 2021-10-11 14:01:09 -07:00
Joel Einbinder c89d5a50dd
chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
Renamed from src/server/injected/injectedScript.ts (Browse further)