rust/tests/rustdoc-gui/toggle-docs-mobile.goml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
1.4 KiB
Plaintext
Raw Normal View History

2022-01-21 13:41:47 -06:00
// Checks that the documentation toggles on mobile have the correct position, style and work
// as expected.
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
set-window-size: (433, 600)
2021-06-22 04:11:45 -05:00
assert-attribute: (".top-doc", {"open": ""})
click: (4, 270) // This is the position of the top doc comment toggle
2021-06-22 04:11:45 -05:00
assert-attribute-false: (".top-doc", {"open": ""})
click: (4, 270)
2021-06-22 04:11:45 -05:00
assert-attribute: (".top-doc", {"open": ""})
2021-05-14 08:16:16 -05:00
// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
click: (3, 270)
2021-06-22 04:11:45 -05:00
assert-attribute: (".top-doc", {"open": ""})
2021-05-14 08:16:16 -05:00
2021-12-29 11:54:33 -06:00
// Assert the position of the toggle on the top doc block.
assert-position: (".top-doc summary::before", {"x": 4})
// Assert the position of the toggle on the impl block.
assert-position: ("#implementations-list > details > summary::before", {"x": 4})
2021-12-29 11:54:33 -06:00
// Assert the position of the toggle on a method.
assert-position: (
"#trait-implementations-list .impl-items .method-toggle > summary::before",
{"x": 4},
)
2021-05-14 08:16:16 -05:00
// Now we do the same but with a little bigger width
set-window-size: (600, 600)
2021-06-22 04:11:45 -05:00
assert-attribute: (".top-doc", {"open": ""})
click: (4, 270) // New Y position since all search elements are back on one line.
2021-06-22 04:11:45 -05:00
assert-attribute-false: (".top-doc", {"open": ""})
click: (4, 270)
2021-06-22 04:11:45 -05:00
assert-attribute: (".top-doc", {"open": ""})
2021-05-14 08:16:16 -05:00
// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
click: (3, 270)
2021-06-22 04:11:45 -05:00
assert-attribute: (".top-doc", {"open": ""})