From ca5d6a6ba207aaaec5a606c11001977d89820e2f Mon Sep 17 00:00:00 2001 From: "microsoft-playwright-automation[bot]" <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2026 10:04:37 +0000 Subject: [PATCH] chore: roll Playwright to 1.66.0-next (3b438229c6) --- DRIVER_VERSION | 2 +- playwright/_impl/_protocol.py | 5 ++ playwright/_impl/browser_context.py | 2 + playwright/_impl/locator.py | 2 + playwright/_impl/protocol/validator.py | 6 +++ playwright/_impl/protocol_channels.py | 10 ++++ playwright/_impl/protocol_types.py | 1 + playwright/async_api/_generated.py | 8 ++++ playwright/sync_api/_generated.py | 8 ++++ tests/assets/extension-mv3-simple/index.js | 4 ++ .../async/library/chromium/test_extensions.py | 22 ++++++++- .../test_browsercontext_network_event.py | 26 ++++++++++- tests/async/library/test_emulation_focus.py | 23 ++++++++++ tests/async/library/test_global_fetch.py | 27 +++++++++++ tests/async/library/test_locator_highlight.py | 14 +++--- tests/async/library/test_page_clock.py | 20 ++++++-- tests/async/library/test_page_event_crash.py | 7 ++- tests/async/library/test_screencast.py | 9 ++-- tests/async/library/test_web_socket.py | 25 +++++++++- tests/async/page/test_page_event_popup.py | 46 ++++++++++++++++++- tests/async/page/test_page_filechooser.py | 37 +++++++++------ .../async/page/test_page_network_response.py | 28 +++++++++++ tests/async/page/test_page_screenshot.py | 45 ++++++++++++++++++ tests/async/page/test_selectors_get_by.py | 33 +++++++++++++ .../sync/library/chromium/test_extensions.py | 22 ++++++++- .../test_browsercontext_network_event.py | 26 ++++++++++- tests/sync/library/test_emulation_focus.py | 23 ++++++++++ tests/sync/library/test_global_fetch.py | 30 +++++++++++- tests/sync/library/test_locator_highlight.py | 14 +++--- tests/sync/library/test_page_clock.py | 20 ++++++-- tests/sync/library/test_page_event_crash.py | 7 ++- tests/sync/library/test_screencast.py | 9 ++-- tests/sync/library/test_web_socket.py | 25 +++++++++- tests/sync/page/test_page_event_popup.py | 46 ++++++++++++++++++- tests/sync/page/test_page_filechooser.py | 39 +++++++++------- tests/sync/page/test_page_network_response.py | 28 +++++++++++ tests/sync/page/test_page_screenshot.py | 45 ++++++++++++++++++ tests/sync/page/test_selectors_get_by.py | 33 +++++++++++++ tests/upstream_not_ported.txt | 2 + tests/upstream_registry.md | 8 ++++ 40 files changed, 716 insertions(+), 71 deletions(-) diff --git a/DRIVER_VERSION b/DRIVER_VERSION index 7f0db5693..851304148 100644 --- a/DRIVER_VERSION +++ b/DRIVER_VERSION @@ -1 +1 @@ -a1f35e1955976e84411f9c10358228a80b763ebe +3b438229c6a2ccdbe2d3572755935892203d83c3 diff --git a/playwright/_impl/_protocol.py b/playwright/_impl/_protocol.py index 3e0d7384c..10503a598 100644 --- a/playwright/_impl/_protocol.py +++ b/playwright/_impl/_protocol.py @@ -634,6 +634,7 @@ }, }, "strictSelectors": "boolean?", + "locateOnlyVisible": "boolean?", "serviceWorkers": {"type": "enum?", "literals": ["allow", "block"]}, "selectorEngines": {"type": "array?", "items": "SelectorEngine"}, "testIdAttributeName": "string?", @@ -821,6 +822,7 @@ }, }, "strictSelectors": "boolean?", + "locateOnlyVisible": "boolean?", "serviceWorkers": {"type": "enum?", "literals": ["allow", "block"]}, "selectorEngines": {"type": "array?", "items": "SelectorEngine"}, "testIdAttributeName": "string?", @@ -949,6 +951,7 @@ }, }, "strictSelectors": "boolean?", + "locateOnlyVisible": "boolean?", "serviceWorkers": {"type": "enum?", "literals": ["allow", "block"]}, "selectorEngines": {"type": "array?", "items": "SelectorEngine"}, "testIdAttributeName": "string?", @@ -1285,6 +1288,7 @@ }, }, "strictSelectors": "boolean?", + "locateOnlyVisible": "boolean?", "serviceWorkers": {"type": "enum?", "literals": ["allow", "block"]}, "selectorEngines": {"type": "array?", "items": "SelectorEngine"}, "testIdAttributeName": "string?", @@ -1375,6 +1379,7 @@ }, }, "strictSelectors": "boolean?", + "locateOnlyVisible": "boolean?", "timezoneId": "string?", "tracesDir": "string?", "artifactsDir": "string?", diff --git a/playwright/_impl/browser_context.py b/playwright/_impl/browser_context.py index 306c47f4d..958ecdfb5 100644 --- a/playwright/_impl/browser_context.py +++ b/playwright/_impl/browser_context.py @@ -944,6 +944,8 @@ async def prepare_browser_context_params(options: Dict[str, Any]) -> Dict[str, A else None ), "strictSelectors": options.get("strict_selectors"), + # Python: locateOnlyVisible is JavaScript-only (docs: langs: js). + "locateOnlyVisible": None, "selectorEngines": options.get("selectorEngines"), "testIdAttributeName": options.get("testIdAttributeName"), "proxy": options.get("proxy"), diff --git a/playwright/_impl/locator.py b/playwright/_impl/locator.py index 6888d1ac0..c17406b3a 100644 --- a/playwright/_impl/locator.py +++ b/playwright/_impl/locator.py @@ -139,6 +139,8 @@ def __init__( # Not ported: util.inspect.custom is Node.js only; __repr__() is the Python # counterpart. + # Not ported: selectorForQuery() supports locateOnlyVisible (langs: js). + def _wrap_api_call( self, func: Callable[[ApiZone], Awaitable[R]], diff --git a/playwright/_impl/protocol/validator.py b/playwright/_impl/protocol/validator.py index c8f925af7..9fa10c900 100644 --- a/playwright/_impl/protocol/validator.py +++ b/playwright/_impl/protocol/validator.py @@ -324,6 +324,7 @@ ) ), "strictSelectors": t_optional(t_boolean), + "locateOnlyVisible": t_optional(t_boolean), "serviceWorkers": t_optional(t_enum(["allow", "block"])), "selectorEngines": t_optional(t_array(t_type("SelectorEngine"))), "testIdAttributeName": t_optional(t_string), @@ -783,6 +784,7 @@ ) ), "strictSelectors": t_optional(t_boolean), + "locateOnlyVisible": t_optional(t_boolean), "serviceWorkers": t_optional(t_enum(["allow", "block"])), "selectorEngines": t_optional(t_array(t_type("SelectorEngine"))), "testIdAttributeName": t_optional(t_string), @@ -923,6 +925,7 @@ ) ), "strictSelectors": t_optional(t_boolean), + "locateOnlyVisible": t_optional(t_boolean), "serviceWorkers": t_optional(t_enum(["allow", "block"])), "selectorEngines": t_optional(t_array(t_type("SelectorEngine"))), "testIdAttributeName": t_optional(t_string), @@ -1100,6 +1103,7 @@ ) ), "strictSelectors": t_optional(t_boolean), + "locateOnlyVisible": t_optional(t_boolean), "serviceWorkers": t_optional(t_enum(["allow", "block"])), "selectorEngines": t_optional(t_array(t_type("SelectorEngine"))), "testIdAttributeName": t_optional(t_string), @@ -1717,6 +1721,7 @@ ) ), "strictSelectors": t_optional(t_boolean), + "locateOnlyVisible": t_optional(t_boolean), "serviceWorkers": t_optional(t_enum(["allow", "block"])), "selectorEngines": t_optional(t_array(t_type("SelectorEngine"))), "testIdAttributeName": t_optional(t_string), @@ -1869,6 +1874,7 @@ ) ), "strictSelectors": t_optional(t_boolean), + "locateOnlyVisible": t_optional(t_boolean), "timezoneId": t_optional(t_string), "tracesDir": t_optional(t_string), "artifactsDir": t_optional(t_string), diff --git a/playwright/_impl/protocol_channels.py b/playwright/_impl/protocol_channels.py index 94220c522..8de46b6c6 100644 --- a/playwright/_impl/protocol_channels.py +++ b/playwright/_impl/protocol_channels.py @@ -332,6 +332,7 @@ def launchBrowser( baseURL: Optional[str], recordVideo: Optional[channels.AndroidDeviceLaunchBrowserParamsRecordVideo], strictSelectors: Optional[bool], + locateOnlyVisible: Optional[bool], serviceWorkers: Optional[Literal["allow", "block"]], selectorEngines: Optional[Sequence[channels.SelectorEngine]], testIdAttributeName: Optional[str], @@ -369,6 +370,7 @@ def launchBrowser( "baseURL": baseURL, "recordVideo": recordVideo, "strictSelectors": strictSelectors, + "locateOnlyVisible": locateOnlyVisible, "serviceWorkers": serviceWorkers, "selectorEngines": selectorEngines, "testIdAttributeName": testIdAttributeName, @@ -816,6 +818,7 @@ def newContext( baseURL: Optional[str], recordVideo: Optional[channels.BrowserNewContextParamsRecordVideo], strictSelectors: Optional[bool], + locateOnlyVisible: Optional[bool], serviceWorkers: Optional[Literal["allow", "block"]], selectorEngines: Optional[Sequence[channels.SelectorEngine]], testIdAttributeName: Optional[str], @@ -852,6 +855,7 @@ def newContext( "baseURL": baseURL, "recordVideo": recordVideo, "strictSelectors": strictSelectors, + "locateOnlyVisible": locateOnlyVisible, "serviceWorkers": serviceWorkers, "selectorEngines": selectorEngines, "testIdAttributeName": testIdAttributeName, @@ -894,6 +898,7 @@ def newContextForReuse( baseURL: Optional[str], recordVideo: Optional[channels.BrowserNewContextForReuseParamsRecordVideo], strictSelectors: Optional[bool], + locateOnlyVisible: Optional[bool], serviceWorkers: Optional[Literal["allow", "block"]], selectorEngines: Optional[Sequence[channels.SelectorEngine]], testIdAttributeName: Optional[str], @@ -930,6 +935,7 @@ def newContextForReuse( "baseURL": baseURL, "recordVideo": recordVideo, "strictSelectors": strictSelectors, + "locateOnlyVisible": locateOnlyVisible, "serviceWorkers": serviceWorkers, "selectorEngines": selectorEngines, "testIdAttributeName": testIdAttributeName, @@ -1804,6 +1810,7 @@ def launchPersistentContext( channels.BrowserTypeLaunchPersistentContextParamsRecordVideo ], strictSelectors: Optional[bool], + locateOnlyVisible: Optional[bool], serviceWorkers: Optional[Literal["allow", "block"]], selectorEngines: Optional[Sequence[channels.SelectorEngine]], testIdAttributeName: Optional[str], @@ -1857,6 +1864,7 @@ def launchPersistentContext( "baseURL": baseURL, "recordVideo": recordVideo, "strictSelectors": strictSelectors, + "locateOnlyVisible": locateOnlyVisible, "serviceWorkers": serviceWorkers, "selectorEngines": selectorEngines, "testIdAttributeName": testIdAttributeName, @@ -1940,6 +1948,7 @@ def launch( offline: Optional[bool], recordVideo: Optional[channels.ElectronLaunchParamsRecordVideo], strictSelectors: Optional[bool], + locateOnlyVisible: Optional[bool], timezoneId: Optional[str], tracesDir: Optional[str], artifactsDir: Optional[str], @@ -1966,6 +1975,7 @@ def launch( "offline": offline, "recordVideo": recordVideo, "strictSelectors": strictSelectors, + "locateOnlyVisible": locateOnlyVisible, "timezoneId": timezoneId, "tracesDir": tracesDir, "artifactsDir": artifactsDir, diff --git a/playwright/_impl/protocol_types.py b/playwright/_impl/protocol_types.py index 9ead111e8..54053e0ad 100644 --- a/playwright/_impl/protocol_types.py +++ b/playwright/_impl/protocol_types.py @@ -570,6 +570,7 @@ class BrowserContextInitializerOptions(TypedDict): baseURL: NotRequired[str] recordVideo: NotRequired[BrowserContextInitializerOptionsRecordVideo] strictSelectors: NotRequired[bool] + locateOnlyVisible: NotRequired[bool] serviceWorkers: NotRequired[Literal["allow", "block"]] selectorEngines: NotRequired[List[SelectorEngine]] testIdAttributeName: NotRequired[str] diff --git a/playwright/async_api/_generated.py b/playwright/async_api/_generated.py index 20a507beb..6d2c2ade7 100644 --- a/playwright/async_api/_generated.py +++ b/playwright/async_api/_generated.py @@ -7958,6 +7958,8 @@ def get_by_label( Allows locating input elements by the text of the associated `