Skip to content

Commit

Permalink
Add GUI test for copy path button
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Apr 17, 2024
1 parent ec754cf commit 1ebc9ef
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/rustdoc-gui/copy-path.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Checks that the "copy path" button is not triggering JS error and its display
// isn't broken.
go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"

// First we store the size of the button before we click on it.
store-size: ("#copy-path", {"width": width, "height": height})
click: "#copy-path"
// We wait for the new text to appear.
wait-for: "#copy-path.clicked"
// We check that the size didn't change.
assert-size: ("#copy-path.clicked", {"width": |width|, "height": |height|})
// We wait for the button to turn back to its original state.
wait-for: "#copy-path:not(.clicked)"
// We check that the size is still the same.
assert-size: ("#copy-path:not(.clicked)", {"width": |width|, "height": |height|})

0 comments on commit 1ebc9ef

Please sign in to comment.