diff options
| author | Will Crichton <wcrichto@cs.stanford.edu> | 2022-12-06 09:59:49 -0800 |
|---|---|---|
| committer | Will Crichton <wcrichto@cs.stanford.edu> | 2022-12-07 09:08:43 -0800 |
| commit | 212d03dadca627e55273294404bcc6312aa65969 (patch) | |
| tree | 7f4fd8e9b60cf170237c108c2449677332fadb54 | |
| parent | 679d7ea064491dfc8d067fcef07827e7569a093e (diff) | |
| download | rust-212d03dadca627e55273294404bcc6312aa65969.tar.gz rust-212d03dadca627e55273294404bcc6312aa65969.zip | |
Factor scrape-examples toggle test into a new file
| -rw-r--r-- | src/test/rustdoc-gui/scrape-examples-button-focus.goml (renamed from src/test/rustdoc-gui/scrape-examples-interactions.goml) | 13 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/scrape-examples-toggle.goml | 14 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/src/scrape_examples/examples/check2.rs | 25 |
3 files changed, 14 insertions, 38 deletions
diff --git a/src/test/rustdoc-gui/scrape-examples-interactions.goml b/src/test/rustdoc-gui/scrape-examples-button-focus.goml index f7b43c4c85b..bba518db099 100644 --- a/src/test/rustdoc-gui/scrape-examples-interactions.goml +++ b/src/test/rustdoc-gui/scrape-examples-button-focus.goml @@ -27,16 +27,3 @@ store-property: (fullOffsetHeight, ".scraped-example-list > .scraped-example pre 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": ""}) diff --git a/src/test/rustdoc-gui/scrape-examples-toggle.goml b/src/test/rustdoc-gui/scrape-examples-toggle.goml new file mode 100644 index 00000000000..ee720afb788 --- /dev/null +++ b/src/test/rustdoc-gui/scrape-examples-toggle.goml @@ -0,0 +1,14 @@ +goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" + +// 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": ""}) diff --git a/src/test/rustdoc-gui/src/scrape_examples/examples/check2.rs b/src/test/rustdoc-gui/src/scrape_examples/examples/check2.rs deleted file mode 100644 index 3e69c6086ae..00000000000 --- a/src/test/rustdoc-gui/src/scrape_examples/examples/check2.rs +++ /dev/null @@ -1,25 +0,0 @@ -fn main() { - for i in 0..9 { - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - } - scrape_examples::test(); - for i in 0..9 { - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - println!("hello world!"); - } -} |
