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 19:41:47 +00: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 09:11:45 +00:00
assert-attribute: (".top-doc", {"open": ""})
click: (4, 270) // This is the position of the top doc comment toggle
2021-06-22 09:11:45 +00:00
assert-attribute-false: (".top-doc", {"open": ""})
click: (4, 270)
2021-06-22 09:11:45 +00:00
assert-attribute: (".top-doc", {"open": ""})
2021-05-14 13:16:16 +00: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 09:11:45 +00:00
assert-attribute: (".top-doc", {"open": ""})
2021-05-14 13:16:16 +00:00
2021-12-29 17:54:33 +00: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 17:54:33 +00: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 13:16:16 +00:00
// Now we do the same but with a little bigger width
set-window-size: (600, 600)
2021-06-22 09:11:45 +00:00
assert-attribute: (".top-doc", {"open": ""})
click: (4, 270) // New Y position since all search elements are back on one line.
2021-06-22 09:11:45 +00:00
assert-attribute-false: (".top-doc", {"open": ""})
click: (4, 270)
2021-06-22 09:11:45 +00:00
assert-attribute: (".top-doc", {"open": ""})
2021-05-14 13:16:16 +00: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 09:11:45 +00:00
assert-attribute: (".top-doc", {"open": ""})