Skip to content

Commit 12ba09d

Browse files
authored
feat(roll): roll Playwright 1.14.0-next-1628399336000 (microsoft#839)
1 parent a2347a7 commit 12ba09d

File tree

11 files changed

+100
-32
lines changed

11 files changed

+100
-32
lines changed

playwright/_impl/_frame.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,8 @@ async def drag_and_drop(
522522
self,
523523
source: str,
524524
target: str,
525+
source_position: Position = None,
526+
target_position: Position = None,
525527
force: bool = None,
526528
noWaitAfter: bool = None,
527529
strict: bool = None,

playwright/_impl/_page.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,8 @@ async def drag_and_drop(
699699
self,
700700
source: str,
701701
target: str,
702+
source_position: Position = None,
703+
target_position: Position = None,
702704
force: bool = None,
703705
noWaitAfter: bool = None,
704706
timeout: float = None,

playwright/_impl/_tracing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ async def start(
3737
await self._channel.send("tracingStart", params)
3838

3939
async def stop(self, path: Union[pathlib.Path, str] = None) -> None:
40-
await self._channel.send("tracingStop")
4140
if path:
4241
artifact = cast(
4342
Artifact, from_channel(await self._channel.send("tracingExport"))
@@ -46,3 +45,4 @@ async def stop(self, path: Union[pathlib.Path, str] = None) -> None:
4645
artifact._is_remote = self._context._browser._is_remote
4746
await artifact.save_as(path)
4847
await artifact.delete()
48+
await self._channel.send("tracingStop")

playwright/async_api/_generated.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,7 +1905,7 @@ async def select_text(
19051905
async def input_value(self, *, timeout: float = None) -> str:
19061906
"""ElementHandle.input_value
19071907
1908-
Returns `input.value` for `<input>` or `<textarea>` element. Throws for non-input elements.
1908+
Returns `input.value` for `<input>` or `<textarea>` or `<select>` element. Throws for non-input elements.
19091909
19101910
Parameters
19111911
----------
@@ -4245,6 +4245,8 @@ async def drag_and_drop(
42454245
source: str,
42464246
target: str,
42474247
*,
4248+
source_position: Position = None,
4249+
target_position: Position = None,
42484250
force: bool = None,
42494251
no_wait_after: bool = None,
42504252
strict: bool = None,
@@ -4257,6 +4259,12 @@ async def drag_and_drop(
42574259
----------
42584260
source : str
42594261
target : str
4262+
source_position : Union[{x: float, y: float}, NoneType]
4263+
Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not
4264+
specified, some visible point of the element is used.
4265+
target_position : Union[{x: float, y: float}, NoneType]
4266+
Drops on the target element at this point relative to the top-left corner of the element's padding box. If not
4267+
specified, some visible point of the element is used.
42604268
force : Union[bool, NoneType]
42614269
Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
42624270
no_wait_after : Union[bool, NoneType]
@@ -4280,6 +4288,8 @@ async def drag_and_drop(
42804288
self._impl_obj.drag_and_drop(
42814289
source=source,
42824290
target=target,
4291+
source_position=source_position,
4292+
target_position=target_position,
42834293
force=force,
42844294
noWaitAfter=no_wait_after,
42854295
strict=strict,
@@ -4378,7 +4388,7 @@ async def input_value(
43784388
) -> str:
43794389
"""Frame.input_value
43804390
4381-
Returns `input.value` for the selected `<input>` or `<textarea>` element. Throws for non-input elements.
4391+
Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element. Throws for non-input elements.
43824392
43834393
Parameters
43844394
----------
@@ -7586,6 +7596,8 @@ async def drag_and_drop(
75867596
source: str,
75877597
target: str,
75887598
*,
7599+
source_position: Position = None,
7600+
target_position: Position = None,
75897601
force: bool = None,
75907602
no_wait_after: bool = None,
75917603
timeout: float = None,
@@ -7598,6 +7610,12 @@ async def drag_and_drop(
75987610
----------
75997611
source : str
76007612
target : str
7613+
source_position : Union[{x: float, y: float}, NoneType]
7614+
Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not
7615+
specified, some visible point of the element is used.
7616+
target_position : Union[{x: float, y: float}, NoneType]
7617+
Drops on the target element at this point relative to the top-left corner of the element's padding box. If not
7618+
specified, some visible point of the element is used.
76017619
force : Union[bool, NoneType]
76027620
Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
76037621
no_wait_after : Union[bool, NoneType]
@@ -7621,6 +7639,8 @@ async def drag_and_drop(
76217639
self._impl_obj.drag_and_drop(
76227640
source=source,
76237641
target=target,
7642+
source_position=source_position,
7643+
target_position=target_position,
76247644
force=force,
76257645
noWaitAfter=no_wait_after,
76267646
timeout=timeout,
@@ -7722,7 +7742,7 @@ async def input_value(
77227742
) -> str:
77237743
"""Page.input_value
77247744
7725-
Returns `input.value` for the selected `<input>` or `<textarea>` element. Throws for non-input elements.
7745+
Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element. Throws for non-input elements.
77267746
77277747
Parameters
77287748
----------
@@ -11370,7 +11390,7 @@ async def inner_text(self, *, timeout: float = None) -> str:
1137011390
async def input_value(self, *, timeout: float = None) -> str:
1137111391
"""Locator.input_value
1137211392
11373-
Returns `input.value` for `<input>` or `<textarea>` element. Throws for non-input elements.
11393+
Returns `input.value` for `<input>` or `<textarea>` or `<select>` element. Throws for non-input elements.
1137411394
1137511395
Parameters
1137611396
----------

playwright/sync_api/_generated.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ def select_text(self, *, force: bool = None, timeout: float = None) -> NoneType:
18901890
def input_value(self, *, timeout: float = None) -> str:
18911891
"""ElementHandle.input_value
18921892
1893-
Returns `input.value` for `<input>` or `<textarea>` element. Throws for non-input elements.
1893+
Returns `input.value` for `<input>` or `<textarea>` or `<select>` element. Throws for non-input elements.
18941894
18951895
Parameters
18961896
----------
@@ -4223,6 +4223,8 @@ def drag_and_drop(
42234223
source: str,
42244224
target: str,
42254225
*,
4226+
source_position: Position = None,
4227+
target_position: Position = None,
42264228
force: bool = None,
42274229
no_wait_after: bool = None,
42284230
strict: bool = None,
@@ -4235,6 +4237,12 @@ def drag_and_drop(
42354237
----------
42364238
source : str
42374239
target : str
4240+
source_position : Union[{x: float, y: float}, NoneType]
4241+
Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not
4242+
specified, some visible point of the element is used.
4243+
target_position : Union[{x: float, y: float}, NoneType]
4244+
Drops on the target element at this point relative to the top-left corner of the element's padding box. If not
4245+
specified, some visible point of the element is used.
42384246
force : Union[bool, NoneType]
42394247
Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
42404248
no_wait_after : Union[bool, NoneType]
@@ -4258,6 +4266,8 @@ def drag_and_drop(
42584266
self._impl_obj.drag_and_drop(
42594267
source=source,
42604268
target=target,
4269+
source_position=source_position,
4270+
target_position=target_position,
42614271
force=force,
42624272
noWaitAfter=no_wait_after,
42634273
strict=strict,
@@ -4356,7 +4366,7 @@ def input_value(
43564366
) -> str:
43574367
"""Frame.input_value
43584368
4359-
Returns `input.value` for the selected `<input>` or `<textarea>` element. Throws for non-input elements.
4369+
Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element. Throws for non-input elements.
43604370
43614371
Parameters
43624372
----------
@@ -7541,6 +7551,8 @@ def drag_and_drop(
75417551
source: str,
75427552
target: str,
75437553
*,
7554+
source_position: Position = None,
7555+
target_position: Position = None,
75447556
force: bool = None,
75457557
no_wait_after: bool = None,
75467558
timeout: float = None,
@@ -7553,6 +7565,12 @@ def drag_and_drop(
75537565
----------
75547566
source : str
75557567
target : str
7568+
source_position : Union[{x: float, y: float}, NoneType]
7569+
Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not
7570+
specified, some visible point of the element is used.
7571+
target_position : Union[{x: float, y: float}, NoneType]
7572+
Drops on the target element at this point relative to the top-left corner of the element's padding box. If not
7573+
specified, some visible point of the element is used.
75567574
force : Union[bool, NoneType]
75577575
Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
75587576
no_wait_after : Union[bool, NoneType]
@@ -7576,6 +7594,8 @@ def drag_and_drop(
75767594
self._impl_obj.drag_and_drop(
75777595
source=source,
75787596
target=target,
7597+
source_position=source_position,
7598+
target_position=target_position,
75797599
force=force,
75807600
noWaitAfter=no_wait_after,
75817601
timeout=timeout,
@@ -7677,7 +7697,7 @@ def input_value(
76777697
) -> str:
76787698
"""Page.input_value
76797699
7680-
Returns `input.value` for the selected `<input>` or `<textarea>` element. Throws for non-input elements.
7700+
Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element. Throws for non-input elements.
76817701
76827702
Parameters
76837703
----------
@@ -11300,7 +11320,7 @@ def inner_text(self, *, timeout: float = None) -> str:
1130011320
def input_value(self, *, timeout: float = None) -> str:
1130111321
"""Locator.input_value
1130211322
11303-
Returns `input.value` for `<input>` or `<textarea>` element. Throws for non-input elements.
11323+
Returns `input.value` for `<input>` or `<textarea>` or `<select>` element. Throws for non-input elements.
1130411324
1130511325
Parameters
1130611326
----------

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

3333

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

tests/async/test_console.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@
1717
from playwright.async_api import ConsoleMessage, Page
1818

1919

20-
async def test_console_should_work(page: Page, server):
20+
async def test_console_should_work(page: Page, browser_name):
2121
messages: List[ConsoleMessage] = []
2222
page.once("console", lambda m: messages.append(m))
2323
async with page.expect_console_message() as message_info:
2424
await page.evaluate('() => console.log("hello", 5, {foo: "bar"})')
2525
message = await message_info.value
26-
assert message.text == "hello 5 JSHandle@object"
27-
assert str(message) == "hello 5 JSHandle@object"
26+
if browser_name != "firefox":
27+
assert message.text == "hello 5 {foo: bar}"
28+
assert str(message) == "hello 5 {foo: bar}"
29+
else:
30+
assert message.text == "hello 5 JSHandle@object"
31+
assert str(message) == "hello 5 JSHandle@object"
2832
assert message.type == "log"
2933
assert await message.args[0].json_value() == "hello"
3034
assert await message.args[1].json_value() == 5
@@ -77,15 +81,18 @@ async def test_console_should_work_for_different_console_api_calls(page, server)
7781
"calling console.dir",
7882
"calling console.warn",
7983
"calling console.error",
80-
"JSHandle@promise",
84+
"Promise",
8185
]
8286

8387

84-
async def test_console_should_not_fail_for_window_object(page):
88+
async def test_console_should_not_fail_for_window_object(page, browser_name):
8589
async with page.expect_console_message() as message_info:
8690
await page.evaluate("console.error(window)")
8791
message = await message_info.value
88-
assert message.text == "JSHandle@object"
92+
if browser_name != "firefox":
93+
assert message.text == "Window"
94+
else:
95+
assert message.text == "JSHandle@object"
8996

9097

9198
async def test_console_should_trigger_correct_log(page, server):

tests/async/test_jshandle.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,17 +202,20 @@ async def test_jshandle_as_element_return_none_for_non_elements(page):
202202

203203
async def test_jshandle_to_string_work_for_primitives(page):
204204
number_handle = await page.evaluate_handle("2")
205-
assert str(number_handle) == "JSHandle@2"
205+
assert str(number_handle) == "2"
206206
string_handle = await page.evaluate_handle('"a"')
207-
assert str(string_handle) == "JSHandle@a"
207+
assert str(string_handle) == "a"
208208

209209

210-
async def test_jshandle_to_string_work_for_complicated_objects(page):
210+
async def test_jshandle_to_string_work_for_complicated_objects(page, browser_name):
211211
handle = await page.evaluate_handle("window")
212-
assert str(handle) == "JSHandle@object"
212+
if browser_name != "firefox":
213+
assert str(handle) == "Window"
214+
else:
215+
assert str(handle) == "JSHandle@object"
213216

214217

215218
async def test_jshandle_to_string_work_for_promises(page):
216219
handle = await page.evaluate_handle("({b: Promise.resolve(123)})")
217220
b_handle = await handle.get_property("b")
218-
assert str(b_handle) == "JSHandle@promise"
221+
assert str(b_handle) == "Promise"

tests/async/test_worker.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,17 @@ async def test_workers_should_report_console_logs(page):
6363
assert message.text == "1"
6464

6565

66-
async def test_workers_should_have_JSHandles_for_console_logs(page):
66+
async def test_workers_should_have_JSHandles_for_console_logs(page, browser_name):
6767
log_promise = asyncio.Future()
6868
page.on("console", lambda m: log_promise.set_result(m))
6969
await page.evaluate(
7070
"() => new Worker(URL.createObjectURL(new Blob(['console.log(1,2,3,this)'], {type: 'application/javascript'})))"
7171
)
7272
log = await log_promise
73-
assert log.text == "1 2 3 JSHandle@object"
73+
if browser_name != "firefox":
74+
assert log.text == "1 2 3 DedicatedWorkerGlobalScope"
75+
else:
76+
assert log.text == "1 2 3 JSHandle@object"
7477
assert len(log.args) == 4
7578
assert await (await log.args[3].get_property("origin")).json_value() == "null"
7679

tests/sync/test_console.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,19 @@
1717
from playwright.sync_api import ConsoleMessage, Page
1818

1919

20-
def test_console_should_work(page: Page, server):
20+
def test_console_should_work(page: Page, browser_name):
2121
messages: List[ConsoleMessage] = []
2222
page.once("console", lambda m: messages.append(m))
2323
with page.expect_console_message():
2424
page.evaluate('() => console.log("hello", 5, {foo: "bar"})'),
2525
assert len(messages) == 1
2626
message = messages[0]
27-
assert message.text == "hello 5 JSHandle@object"
28-
assert str(message) == "hello 5 JSHandle@object"
27+
if browser_name != "firefox":
28+
assert message.text == "hello 5 {foo: bar}"
29+
assert str(message) == "hello 5 {foo: bar}"
30+
else:
31+
assert message.text == "hello 5 JSHandle@object"
32+
assert str(message) == "hello 5 JSHandle@object"
2933
assert message.type == "log"
3034
assert message.args[0].json_value() == "hello"
3135
assert message.args[1].json_value() == 5
@@ -78,17 +82,20 @@ def test_console_should_work_for_different_console_api_calls(page, server):
7882
"calling console.dir",
7983
"calling console.warn",
8084
"calling console.error",
81-
"JSHandle@promise",
85+
"Promise",
8286
]
8387

8488

85-
def test_console_should_not_fail_for_window_object(page: Page, server):
89+
def test_console_should_not_fail_for_window_object(page: Page, browser_name):
8690
messages = []
8791
page.once("console", lambda m: messages.append(m))
8892
with page.expect_console_message():
8993
page.evaluate("() => console.error(window)")
9094
assert len(messages) == 1
91-
assert messages[0].text == "JSHandle@object"
95+
if browser_name != "firefox":
96+
assert messages[0].text == "Window"
97+
else:
98+
assert messages[0].text == "JSHandle@object"
9299

93100

94101
def test_console_should_trigger_correct_Log(page, server):

tests/sync/test_sync.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,18 @@ def test_sync_network_events(page, server):
182182
]
183183

184184

185-
def test_console_should_work(page):
185+
def test_console_should_work(page, browser_name):
186186
messages = []
187187
page.once("console", lambda m: messages.append(m))
188188
page.evaluate('() => console.log("hello", 5, {foo: "bar"})'),
189189
assert len(messages) == 1
190190
message = messages[0]
191-
assert message.text == "hello 5 JSHandle@object"
192-
assert str(message) == "hello 5 JSHandle@object"
191+
if browser_name != "firefox":
192+
assert message.text == "hello 5 {foo: bar}"
193+
assert str(message) == "hello 5 {foo: bar}"
194+
else:
195+
assert message.text == "hello 5 JSHandle@object"
196+
assert str(message) == "hello 5 JSHandle@object"
193197
assert message.type == "log"
194198
assert message.args[0].json_value() == "hello"
195199
assert message.args[1].json_value() == 5

0 commit comments

Comments
 (0)