173 Commits

Author SHA1 Message Date
Adam Gastineau
d6a4c1cda4
chore: restore to.have.url matching via injected script (#35027) 2025-03-04 11:52:59 -08:00
Dmitry Gozman
9e0be8ee7c
chore: unblock 1.51 dotnet roll (#35016) 2025-03-04 15:01:15 +00:00
Pavel Feldman
4a7f6a6ef0
chore: organize imports in playwright-core (#34680) 2025-02-07 13:54:01 -08:00
Pavel Feldman
bd2fdd0f20
chore: land experimental tools (#34503) 2025-01-27 14:49:38 -08:00
Adam Gastineau
f65dc0cee4
feat: toHaveURL predicate matcher (#34413) 2025-01-24 06:00:17 -08:00
Yury Semikhatsky
587e778a5a
Revert "feat(aria): extend toHaveAccessibleName() to accept an array … (#34361) 2025-01-16 15:04:56 -08:00
Pavel Feldman
0c8a6b80fb
chore: consolidate aria parser in isomorphic bundle (#34298) 2025-01-10 15:32:35 -08:00
Pavel Feldman
13bdd3c92f
feat(toBeChecked): allow indeterminate expectation (#34269) 2025-01-09 18:18:15 -08:00
Yury Semikhatsky
edfbab2a79
fix: dispatch touch events in webkit (#34250) 2025-01-08 11:06:30 -08:00
Pavel Feldman
0d34369fc0
chore: include actual value in the elementState (#34245) 2025-01-07 15:31:18 -08:00
Pavel Feldman
7923d35e32
fix(retarget): do not unconditionally retarget to enclosing label (#34229) 2025-01-07 11:15:00 -08:00
Yury Semikhatsky
8b45ea6f2f
chore: properly initialize Touch arguments in TouchEvent (#34200) 2025-01-03 12:16:01 -08:00
Pengoose
7f141b2c42
feat: expect(locator).toHaveAccessibleErrorMessage (#33904) 2024-12-27 09:54:16 +00:00
Pavel Feldman
94d0fc780d
chore: make visible=false work (#34040) 2024-12-16 14:14:51 -08:00
Dmitry Gozman
f123f7ac69
fix: isEditable/toBeEditable throw for elements that cannot be editable/readonly (#33713) 2024-11-22 03:40:43 -08:00
aairiian
7f054ef8c6
feat(aria): extend toHaveAccessibleName() to accept an array of expected accessible names (#33277) 2024-11-18 07:46:47 -08:00
Pavel Feldman
d127255881
chore: add AriaSnapshot internal type (#33631) 2024-11-15 13:48:43 -08:00
Pavel Feldman
b021b58379
chore: allow editing aria template in recorder (#33482) 2024-11-08 07:43:01 -08:00
Pavel Feldman
a2e901e080
chore: generate aria name regex when possible (#33373) 2024-10-31 11:25:38 -07:00
Dmitry Gozman
993a6b2a2a
fix(recorder): do not leak when instantiated in snapshots (#33240) 2024-10-23 10:24:53 -07:00
Pavel Feldman
94321fef1c
chore: implement locator.ariaSnapshot (#33125) 2024-10-15 18:47:26 -07:00
Pavel Feldman
4b1fbde2ad
chore: generate match snapshot (#33105) 2024-10-15 13:38:55 -07:00
Pavel Feldman
a38ff6e0d8
chore: experimental toMatchAriaSnapshot (#33014) 2024-10-14 14:07:19 -07:00
Dmitry Gozman
3c5967d4f5
fix(trace viewer): clear old highlighted elements upon change (#32917)
When the list of highlighted elements changes over time, we should
update the elements marked as `__playwright_target__` in the snapshot.

A good example is an `expect(locator).toHaveText([...])` where the list
of elements changes from 4 items to 3 after clicking a "Delete" button.
2024-10-02 23:48:26 -07:00
Pavel Feldman
74a8e59096
chore: allow recorder rewrite annotations (#32381) 2024-08-29 14:16:01 -07:00
Pavel Feldman
bc87467b25
chore: generate simple dom descriptions in codegen (#32333) 2024-08-27 11:52:14 -07:00
Dmitry Gozman
ac90a47b73
fix(click): do not retarget <a> to the parent <label> (#31368)
Fixes #31359.
2024-06-18 12:12:19 -07:00
Yury Semikhatsky
9e6772818e
chore: cache normalized whitespaces in recorder (#31349)
Reference: https://github.com/microsoft/playwright/issues/31254

On the web page from the bug it reduces time to compute selectors by 8x:

**Before:**
<img width="549" alt="before"
src="https://github.com/microsoft/playwright/assets/9798949/f4482860-29d5-4643-92ab-b360a702f232">

**After:**
<img width="580" alt="after"
src="https://github.com/microsoft/playwright/assets/9798949/b6aca6a1-9306-4041-9042-d504dce1c33a">
2024-06-17 18:20:15 -07:00
Pavel Feldman
826343b8a0
chore: rename fakeTimers to clock (#31193) 2024-06-06 15:56:13 -07:00
Pavel Feldman
8bfd0eb6e4
chore: introduce clock test mode (#31110) 2024-05-31 14:44:26 -07:00
Joe-Hendley
afa0bf2247
feat: increase length of printed html tags (#31105)
resolves https://github.com/microsoft/playwright/issues/30977 by
increasing the printed length of HTML tags from 50 -> 500 as suggested
by @dgozman
2024-05-31 10:45:56 -07:00
Dmitry Gozman
6d20da568e
feat: expect(locator).toHaveRole(role) (#30555)
References #13517. Fixes #18332.
2024-04-25 15:26:10 -07:00
Dmitry Gozman
4a275b8eca
feat: expect(locator).toHaveAccessibleDescription (#30463)
References #18332.
2024-04-22 12:33:30 -07:00
Dmitry Gozman
9b6627a063
feat(role): roll and pass WPT accname tests, calculate description (#30434)
There are new "non-manual" WPT accname tests that we now mostly pass,
which required a few tweeks in calculating role and name.

Also implemented accessible description computation, which is just a
small addition on top of accessible name, and passed respective wpt
tests.

References #18332.
2024-04-19 12:49:49 -07:00
Dmitry Gozman
eea1f9984f
feat: expect(locator).toHaveAccessibleName (#30420)
References #18332.
2024-04-18 12:28:55 -07:00
Max Schmitt
b2ded9fed1
fix(expect): throw better received error when no element was found (#29890)
Fixes https://github.com/microsoft/playwright/issues/29873
2024-04-10 10:01:19 +02:00
Peng Xiao
cc881fdb1f
fix: content editable retarget (#29792)
If `contenteditable` is wrapped into a button or `[role=button]`,
`element.fill` will incorrectly retarget the closest button element.

fix https://github.com/microsoft/playwright/issues/29813
2024-04-01 13:03:09 -07:00
Dmitry Gozman
8e607d509f
fix(recorder): disallow external imports (#29129)
Previously, new `Recorder` instance was given an existing
`InjectedScript`. However, we built a separate source for
`InjectedScript` vs `Recorder`, and both bundles contain their own copy
of all helper modules, e.g. `roleUtils`.

This resulted in two copies of helper modules, which is troublesome for
any module-level globals like a top-level cache. Depending on whether
`Recorder` or `InjectedScript` called into the helper, they would access
the different value of a module global, which lead to bugs.

To prevent this, we force any external dependencies to be imported
through the `InjectedScript.utils`.
2024-01-23 11:29:40 -08:00
Dmitry Gozman
9b974e0026
chore: speedup frequent element text normalization (#29113)
We cache `ElementText` for frequent operations, but then call
`normalizeWhitespace` on it every time which burns a lot of CPU.
2024-01-22 21:33:56 -08:00
Dmitry Gozman
e6d51cf7bd
chore: refactor actionability check to go through node-side retry (#28982)
This allows to inject a checkpoint in between the actionability checks.

Drive-by: cleanup `InjectedScriptPoll`-related code.
2024-01-16 19:11:41 -08:00
Yury Semikhatsky
ff99aa33b0
fix: input events triggered by playwright actions should have composed=true (#28730)
Fixes https://github.com/microsoft/playwright/issues/28726
2023-12-21 15:25:16 -08:00
Pavel Feldman
0a7a10d0f6
feat(vrt): allow providing screenshot style (#28229) 2023-11-30 17:42:45 -08:00
Playwright Service
bb241abaff
feat(webkit): roll to r1944 (#28148)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-11-15 19:34:53 +01:00
Mattias Wallander
c6d154f9c4
feat: Add support for dispatching device motion events (#28067)
References #27887.
2023-11-13 08:58:46 -08:00
Max Schmitt
5f527fedb1
fix: JSHandle preview text for non-ascii attributes/children (#28038)
This surfaced in .NET that the string in the driver got incorrectly cut,
then transferred to .NET as an invalid UTF8 character
[`\ud835`](https://charbase.com/d835-unicode-invalid-character) which
.NET wasn't able to parse and threw an error.

Drive-by: Move similar function from
`packages/playwright-core/src/client/page.ts` into isomorphic
`stringUtils`.

https://github.com/microsoft/playwright-dotnet/issues/2748
2023-11-09 00:11:01 +01:00
Mattias Wallander
5a9fa69c6d
feat: Add support for dispatching device orientation events (#27960)
Fixes #27887
2023-11-08 09:50:25 -08:00
Yury Semikhatsky
36c4c24f8a
fix: only convert input files for browser collocated with server (#27873)
Reference #27452
Fixes #27792
2023-11-01 08:40:12 -07:00
Pavel Feldman
b807c974c3
chore: allow passing path to property in toHaveJSProperty (#27495)
Fixes https://github.com/microsoft/playwright/issues/27487
2023-10-06 15:47:07 -07:00
Yury Semikhatsky
ac48a47d33
feat: toHaveAttribute without value (#27418)
This time not doing it in other languages due to unjustified generator
complexity.

Fixes #27341
2023-10-04 09:27:28 -07:00
Dmitry Gozman
741c649d56
fix(trace viewer): make sure target inside shadow dom is highlighted (#26823)
References #24532.
2023-08-31 12:46:49 -07:00