diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/rustdoc-gui/scrape-examples-button-focus.goml | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-gui/scrape-examples-button-focus.goml')
-rw-r--r-- | tests/rustdoc-gui/scrape-examples-button-focus.goml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/scrape-examples-button-focus.goml b/tests/rustdoc-gui/scrape-examples-button-focus.goml new file mode 100644 index 000000000..1b5c3a0d2 --- /dev/null +++ b/tests/rustdoc-gui/scrape-examples-button-focus.goml @@ -0,0 +1,31 @@ +// This test ensures that the scraped examples buttons are working as expecting +// when 'Enter' key is pressed when they're focused. +goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html" + +// The next/prev buttons vertically scroll the code viewport between examples +store-property: (initialScrollTop, ".scraped-example-list > .scraped-example pre", "scrollTop") +focus: ".scraped-example-list > .scraped-example .next" +press-key: "Enter" +assert-property-false: (".scraped-example-list > .scraped-example pre", { + "scrollTop": |initialScrollTop| +}) +focus: ".scraped-example-list > .scraped-example .prev" +press-key: "Enter" +assert-property: (".scraped-example-list > .scraped-example pre", { + "scrollTop": |initialScrollTop| +}) + +// The expand button increases the scrollHeight of the minimized code viewport +store-property: (smallOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight") +assert-property-false: (".scraped-example-list > .scraped-example pre", { + "scrollHeight": |smallOffsetHeight| +}) +focus: ".scraped-example-list > .scraped-example .expand" +press-key: "Enter" +assert-property-false: (".scraped-example-list > .scraped-example pre", { + "offsetHeight": |smallOffsetHeight| +}) +store-property: (fullOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight") +assert-property: (".scraped-example-list > .scraped-example pre", { + "scrollHeight": |fullOffsetHeight| +}) |