Skip to content

Commit ca5d6a6

Browse files
chore: roll Playwright to 1.66.0-next (3b438229c6)
1 parent 89436fb commit ca5d6a6

40 files changed

Lines changed: 716 additions & 71 deletions

‎DRIVER_VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a1f35e1955976e84411f9c10358228a80b763ebe
1+
3b438229c6a2ccdbe2d3572755935892203d83c3

‎playwright/_impl/_protocol.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@
634634
},
635635
},
636636
"strictSelectors": "boolean?",
637+
"locateOnlyVisible": "boolean?",
637638
"serviceWorkers": {"type": "enum?", "literals": ["allow", "block"]},
638639
"selectorEngines": {"type": "array?", "items": "SelectorEngine"},
639640
"testIdAttributeName": "string?",
@@ -821,6 +822,7 @@
821822
},
822823
},
823824
"strictSelectors": "boolean?",
825+
"locateOnlyVisible": "boolean?",
824826
"serviceWorkers": {"type": "enum?", "literals": ["allow", "block"]},
825827
"selectorEngines": {"type": "array?", "items": "SelectorEngine"},
826828
"testIdAttributeName": "string?",
@@ -949,6 +951,7 @@
949951
},
950952
},
951953
"strictSelectors": "boolean?",
954+
"locateOnlyVisible": "boolean?",
952955
"serviceWorkers": {"type": "enum?", "literals": ["allow", "block"]},
953956
"selectorEngines": {"type": "array?", "items": "SelectorEngine"},
954957
"testIdAttributeName": "string?",
@@ -1285,6 +1288,7 @@
12851288
},
12861289
},
12871290
"strictSelectors": "boolean?",
1291+
"locateOnlyVisible": "boolean?",
12881292
"serviceWorkers": {"type": "enum?", "literals": ["allow", "block"]},
12891293
"selectorEngines": {"type": "array?", "items": "SelectorEngine"},
12901294
"testIdAttributeName": "string?",
@@ -1375,6 +1379,7 @@
13751379
},
13761380
},
13771381
"strictSelectors": "boolean?",
1382+
"locateOnlyVisible": "boolean?",
13781383
"timezoneId": "string?",
13791384
"tracesDir": "string?",
13801385
"artifactsDir": "string?",

‎playwright/_impl/browser_context.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,8 @@ async def prepare_browser_context_params(options: Dict[str, Any]) -> Dict[str, A
944944
else None
945945
),
946946
"strictSelectors": options.get("strict_selectors"),
947+
# Python: locateOnlyVisible is JavaScript-only (docs: langs: js).
948+
"locateOnlyVisible": None,
947949
"selectorEngines": options.get("selectorEngines"),
948950
"testIdAttributeName": options.get("testIdAttributeName"),
949951
"proxy": options.get("proxy"),

‎playwright/_impl/locator.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ def __init__(
139139
# Not ported: util.inspect.custom is Node.js only; __repr__() is the Python
140140
# counterpart.
141141

142+
# Not ported: selectorForQuery() supports locateOnlyVisible (langs: js).
143+
142144
def _wrap_api_call(
143145
self,
144146
func: Callable[[ApiZone], Awaitable[R]],

‎playwright/_impl/protocol/validator.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@
324324
)
325325
),
326326
"strictSelectors": t_optional(t_boolean),
327+
"locateOnlyVisible": t_optional(t_boolean),
327328
"serviceWorkers": t_optional(t_enum(["allow", "block"])),
328329
"selectorEngines": t_optional(t_array(t_type("SelectorEngine"))),
329330
"testIdAttributeName": t_optional(t_string),
@@ -783,6 +784,7 @@
783784
)
784785
),
785786
"strictSelectors": t_optional(t_boolean),
787+
"locateOnlyVisible": t_optional(t_boolean),
786788
"serviceWorkers": t_optional(t_enum(["allow", "block"])),
787789
"selectorEngines": t_optional(t_array(t_type("SelectorEngine"))),
788790
"testIdAttributeName": t_optional(t_string),
@@ -923,6 +925,7 @@
923925
)
924926
),
925927
"strictSelectors": t_optional(t_boolean),
928+
"locateOnlyVisible": t_optional(t_boolean),
926929
"serviceWorkers": t_optional(t_enum(["allow", "block"])),
927930
"selectorEngines": t_optional(t_array(t_type("SelectorEngine"))),
928931
"testIdAttributeName": t_optional(t_string),
@@ -1100,6 +1103,7 @@
11001103
)
11011104
),
11021105
"strictSelectors": t_optional(t_boolean),
1106+
"locateOnlyVisible": t_optional(t_boolean),
11031107
"serviceWorkers": t_optional(t_enum(["allow", "block"])),
11041108
"selectorEngines": t_optional(t_array(t_type("SelectorEngine"))),
11051109
"testIdAttributeName": t_optional(t_string),
@@ -1717,6 +1721,7 @@
17171721
)
17181722
),
17191723
"strictSelectors": t_optional(t_boolean),
1724+
"locateOnlyVisible": t_optional(t_boolean),
17201725
"serviceWorkers": t_optional(t_enum(["allow", "block"])),
17211726
"selectorEngines": t_optional(t_array(t_type("SelectorEngine"))),
17221727
"testIdAttributeName": t_optional(t_string),
@@ -1869,6 +1874,7 @@
18691874
)
18701875
),
18711876
"strictSelectors": t_optional(t_boolean),
1877+
"locateOnlyVisible": t_optional(t_boolean),
18721878
"timezoneId": t_optional(t_string),
18731879
"tracesDir": t_optional(t_string),
18741880
"artifactsDir": t_optional(t_string),

