2022-01-21 20:41:47 +01:00
|
|
|
|
// Checks that the documentation toggles have the correct position, style and work as expected.
|
2021-05-02 16:50:14 +02:00
|
|
|
|
goto: file://|DOC_PATH|/test_docs/index.html
|
2021-11-29 17:14:05 +01:00
|
|
|
|
assert-attribute: ("#main-content > details.top-doc", {"open": ""})
|
2021-12-03 17:09:04 -08:00
|
|
|
|
assert-text: ("#toggle-all-docs", "[−]")
|
2021-02-21 14:25:12 +01:00
|
|
|
|
click: "#toggle-all-docs"
|
2022-02-19 14:46:37 +01:00
|
|
|
|
wait-for: 50
|
2021-05-11 20:56:07 +02:00
|
|
|
|
// This is now collapsed so there shouldn't be the "open" attribute on details.
|
2021-11-29 17:14:05 +01:00
|
|
|
|
assert-attribute-false: ("#main-content > details.top-doc", {"open": ""})
|
2021-12-03 17:09:04 -08:00
|
|
|
|
assert-text: ("#toggle-all-docs", "[+]")
|
2021-02-21 14:25:12 +01:00
|
|
|
|
click: "#toggle-all-docs"
|
2022-02-19 14:46:37 +01:00
|
|
|
|
wait-for: 50
|
2021-05-11 20:56:07 +02:00
|
|
|
|
// Not collapsed anymore so the "open" attribute should be back.
|
2021-11-29 17:14:05 +01:00
|
|
|
|
assert-attribute: ("#main-content > details.top-doc", {"open": ""})
|
2021-12-03 17:09:04 -08:00
|
|
|
|
assert-text: ("#toggle-all-docs", "[−]")
|
2022-02-19 14:46:37 +01:00
|
|
|
|
|
|
|
|
|
// Check that it works on non-module pages as well.
|
|
|
|
|
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
|
|
|
|
|
// We first check that everything is visible.
|
|
|
|
|
assert-text: ("#toggle-all-docs", "[−]")
|
2022-03-08 17:52:31 +01:00
|
|
|
|
assert-attribute: ("#implementations-list details.rustdoc-toggle", {"open": ""}, ALL)
|
|
|
|
|
assert-attribute: ("#trait-implementations-list details.rustdoc-toggle", {"open": ""}, ALL)
|
|
|
|
|
assert-attribute-false: (
|
|
|
|
|
"#blanket-implementations-list > details.rustdoc-toggle",
|
|
|
|
|
{"open": ""},
|
|
|
|
|
ALL,
|
|
|
|
|
)
|
|
|
|
|
|
2022-02-19 14:46:37 +01:00
|
|
|
|
// We collapse them all.
|
|
|
|
|
click: "#toggle-all-docs"
|
|
|
|
|
wait-for: 50
|
|
|
|
|
assert-text: ("#toggle-all-docs", "[+]")
|
|
|
|
|
// We check that all <details> are collapsed (except for the impl block ones).
|
|
|
|
|
assert-attribute-false: ("details.rustdoc-toggle:not(.implementors-toggle)", {"open": ""}, ALL)
|
2022-03-08 18:11:29 +01:00
|
|
|
|
assert-attribute: ("#implementations-list > details.implementors-toggle", {"open": ""})
|
2022-02-19 14:46:37 +01:00
|
|
|
|
// We now check that the other impl blocks are collapsed.
|
|
|
|
|
assert-attribute-false: (
|
|
|
|
|
"#blanket-implementations-list > details.rustdoc-toggle.implementors-toggle",
|
|
|
|
|
{"open": ""},
|
|
|
|
|
ALL,
|
|
|
|
|
)
|
|
|
|
|
// We open them all again.
|
|
|
|
|
click: "#toggle-all-docs"
|
|
|
|
|
wait-for: 50
|
|
|
|
|
assert-text: ("#toggle-all-docs", "[−]")
|
|
|
|
|
assert-attribute: ("details.rustdoc-toggle", {"open": ""}, ALL)
|