diff --git a/src/test/rustdoc-gui/scrape-examples-button-focus.goml b/src/test/rustdoc-gui/scrape-examples-interactions.goml similarity index 85% rename from src/test/rustdoc-gui/scrape-examples-button-focus.goml rename to src/test/rustdoc-gui/scrape-examples-interactions.goml index a353504df6a..f7b43c4c85b 100644 --- a/src/test/rustdoc-gui/scrape-examples-button-focus.goml +++ b/src/test/rustdoc-gui/scrape-examples-interactions.goml @@ -1,5 +1,6 @@ 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" @@ -12,6 +13,7 @@ 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| @@ -26,11 +28,15 @@ assert-property: (".scraped-example-list > .scraped-example pre", { "scrollHeight": |fullOffsetHeight| }) +// Clicking "More examples..." will open additional examples assert-attribute-false: (".more-examples-toggle", {"open": ""}) click: ".more-examples-toggle" assert-attribute: (".more-examples-toggle", {"open": ""}) + +// Toggling all docs will close additional examples click: "#toggle-all-docs" assert-attribute-false: (".more-examples-toggle", {"open": ""}) + // After re-opening the docs, the additional examples should stay closed click: "#toggle-all-docs" assert-attribute-false: (".more-examples-toggle", {"open": ""})