Skip to content

Commit 4eeeaeb

Browse files
committed
Double click action title
1 parent 4c7519c commit 4eeeaeb

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

playwright/_impl/_frame.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,9 @@ async def dblclick(
513513
strict: bool = None,
514514
trial: bool = None,
515515
) -> None:
516-
await self._channel.send("dblclick", locals_to_params(locals()))
516+
await self._channel.send(
517+
"dblclick", locals_to_params(locals()), title="Double click"
518+
)
517519

518520
async def tap(
519521
self,

playwright/_impl/_input.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ async def up(
6161
) -> None:
6262
await self._channel.send("mouseUp", locals_to_params(locals()))
6363

64+
async def _click(
65+
self,
66+
x: float,
67+
y: float,
68+
delay: float = None,
69+
button: MouseButton = None,
70+
clickCount: int = None,
71+
title: str = None,
72+
) -> None:
73+
await self._channel.send("mouseClick", locals_to_params(locals()), title=title)
74+
6475
async def click(
6576
self,
6677
x: float,
@@ -69,7 +80,7 @@ async def click(
6980
button: MouseButton = None,
7081
clickCount: int = None,
7182
) -> None:
72-
await self._channel.send("mouseClick", locals_to_params(locals()))
83+
await self._click(**locals())
7384

7485
async def dblclick(
7586
self,
@@ -78,7 +89,9 @@ async def dblclick(
7889
delay: float = None,
7990
button: MouseButton = None,
8091
) -> None:
81-
await self.click(x, y, delay=delay, button=button, clickCount=2)
92+
await self._click(
93+
x, y, delay=delay, button=button, clickCount=2, title="Double click"
94+
)
8295

8396
async def wheel(self, deltaX: float, deltaY: float) -> None:
8497
await self._channel.send("mouseWheel", locals_to_params(locals()))

tests/async/test_tracing.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ async def test_should_collect_trace_with_resources_but_no_js(
152152
re.compile(r"Set content"),
153153
re.compile(r"Click"),
154154
re.compile(r"Mouse move"),
155-
# TODO: Roll: Switch to Double click
156-
re.compile(r"Click"),
155+
re.compile(r"Double click"),
157156
re.compile(r'Insert "abc"'),
158157
re.compile(r"Wait for timeout"),
159158
re.compile(r'Navigate to "/empty\.html"'),
@@ -234,8 +233,7 @@ async def test_should_collect_two_traces(
234233
async with show_trace_viewer(tracing2_path) as trace_viewer:
235234
await expect(trace_viewer.action_titles).to_have_text(
236235
[
237-
# TODO: Roll: Switch to Double click
238-
re.compile(r"Click"),
236+
re.compile(r"Double click"),
239237
re.compile(r"Close"),
240238
]
241239
)

tests/sync/test_tracing.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ def test_should_collect_trace_with_resources_but_no_js(
154154
re.compile(r"Set content"),
155155
re.compile(r"Click"),
156156
re.compile(r"Mouse move"),
157-
# TODO: Roll: Switch to Double click
158-
re.compile(r"Click"),
157+
re.compile(r"Double click"),
159158
re.compile(r'Insert "abc"'),
160159
re.compile(r"Wait for timeout"),
161160
re.compile(r'Navigate to "/empty\.html"'),
@@ -237,8 +236,7 @@ def test_should_collect_two_traces(
237236
with show_trace_viewer(tracing2_path) as trace_viewer:
238237
expect(trace_viewer.action_titles).to_have_text(
239238
[
240-
# TODO: Roll: Switch to Double click
241-
re.compile(r"Click"),
239+
re.compile(r"Double click"),
242240
re.compile(r"Close"),
243241
]
244242
)

0 commit comments

Comments
 (0)