mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Add tests to check that collapsed content is expanded when jumping to it
This commit is contained in:
parent
aab9e32094
commit
efad057eed
21
tests/rustdoc-gui/go-to-collapsed-elem.goml
Normal file
21
tests/rustdoc-gui/go-to-collapsed-elem.goml
Normal file
@ -0,0 +1,21 @@
|
||||
// This test ensures that when clicking on a link which leads to an item inside a collapsed element,
|
||||
// the collapsed element will be expanded.
|
||||
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
|
||||
// We check that the implementors block is expanded.
|
||||
assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
|
||||
// We now collapse the implementors block.
|
||||
property: ("#implementations-list .implementors-toggle", {"open": "false"})
|
||||
// And now we click on the link to the method to ensure it'll expand the implementors block.
|
||||
click: "//*[@class='sidebar']//a[@href='#method.must_use']"
|
||||
assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
|
||||
|
||||
// Now we do the same through search result.
|
||||
// First we reload the page without the anchor in the URL.
|
||||
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
|
||||
// Then we collapse the section again...
|
||||
property: ("#implementations-list .implementors-toggle", {"open": "false"})
|
||||
// Then we run the search.
|
||||
write: (".search-input", "foo::must_use")
|
||||
wait-for: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']"
|
||||
click: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']"
|
||||
assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
|
Loading…
Reference in New Issue
Block a user