117 Commits

Author SHA1 Message Date
Pavel Feldman
3371fb9bea
chore: do not leak pw internals (#35721) 2025-04-23 21:53:17 -07:00
Dmitry Gozman
c9a1ad4d8d
chore: use a singleton "builtins" instead of passing it around (#35493) 2025-04-10 09:30:39 +01:00
Yury Semikhatsky
f9d9c5c512
chore: merge server/isomorphic into utils/isomorphic (#35480) 2025-04-03 13:36:50 -07:00
Dmitry Gozman
0467c28722
chore: builtins (#35197) 2025-03-25 13:49:28 +00:00
Yury Semikhatsky
962a752832
chore: contain remote objects to browser-specific code (#34890) 2025-02-21 16:52:39 -08:00
Yury Semikhatsky
145b6bf4fe
chore: browser independent setInputFiles implementation (#34808) 2025-02-14 16:44:27 -08:00
Pavel Feldman
8b28e637c8
chrome: remove state from isomorphic utils (#34795) 2025-02-14 15:10:50 -08:00
Pavel Feldman
3d760b657b
chore: move debug, env and user agent from utils/ (#34766) 2025-02-12 19:27:24 -08:00
Pavel Feldman
0eeba380f2
chore: move crypto to server/util/ (#34759) 2025-02-12 14:43:52 -08:00
Pavel Feldman
f54478a23e
chore: move utils that are user in server to server/utils (3) (#34739) 2025-02-12 09:34:01 -08:00
Pavel Feldman
25a168fae5
chore: move utils that are user in server to server/utils (1) (#34734) 2025-02-11 15:40:41 -08:00
Pavel Feldman
4a7f6a6ef0
chore: organize imports in playwright-core (#34680) 2025-02-07 13:54:01 -08:00
Simon Knott
5d82567346
feat: emulate prefers-contrast (#34494) 2025-02-04 11:15:51 +01:00
Dmitry Gozman
9dbe63636d
fix(routeWebSocket): should work after context reuse (#34165) 2024-12-30 10:00:10 -08:00
Dmitry Gozman
f713d3adaf
chore: simplify page initialization logic across browser types (#34002) 2024-12-14 20:15:58 +00:00
Max Schmitt
e3629dc1df
fix: validate ffmpeg on context creation (#33903) 2024-12-11 23:07:03 -08:00
Pavel Feldman
c76f004ec3
chore: move compress call log to server (#33399) 2024-11-01 13:38:01 -07:00
Yury Semikhatsky
1e8884621a
chore: unify toHaveScreenshot error formatting (#33300) 2024-10-25 12:36:39 -07:00
Yury Semikhatsky
b9cce598dd
fix(screenshot): show image diff inline in errors list (#32997)
The diff is now shown inline in the errors list.

There are 2 possible failures of toHaveScreenshot
* Previous and actual snapshot mismatch. In this case html report will
show diff between Actual/Previous and have Expected as a separate
screenshot.
* Actual/Previous are equal but they differ from the expected. In this
case html report only contains Actual/Expected images and the diff.

Reference: https://github.com/microsoft/playwright/issues/32341

<img width="1039" alt="image"
src="https://github.com/user-attachments/assets/b458f986-cc25-4721-862c-0cc2c1b01a42">
2024-10-10 16:49:17 -07:00
Dmitry Gozman
84b4fd4e40
feat: wait for pending navigation to resolve before many actions (#32899)
This includes all actions that perform locator handler check.
    
Note this makes it impossible to interact with the page while a main
frame navigation is ongoing. This was already the case for Chromium, but
now WebKit and Firefox align with it.

Setting `PLAYWRIGHT_SKIP_NAVIGATION_CHECK` environment variable disables
this behavior.
2024-10-04 07:25:18 -07:00
Dmitry Gozman
a9d5c39d40
chore: address api review for page.forceGarbageCollection (#32824)
- Renamed to `page.requestGC`.
- Added a useful snippet to the docs.

References #32278.

---------

Signed-off-by: Dmitry Gozman <dgozman@gmail.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2024-09-26 05:08:33 -07:00
Dmitry Gozman
f9d9ad25de
feat(locator handler): perform checkpoit during locator.waitFor (#32683)
Fixes #32255.
2024-09-18 09:34:06 -07:00
Matthew Jee
f2a974b045
feat(api): add method to force garbage collection (#32383) 2024-09-13 23:09:36 +02:00
Rui Figueira
f8562e4ca7
chore: improve error message when Array.toJSON misbehaves (#32508)
Fixes: #32507
2024-09-10 04:14:24 -07:00
Yury Semikhatsky
37bc485827
chore: remove browser-specific bidi hacks (#32498)
Those were just workarounds for browser-specific bugs, they should be
fixed upstream.
* individual mouse down/up/down/up events don't trigger dblclick event
in Firefox
* setContent throws when document.open/write is called in the utility
context in Firefox
2024-09-06 16:40:24 -07:00
Yury Semikhatsky
9a2c60a77c
chore: identify largest gaps in Bidi API (#32434)
This pull request introduces initial support for the WebDriver BiDi
protocol in Playwright. The primary goal of this PR is not to fully
implement BiDi but to experiment with the current state of the
specification and its implementation. We aim to identify the biggest
gaps and challenges that need to be addressed before considering BiDi as
the main protocol for Playwright.
2024-09-04 11:36:52 -07:00
Dmitry Gozman
f8eef3897c
chore: move urlMatch to isomorphic (#32142)
To be reused in injected code.
2024-08-13 12:47:02 -07:00
Dmitry Gozman
9b3e0e5667
chore: simplify binding result dispatch (#32092)
We can now pass an Error object through evaluate.
2024-08-09 03:46:52 -07:00
Dmitry Gozman
ea747afcdd
chore: use a single binding for all Playwright needs (#32039)
This makes it easier to manage bindings, being just init scripts.
Fixes the BFCache binding problem.
Makes bindings removable in Firefox.

Fixes #31515.
2024-08-07 06:20:12 -07:00
Dmitry Gozman
229000501e
chore: introduce helpers for non-stalling eval on page/context (#31658) 2024-07-12 02:26:16 -07:00
Pavel Feldman
c9e673c6dc
fix(utility): create utility world when web security is disabled (#31458)
Reverts previous attempt at #31096

Fixes: https://github.com/microsoft/playwright/issues/31431
Fixes: https://github.com/microsoft/playwright/issues/31442
2024-06-27 09:29:20 -07:00
Pavel Feldman
96f3d19819
feat(ctrl_or_meta): add a universal ctrl-meta modifier (#30572)
Fixes https://github.com/microsoft/playwright/issues/12168
2024-04-29 08:15:12 -07:00
Dmitry Gozman
9bd2aea130
feat(locator handler): address api review feedback (#30554)
- Remove `handler` argument from `removeLocatorHandler`.
- Rename `allowStayingVisible` into `noWaitAfter`.
- Improve logging related to locator handler.
- Remove experimental badges.
2024-04-25 14:00:02 -07:00
Dmitry Gozman
59689c9c97
feat(addLocatorHandler): various improvements (#30494)
- Automatically waiting for the overlay locator to be hidden, with
`allowStayingVisible` opt-out.
- `times: 1` option.
- `removeLocatorHandler(locator, handler)` method.
- Passing `locator` as first argument to `handler`.

Fixes #30471. Fixes #30424. Fixes #29779.
2024-04-24 15:19:12 -07:00
Karl Horky
914208c567
chore: fix typo in property name (#29907) 2024-03-13 12:22:40 +01:00
Dmitry Gozman
349b25e61a
fix(storageState): try to collect storage state on existing pages first (#29915)
This helps in a case where navigating to an origin fails for some
reason, for example because a registered service worker loads some
content into the supposedly blank page.

Fixes #29402.
2024-03-12 19:20:35 -07:00
Dmitry Gozman
0f30cdab23
feat(firefox): roll ff and ff-beta to 1442 (#29751)
This requires changes in `FFPage`.
Also fixing a new ff-specific test that introduced flakiness on the
bots.

Closes https://github.com/microsoft/playwright/pull/29750
Closes https://github.com/microsoft/playwright/pull/29724
Closes https://github.com/microsoft/playwright/pull/29681
Closes https://github.com/microsoft/playwright/pull/29678
2024-02-29 14:44:45 -08:00
Dmitry Gozman
61955e55b1
fix(handleLocator): address API review feedback (#29412)
- docs improvements;
- `force: true` ignores `handleLocator`;
- wrapping an internal call;
- more test cases;
- `pw:api` log entries for this API.
2024-02-08 07:39:05 -08:00
Pavel Feldman
20699c36ba
chore: simplify types handling in toHaveScreenshot (#29374) 2024-02-05 19:07:30 -08:00
Pavel Feldman
aff6cf3c83
chore: extract ws server util (#29247) 2024-01-30 14:36:51 -08:00
Dmitry Gozman
f3fac6f4e9
feat: page.handleLocator that closes any interstitial pages/dialogs (#29029) 2024-01-19 12:35:00 -08:00
Pavel Feldman
76ace0fc09
chore: workaround webkit screenshot animation issue (#28582) 2023-12-11 18:20:24 -08:00
Pavel Feldman
3aa147914c
chore: split error to client and server sides (#27672) 2023-10-17 21:34:02 -07:00
Pavel Feldman
091f6883f5
chore: remove the usages of raw target closed message constant (#27669) 2023-10-17 15:35:41 -07:00
Pavel Feldman
a54dbfdadf
chore: plumb the target close reason when test fails (#27640) 2023-10-16 20:32:13 -07:00
Pavel Feldman
f212fd1a83
chore: unify target closed errors (#27540) 2023-10-12 11:05:34 -07:00
Jim Hays
dcc8dcca73
Fix various typos (Fixes #27396) (#27391)
Fixes https://github.com/microsoft/playwright/issues/27396
2023-10-04 19:56:42 -07:00
Dmitry Gozman
c8143748e6
chore: remove Page._didDisconnect (#27317)
Instead of having `didClose` based on page creation/destruction and
`didDisconnect` based on session lifetime, we make session lifetime
being managed by the `CRPage`/`FFPage`/`WKPage` instead.
2023-09-27 14:09:56 -07:00
Pavel Feldman
99b8ca2be2
chore: flush har when recording tracing (#26746) 2023-08-28 17:44:48 -07:00
Vignesh Shanmugam
adc9b2d390
feat: add support for browserContext.on('pageerror') (#24452)
+ fix #24466
+ Adds support for exposing the `pageerror` events via `browserContext`
API.
+ Helps with capturing the overall exceptions that are thrown outside of
the the current page and also captures the exceptions happens on other
windows/popups.
+ Keeps the API in sync with `context.on('request)',
context.on('console'), etc..`
2023-08-17 09:10:03 -07:00