diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-04-17 00:02:39 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-04-17 16:56:14 +0200 |
| commit | 1ebc9efa786c3312b5c8b5659aeffc048ccd6f3b (patch) | |
| tree | 92c865e2e093b65b975366f0796258d9b40008b8 | |
| parent | ec754cf2012d1aecf7fca8fa66c846d79e7b94a4 (diff) | |
| download | rust-1ebc9efa786c3312b5c8b5659aeffc048ccd6f3b.tar.gz rust-1ebc9efa786c3312b5c8b5659aeffc048ccd6f3b.zip | |
Add GUI test for copy path button
| -rw-r--r-- | tests/rustdoc-gui/copy-path.goml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/copy-path.goml b/tests/rustdoc-gui/copy-path.goml new file mode 100644 index 00000000000..dc05b96f7ae --- /dev/null +++ b/tests/rustdoc-gui/copy-path.goml @@ -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|}) |
