Skip to content

Commit e5123b2

Browse files
authored
chore: roll Python to 1.17 beta driver (#1030)
1 parent 4774b61 commit e5123b2

File tree

3 files changed

+62
-10
lines changed

3 files changed

+62
-10
lines changed

playwright/async_api/_generated.py

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3273,7 +3273,7 @@ async def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
32733273
`ElementHandle` instances can be passed as an argument to the `frame.evaluate()`:
32743274

32753275
```py
3276-
body_handle = await frame.query_selector(\"body\")
3276+
body_handle = await frame.evaluate(\"document.body\")
32773277
html = await frame.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])
32783278
await body_handle.dispose()
32793279
```
@@ -3362,6 +3362,8 @@ async def query_selector(
33623362

33633363
Returns the ElementHandle pointing to the frame element.
33643364

3365+
> NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects and web-first assertions instead.
3366+
33653367
The method finds an element matching the specified selector within the frame. See
33663368
[Working with selectors](./selectors.md) for more details. If no elements match the selector, returns `null`.
33673369

@@ -3390,6 +3392,8 @@ async def query_selector_all(self, selector: str) -> typing.List["ElementHandle"
33903392

33913393
Returns the ElementHandles pointing to the frame elements.
33923394

3395+
> NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects instead.
3396+
33933397
The method finds all elements matching the specified selector within the frame. See
33943398
[Working with selectors](./selectors.md) for more details. If no elements match the selector, returns empty array.
33953399

@@ -3423,6 +3427,9 @@ async def wait_for_selector(
34233427
Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
34243428
`detached`.
34253429

3430+
> NOTE: Playwright automatically waits for element to be ready before performing an action. Using `Locator` objects and
3431+
web-first assertions make the code wait-for-selector-free.
3432+
34263433
Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
34273434
the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
34283435
selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
@@ -3763,6 +3770,9 @@ async def eval_on_selector(
37633770

37643771
Returns the return value of `expression`.
37653772

3773+
> NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
3774+
tests. Use `locator.evaluate()`, other `Locator` helper methods or web-first assertions instead.
3775+
37663776
The method finds an element matching the specified selector within the frame and passes it as a first argument to
37673777
`expression`. See [Working with selectors](./selectors.md) for more details. If no elements match the selector, the
37683778
method throws an error.
@@ -3815,6 +3825,9 @@ async def eval_on_selector_all(
38153825

38163826
Returns the return value of `expression`.
38173827

3828+
> NOTE: In most cases, `locator.evaluate_all()`, other `Locator` helper methods and web-first assertions do a
3829+
better job.
3830+
38183831
The method finds all elements matching the specified selector within the frame and passes an array of matched elements
38193832
as a first argument to `expression`. See [Working with selectors](./selectors.md) for more details.
38203833

@@ -5443,7 +5456,7 @@ async def run(playwright):
54435456
# Combine it with other selector engines.
54445457
await page.click('tag=div >> text=\"Click me\"')
54455458
# Can use it in any methods supporting selectors.
5446-
button_count = await page.eval_on_selector_all('tag=button', 'buttons => buttons.length')
5459+
button_count = await page.locator('tag=button').count()
54475460
print(button_count)
54485461
await browser.close()
54495462

@@ -6486,8 +6499,10 @@ async def query_selector(
64866499
) -> typing.Optional["ElementHandle"]:
64876500
"""Page.query_selector
64886501

6502+
> NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects and web-first assertions instead.
6503+
64896504
The method finds an element matching the specified selector within the page. If no elements match the selector, the
6490-
return value resolves to `null`. To wait for an element on the page, use `page.wait_for_selector()`.
6505+
return value resolves to `null`. To wait for an element on the page, use `locator.wait_for()`.
64916506

64926507
Shortcut for main frame's `frame.query_selector()`.
64936508

@@ -6514,6 +6529,8 @@ async def query_selector(
65146529
async def query_selector_all(self, selector: str) -> typing.List["ElementHandle"]:
65156530
"""Page.query_selector_all
65166531

6532+
> NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects and web-first assertions instead.
6533+
65176534
The method finds all elements matching the specified selector within the page. If no elements match the selector, the
65186535
return value resolves to `[]`.
65196536

@@ -6549,6 +6566,9 @@ async def wait_for_selector(
65496566
Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
65506567
`detached`.
65516568

6569+
> NOTE: Playwright automatically waits for element to be ready before performing an action. Using `Locator` objects and
6570+
web-first assertions make the code wait-for-selector-free.
6571+
65526572
Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
65536573
the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
65546574
selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
@@ -6907,7 +6927,7 @@ async def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
69076927
`ElementHandle` instances can be passed as an argument to the `page.evaluate()`:
69086928

69096929
```py
6910-
body_handle = await page.query_selector(\"body\")
6930+
body_handle = await page.evaluate(\"document.body\")
69116931
html = await page.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])
69126932
await body_handle.dispose()
69136933
```
@@ -7001,6 +7021,9 @@ async def eval_on_selector(
70017021
) -> typing.Any:
70027022
"""Page.eval_on_selector
70037023

7024+
> NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
7025+
tests. Use `locator.evaluate()`, other `Locator` helper methods or web-first assertions instead.
7026+
70047027
The method finds an element matching the specified selector within the page and passes it as a first argument to
70057028
`expression`. If no elements match the selector, the method throws an error. Returns the value of `expression`.
70067029

@@ -7052,6 +7075,9 @@ async def eval_on_selector_all(
70527075
) -> typing.Any:
70537076
"""Page.eval_on_selector_all
70547077

7078+
> NOTE: In most cases, `locator.evaluate_all()`, other `Locator` helper methods and web-first assertions do a
7079+
better job.
7080+
70557081
The method finds all elements matching the specified selector within the page and passes an array of matched elements as
70567082
a first argument to `expression`. Returns the result of `expression` invocation.
70577083

playwright/sync_api/_generated.py

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3222,7 +3222,7 @@ def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
32223222
`ElementHandle` instances can be passed as an argument to the `frame.evaluate()`:
32233223

32243224
```py
3225-
body_handle = frame.query_selector(\"body\")
3225+
body_handle = frame.evaluate(\"document.body\")
32263226
html = frame.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])
32273227
body_handle.dispose()
32283228
```
@@ -3309,6 +3309,8 @@ def query_selector(
33093309

33103310
Returns the ElementHandle pointing to the frame element.
33113311

3312+
> NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects and web-first assertions instead.
3313+
33123314
The method finds an element matching the specified selector within the frame. See
33133315
[Working with selectors](./selectors.md) for more details. If no elements match the selector, returns `null`.
33143316

@@ -3337,6 +3339,8 @@ def query_selector_all(self, selector: str) -> typing.List["ElementHandle"]:
33373339

33383340
Returns the ElementHandles pointing to the frame elements.
33393341

3342+
> NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects instead.
3343+
33403344
The method finds all elements matching the specified selector within the frame. See
33413345
[Working with selectors](./selectors.md) for more details. If no elements match the selector, returns empty array.
33423346

@@ -3370,6 +3374,9 @@ def wait_for_selector(
33703374
Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
33713375
`detached`.
33723376

3377+
> NOTE: Playwright automatically waits for element to be ready before performing an action. Using `Locator` objects and
3378+
web-first assertions make the code wait-for-selector-free.
3379+
33733380
Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
33743381
the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
33753382
selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
@@ -3707,6 +3714,9 @@ def eval_on_selector(
37073714

37083715
Returns the return value of `expression`.
37093716

3717+
> NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
3718+
tests. Use `locator.evaluate()`, other `Locator` helper methods or web-first assertions instead.
3719+
37103720
The method finds an element matching the specified selector within the frame and passes it as a first argument to
37113721
`expression`. See [Working with selectors](./selectors.md) for more details. If no elements match the selector, the
37123722
method throws an error.
@@ -3759,6 +3769,9 @@ def eval_on_selector_all(
37593769

37603770
Returns the return value of `expression`.
37613771

3772+
> NOTE: In most cases, `locator.evaluate_all()`, other `Locator` helper methods and web-first assertions do a
3773+
better job.
3774+
37623775
The method finds all elements matching the specified selector within the frame and passes an array of matched elements
37633776
as a first argument to `expression`. See [Working with selectors](./selectors.md) for more details.
37643777

@@ -5373,11 +5386,11 @@ def run(playwright):
53735386
page.set_content('<div><button>Click me</button></div>')
53745387

53755388
# Use the selector prefixed with its name.
5376-
button = page.query_selector('tag=button')
5389+
button = page.locator('tag=button')
53775390
# Combine it with other selector engines.
53785391
page.click('tag=div >> text=\"Click me\"')
53795392
# Can use it in any methods supporting selectors.
5380-
button_count = page.eval_on_selector_all('tag=button', 'buttons => buttons.length')
5393+
button_count = page.locator('tag=button').count()
53815394
print(button_count)
53825395
browser.close()
53835396

@@ -6309,8 +6322,10 @@ def query_selector(
63096322
) -> typing.Optional["ElementHandle"]:
63106323
"""Page.query_selector
63116324

6325+
> NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects and web-first assertions instead.
6326+
63126327
The method finds an element matching the specified selector within the page. If no elements match the selector, the
6313-
return value resolves to `null`. To wait for an element on the page, use `page.wait_for_selector()`.
6328+
return value resolves to `null`. To wait for an element on the page, use `locator.wait_for()`.
63146329

63156330
Shortcut for main frame's `frame.query_selector()`.
63166331

@@ -6337,6 +6352,8 @@ def query_selector(
63376352
def query_selector_all(self, selector: str) -> typing.List["ElementHandle"]:
63386353
"""Page.query_selector_all
63396354

6355+
> NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects and web-first assertions instead.
6356+
63406357
The method finds all elements matching the specified selector within the page. If no elements match the selector, the
63416358
return value resolves to `[]`.
63426359

@@ -6372,6 +6389,9 @@ def wait_for_selector(
63726389
Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
63736390
`detached`.
63746391

6392+
> NOTE: Playwright automatically waits for element to be ready before performing an action. Using `Locator` objects and
6393+
web-first assertions make the code wait-for-selector-free.
6394+
63756395
Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
63766396
the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
63776397
selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
@@ -6727,7 +6747,7 @@ def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
67276747
`ElementHandle` instances can be passed as an argument to the `page.evaluate()`:
67286748

67296749
```py
6730-
body_handle = page.query_selector(\"body\")
6750+
body_handle = page.evaluate(\"document.body\")
67316751
html = page.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])
67326752
body_handle.dispose()
67336753
```
@@ -6819,6 +6839,9 @@ def eval_on_selector(
68196839
) -> typing.Any:
68206840
"""Page.eval_on_selector
68216841

6842+
> NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
6843+
tests. Use `locator.evaluate()`, other `Locator` helper methods or web-first assertions instead.
6844+
68226845
The method finds an element matching the specified selector within the page and passes it as a first argument to
68236846
`expression`. If no elements match the selector, the method throws an error. Returns the value of `expression`.
68246847

@@ -6870,6 +6893,9 @@ def eval_on_selector_all(
68706893
) -> typing.Any:
68716894
"""Page.eval_on_selector_all
68726895

6896+
> NOTE: In most cases, `locator.evaluate_all()`, other `Locator` helper methods and web-first assertions do a
6897+
better job.
6898+
68736899
The method finds all elements matching the specified selector within the page and passes an array of matched elements as
68746900
a first argument to `expression`. Returns the result of `expression` invocation.
68756901

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
InWheel = None
2929
from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand
3030

31-
driver_version = "1.18.0-next-1636539685000"
31+
driver_version = "1.17.0-1637005716000"
3232

3333

3434
def extractall(zip: zipfile.ZipFile, path: str) -> None:

0 commit comments

Comments
 (0)