‎playwright/_impl/protocol_channels.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ def launchBrowser(
332332
baseURL: Optional[str],
333333
recordVideo: Optional[channels.AndroidDeviceLaunchBrowserParamsRecordVideo],
334334
strictSelectors: Optional[bool],
335+
locateOnlyVisible: Optional[bool],
335336
serviceWorkers: Optional[Literal["allow", "block"]],
336337
selectorEngines: Optional[Sequence[channels.SelectorEngine]],
337338
testIdAttributeName: Optional[str],
@@ -369,6 +370,7 @@ def launchBrowser(
369370
"baseURL": baseURL,
370371
"recordVideo": recordVideo,
371372
"strictSelectors": strictSelectors,
373+
"locateOnlyVisible": locateOnlyVisible,
372374
"serviceWorkers": serviceWorkers,
373375
"selectorEngines": selectorEngines,
374376
"testIdAttributeName": testIdAttributeName,
@@ -816,6 +818,7 @@ def newContext(
816818
baseURL: Optional[str],
817819
recordVideo: Optional[channels.BrowserNewContextParamsRecordVideo],
818820
strictSelectors: Optional[bool],
821+
locateOnlyVisible: Optional[bool],
819822
serviceWorkers: Optional[Literal["allow", "block"]],
820823
selectorEngines: Optional[Sequence[channels.SelectorEngine]],
821824
testIdAttributeName: Optional[str],
@@ -852,6 +855,7 @@ def newContext(
852855
"baseURL": baseURL,
853856
"recordVideo": recordVideo,
854857
"strictSelectors": strictSelectors,
858+
"locateOnlyVisible": locateOnlyVisible,
855859
"serviceWorkers": serviceWorkers,
856860
"selectorEngines": selectorEngines,
857861
"testIdAttributeName": testIdAttributeName,
@@ -894,6 +898,7 @@ def newContextForReuse(
894898
baseURL: Optional[str],
895899
recordVideo: Optional[channels.BrowserNewContextForReuseParamsRecordVideo],
896900
strictSelectors: Optional[bool],
901+
locateOnlyVisible: Optional[bool],
897902
serviceWorkers: Optional[Literal["allow", "block"]],
898903
selectorEngines: Optional[Sequence[channels.SelectorEngine]],
899904
testIdAttributeName: Optional[str],
@@ -930,6 +935,7 @@ def newContextForReuse(
930935
"baseURL": baseURL,
931936
"recordVideo": recordVideo,
932937
"strictSelectors": strictSelectors,
938+
"locateOnlyVisible": locateOnlyVisible,
933939
"serviceWorkers": serviceWorkers,
934940
"selectorEngines": selectorEngines,
935941
"testIdAttributeName": testIdAttributeName,
@@ -1804,6 +1810,7 @@ def launchPersistentContext(
18041810
channels.BrowserTypeLaunchPersistentContextParamsRecordVideo
18051811
],
18061812
strictSelectors: Optional[bool],
1813+
locateOnlyVisible: Optional[bool],
18071814
serviceWorkers: Optional[Literal["allow", "block"]],
18081815
selectorEngines: Optional[Sequence[channels.SelectorEngine]],
18091816
testIdAttributeName: Optional[str],
@@ -1857,6 +1864,7 @@ def launchPersistentContext(
18571864
"baseURL": baseURL,
18581865
"recordVideo": recordVideo,
18591866
"strictSelectors": strictSelectors,
1867+
"locateOnlyVisible": locateOnlyVisible,
18601868
"serviceWorkers": serviceWorkers,
18611869
"selectorEngines": selectorEngines,
18621870
"testIdAttributeName": testIdAttributeName,
@@ -1940,6 +1948,7 @@ def launch(
19401948
offline: Optional[bool],
19411949
recordVideo: Optional[channels.ElectronLaunchParamsRecordVideo],
19421950
strictSelectors: Optional[bool],
1951+
locateOnlyVisible: Optional[bool],
19431952
timezoneId: Optional[str],
19441953
tracesDir: Optional[str],
19451954
artifactsDir: Optional[str],
@@ -1966,6 +1975,7 @@ def launch(
19661975
"offline": offline,
19671976
"recordVideo": recordVideo,
19681977
"strictSelectors": strictSelectors,
1978+
"locateOnlyVisible": locateOnlyVisible,
19691979
"timezoneId": timezoneId,
19701980
"tracesDir": tracesDir,
19711981
"artifactsDir": artifactsDir,

‎playwright/_impl/protocol_types.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ class BrowserContextInitializerOptions(TypedDict):
570570
baseURL: NotRequired[str]
571571
recordVideo: NotRequired[BrowserContextInitializerOptionsRecordVideo]
572572
strictSelectors: NotRequired[bool]
573+
locateOnlyVisible: NotRequired[bool]
573574
serviceWorkers: NotRequired[Literal["allow", "block"]]
574575
selectorEngines: NotRequired[List[SelectorEngine]]
575576
testIdAttributeName: NotRequired[str]

‎playwright/async_api/_generated.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7958,6 +7958,8 @@ def get_by_label(
79587958
Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the
79597959
`aria-label` attribute.
79607960

7961+
Associated `<label>` elements are also supported for form-associated custom elements.
7962+
79617963
**Usage**
79627964

79637965
For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:
@@ -9893,6 +9895,8 @@ def get_by_label(
98939895
Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the
98949896
`aria-label` attribute.
98959897

9898+
Associated `<label>` elements are also supported for form-associated custom elements.
9899+
98969900
**Usage**
98979901

98989902
For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:
@@ -11846,6 +11850,8 @@ def get_by_label(
1184611850
Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the
1184711851
`aria-label` attribute.
1184811852

11853+
Associated `<label>` elements are also supported for form-associated custom elements.
11854+
1184911855
**Usage**
1185011856

1185111857
For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:
@@ -17784,6 +17790,8 @@ def get_by_label(
1778417790
Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the
1778517791
`aria-label` attribute.
1778617792

17793+
Associated `<label>` elements are also supported for form-associated custom elements.
17794+
1778717795
**Usage**
1778817796

1778917797
For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:

‎playwright/sync_api/_generated.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7920,6 +7920,8 @@ def get_by_label(
79207920
Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the
79217921
`aria-label` attribute.
79227922

7923+
Associated `<label>` elements are also supported for form-associated custom elements.
7924+
79237925
**Usage**
79247926

79257927
For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:
@@ -9891,6 +9893,8 @@ def get_by_label(
98919893
Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the
98929894
`aria-label` attribute.
98939895

9896+
Associated `<label>` elements are also supported for form-associated custom elements.
9897+
98949898
**Usage**
98959899

98969900
For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:
@@ -11874,6 +11878,8 @@ def get_by_label(
1187411878
Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the
1187511879
`aria-label` attribute.
1187611880

11881+
Associated `<label>` elements are also supported for form-associated custom elements.
11882+
1187711883
**Usage**
1187811884

1187911885
For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:
@@ -17949,6 +17955,8 @@ def get_by_label(
1794917955
Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the
1795017956
`aria-label` attribute.
1795117957

17958+
Associated `<label>` elements are also supported for form-associated custom elements.
17959+
1795217960
**Usage**
1795317961

1795417962
For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
// Mock script for background extension
2+
globalThis.initialTimezone = {
3+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
4+
localDate: new Date('2030-01-01T23:00').toISOString(),
5+
};
26
globalThis.MAGIC = 42;

0 commit comments

Comments
 (0)