Skip to content

Commit

Permalink
Add new test for click command and update API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 5, 2025
1 parent c837bfe commit 05a2a39
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/api-output/parseClick/multiline-3.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
instructions = [
"""await page.click(1, 2);""",
"""await pages[0].mouse.click(1, 2);""",
]
2 changes: 1 addition & 1 deletion tests/api-output/parseClick/pos-1.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
instructions = [
"""await page.click(1, 2);""",
"""await pages[0].mouse.click(1, 2);""",
]
2 changes: 1 addition & 1 deletion tests/api-output/parseClick/pos-2.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
instructions = [
"""await page.click(1, 2);""",
"""await pages[0].mouse.click(1, 2);""",
]
7 changes: 7 additions & 0 deletions tests/ui/click.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Ensure that `click` works for both coordinates and selector.
go-to: "file://" + |CURRENT_DIR| + "/" + |DOC_PATH| + "/elements.html"
store-position: ("#js-call", {"x": x, "y": y})
click: (|x|, |y|)
wait-for-css-false: ("#js-call", {"margin-top": "0px"})
click: "#the-input"
assert: "#the-input"
5 changes: 5 additions & 0 deletions tests/ui/click.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
=> Starting doc-ui tests...

click... OK

<= doc-ui tests done: 1 succeeded, 0 failed

0 comments on commit 05a2a39

Please sign in to comment.