Skip to content

Commit c52f0f2

Browse files
authored
chore: roll to 1.14 branch tot (#845)
1 parent 6b2898d commit c52f0f2

File tree

11 files changed

+40
-38
lines changed

11 files changed

+40
-38
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H
44

55
| | Linux | macOS | Windows |
66
| :--- | :---: | :---: | :---: |
7-
| Chromium <!-- GEN:chromium-version -->93.0.4576.0<!-- GEN:stop --> ||||
8-
| WebKit <!-- GEN:webkit-version -->14.2<!-- GEN:stop --> ||||
9-
| Firefox <!-- GEN:firefox-version -->90.0<!-- GEN:stop --> ||||
7+
| Chromium <!-- GEN:chromium-version -->94.0.4595.0<!-- GEN:stop --> ||||
8+
| WebKit <!-- GEN:webkit-version -->15.0<!-- GEN:stop --> ||||
9+
| Firefox <!-- GEN:firefox-version -->91.0<!-- GEN:stop --> ||||
1010

1111
## Documentation
1212

playwright/_impl/_locator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ async def element_handles(self) -> List[ElementHandle]:
185185

186186
@property
187187
def first(self) -> "Locator":
188-
return Locator(self._frame, f"{self._selector} >> _nth=first")
188+
return Locator(self._frame, f"{self._selector} >> nth=0")
189189

190190
@property
191191
def last(self) -> "Locator":
192-
return Locator(self._frame, f"{self._selector} >> _nth=last")
192+
return Locator(self._frame, f"{self._selector} >> nth=-1")
193193

194194
def nth(self, index: int) -> "Locator":
195-
return Locator(self._frame, f"{self._selector} >> _nth={index}")
195+
return Locator(self._frame, f"{self._selector} >> nth={index}")
196196

197197
async def focus(self, timeout: float = None) -> None:
198198
params = locals_to_params(locals())

playwright/async_api/_generated.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11044,8 +11044,8 @@ async def evaluate_all(self, expression: str, arg: typing.Any = None) -> NoneTyp
1104411044
The method finds all elements matching the specified locator and passes an array of matched elements as a first argument
1104511045
to `expression`. Returns the result of `expression` invocation.
1104611046
11047-
If `expression` returns a [Promise], then [`Locator.evaluateAll`] would wait for the promise to resolve and return its
11048-
value.
11047+
If `expression` returns a [Promise], then `locator.evaluate_all()` would wait for the promise to resolve and
11048+
return its value.
1104911049
1105011050
Examples:
1105111051

playwright/sync_api/_generated.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10980,8 +10980,8 @@ def evaluate_all(self, expression: str, arg: typing.Any = None) -> NoneType:
1098010980
The method finds all elements matching the specified locator and passes an array of matched elements as a first argument
1098110981
to `expression`. Returns the result of `expression` invocation.
1098210982
10983-
If `expression` returns a [Promise], then [`Locator.evaluateAll`] would wait for the promise to resolve and return its
10984-
value.
10983+
If `expression` returns a [Promise], then `locator.evaluate_all()` would wait for the promise to resolve and
10984+
return its value.
1098510985
1098610986
Examples:
1098710987

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.14.0-next-1628399336000"
31+
driver_version = "1.14.0-1628783206000"
3232

3333

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

tests/async/test_browsercontext_add_cookies.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ async def test_should_have_expires_set_to_neg_1_for_session_cookies(context, ser
210210
assert cookies[0]["expires"] == -1
211211

212212

213-
async def test_should_set_cookie_with_reasonable_defaults(context, server):
213+
async def test_should_set_cookie_with_reasonable_defaults(context, server, is_chromium):
214214
await context.add_cookies(
215215
[{"url": server.EMPTY_PAGE, "name": "defaults", "value": "123456"}]
216216
)
@@ -225,12 +225,12 @@ async def test_should_set_cookie_with_reasonable_defaults(context, server):
225225
"expires": -1,
226226
"httpOnly": False,
227227
"secure": False,
228-
"sameSite": "None",
228+
"sameSite": "Lax" if is_chromium else "None",
229229
}
230230
]
231231

232232

233-
async def test_should_set_a_cookie_with_a_path(context, page, server):
233+
async def test_should_set_a_cookie_with_a_path(context, page, server, is_chromium):
234234
await page.goto(server.PREFIX + "/grid.html")
235235
await context.add_cookies(
236236
[
@@ -251,7 +251,7 @@ async def test_should_set_a_cookie_with_a_path(context, page, server):
251251
"expires": -1,
252252
"httpOnly": False,
253253
"secure": False,
254-
"sameSite": "None",
254+
"sameSite": "Lax" if is_chromium else "None",
255255
}
256256
]
257257
assert await page.evaluate("document.cookie") == "gridcookie=GRID"
@@ -311,7 +311,9 @@ async def test_should_be_able_to_set_unsecure_cookie_for_http_website(
311311
assert not cookie["secure"]
312312

313313

314-
async def test_should_set_a_cookie_on_a_different_domain(context, page, server):
314+
async def test_should_set_a_cookie_on_a_different_domain(
315+
context, page, server, is_chromium
316+
):
315317
await page.goto(server.EMPTY_PAGE)
316318
await context.add_cookies(
317319
[{"url": "https://www.example.com", "name": "example-cookie", "value": "best"}]
@@ -326,7 +328,7 @@ async def test_should_set_a_cookie_on_a_different_domain(context, page, server):
326328
"expires": -1,
327329
"httpOnly": False,
328330
"secure": True,
329-
"sameSite": "None",
331+
"sameSite": "Lax" if is_chromium else "None",
330332
}
331333
]
332334

@@ -370,7 +372,7 @@ async def test_should_not_block_third_party_cookies(
370372
)
371373
await page.frames[1].evaluate("document.cookie = 'username=John Doe'")
372374
await page.wait_for_timeout(2000)
373-
allows_third_party = is_chromium or is_firefox
375+
allows_third_party = is_firefox
374376
cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + "/grid.html")
375377

376378
if allows_third_party:
@@ -381,7 +383,7 @@ async def test_should_not_block_third_party_cookies(
381383
"httpOnly": False,
382384
"name": "username",
383385
"path": "/",
384-
"sameSite": "None",
386+
"sameSite": "Lax" if is_chromium else "None",
385387
"secure": False,
386388
"value": "John Doe",
387389
}

tests/async/test_browsercontext_cookies.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async def test_should_return_no_cookies_in_pristine_browser_context(context):
2121
assert await context.cookies() == []
2222

2323

24-
async def test_should_get_a_cookie(context, page, server, is_firefox):
24+
async def test_should_get_a_cookie(context, page, server, is_chromium):
2525
await page.goto(server.EMPTY_PAGE)
2626
document_cookie = await page.evaluate(
2727
"""() => {
@@ -39,12 +39,12 @@ async def test_should_get_a_cookie(context, page, server, is_firefox):
3939
"expires": -1,
4040
"httpOnly": False,
4141
"secure": False,
42-
"sameSite": "None",
42+
"sameSite": "Lax" if is_chromium else "None",
4343
}
4444
]
4545

4646

47-
async def test_should_get_a_non_session_cookie(context, page, server, is_firefox):
47+
async def test_should_get_a_non_session_cookie(context, page, server, is_chromium):
4848
await page.goto(server.EMPTY_PAGE)
4949
# @see https://en.wikipedia.org/wiki/Year_2038_problem
5050
date = int(datetime.datetime(2038, 1, 1).timestamp() * 1000)
@@ -66,7 +66,7 @@ async def test_should_get_a_non_session_cookie(context, page, server, is_firefox
6666
"expires": date / 1000,
6767
"httpOnly": False,
6868
"secure": False,
69-
"sameSite": "None",
69+
"sameSite": "Lax" if is_chromium else "None",
7070
}
7171
]
7272

@@ -124,7 +124,7 @@ async def test_should_properly_report_lax_sameSite_cookie(
124124
assert cookies[0]["sameSite"] == "Lax"
125125

126126

127-
async def test_should_get_multiple_cookies(context, page, server, is_firefox):
127+
async def test_should_get_multiple_cookies(context, page, server, is_chromium):
128128
await page.goto(server.EMPTY_PAGE)
129129
document_cookie = await page.evaluate(
130130
"""() => {
@@ -145,7 +145,7 @@ async def test_should_get_multiple_cookies(context, page, server, is_firefox):
145145
"expires": -1,
146146
"httpOnly": False,
147147
"secure": False,
148-
"sameSite": "None",
148+
"sameSite": "Lax" if is_chromium else "None",
149149
},
150150
{
151151
"name": "username",
@@ -155,12 +155,12 @@ async def test_should_get_multiple_cookies(context, page, server, is_firefox):
155155
"expires": -1,
156156
"httpOnly": False,
157157
"secure": False,
158-
"sameSite": "None",
158+
"sameSite": "Lax" if is_chromium else "None",
159159
},
160160
]
161161

162162

163-
async def test_should_get_cookies_from_multiple_urls(context):
163+
async def test_should_get_cookies_from_multiple_urls(context, is_chromium):
164164
await context.add_cookies(
165165
[
166166
{"url": "https://foo.com", "name": "doggo", "value": "woofs"},
@@ -180,7 +180,7 @@ async def test_should_get_cookies_from_multiple_urls(context):
180180
"expires": -1,
181181
"httpOnly": False,
182182
"secure": True,
183-
"sameSite": "None",
183+
"sameSite": "Lax" if is_chromium else "None",
184184
},
185185
{
186186
"name": "doggo",
@@ -190,6 +190,6 @@ async def test_should_get_cookies_from_multiple_urls(context):
190190
"expires": -1,
191191
"httpOnly": False,
192192
"secure": True,
193-
"sameSite": "None",
193+
"sameSite": "Lax" if is_chromium else "None",
194194
},
195195
]

tests/async/test_defaultbrowsercontext.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def _launch(**options):
3737
await context.close()
3838

3939

40-
async def test_context_cookies_should_work(server, launch_persistent, is_firefox):
40+
async def test_context_cookies_should_work(server, launch_persistent, is_chromium):
4141
(page, context) = await launch_persistent()
4242
await page.goto(server.EMPTY_PAGE)
4343
document_cookie = await page.evaluate(
@@ -57,12 +57,12 @@ async def test_context_cookies_should_work(server, launch_persistent, is_firefox
5757
"expires": -1,
5858
"httpOnly": False,
5959
"secure": False,
60-
"sameSite": "None",
60+
"sameSite": "Lax" if is_chromium else "None",
6161
}
6262
]
6363

6464

65-
async def test_context_add_cookies_should_work(server, launch_persistent):
65+
async def test_context_add_cookies_should_work(server, launch_persistent, is_chromium):
6666
(page, context) = await launch_persistent()
6767
await page.goto(server.EMPTY_PAGE)
6868
await page.context.add_cookies(
@@ -78,7 +78,7 @@ async def test_context_add_cookies_should_work(server, launch_persistent):
7878
"expires": -1,
7979
"httpOnly": False,
8080
"secure": False,
81-
"sameSite": "None",
81+
"sameSite": "Lax" if is_chromium else "None",
8282
}
8383
]
8484

@@ -124,7 +124,7 @@ async def test_should_not_block_third_party_cookies(
124124
)
125125

126126
await page.wait_for_timeout(2000)
127-
allows_third_party = is_chromium or is_firefox
127+
allows_third_party = is_firefox
128128
assert document_cookie == ("username=John Doe" if allows_third_party else "")
129129
cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + "/grid.html")
130130
if allows_third_party:

tests/async/test_headful.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async def test_should_not_block_third_party_cookies(
101101
)
102102

103103
await page.wait_for_timeout(2000)
104-
allows_third_party = is_chromium or is_firefox
104+
allows_third_party = is_firefox
105105
assert document_cookie == ("username=John Doe" if allows_third_party else "")
106106
cookies = await page.context.cookies(server.CROSS_PROCESS_PREFIX + "/grid.html")
107107
if allows_third_party:
@@ -112,7 +112,7 @@ async def test_should_not_block_third_party_cookies(
112112
"httpOnly": False,
113113
"name": "username",
114114
"path": "/",
115-
"sameSite": "None",
115+
"sameSite": "Lax" if is_chromium else "None",
116116
"secure": False,
117117
"value": "John Doe",
118118
}

tests/async/test_locators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ async def test_locators_should_throw_on_capture_without_nth(page: Page):
435435
"""
436436
)
437437
with pytest.raises(Error, match="Can't query n-th element"):
438-
await page.locator("*css=div >> p").nth(0).click()
438+
await page.locator("*css=div >> p").nth(1).click()
439439

440440

441441
async def test_locators_should_throw_due_to_strictness(page: Page):

0 commit comments

Comments
 (0)