fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// This test ensures that when clicking on a link which leads to an item inside a collapsed element, 2// the collapsed element will be expanded. 3go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" 4// We check that the implementors block is expanded. 5assert-property: ("#implementations-list .implementors-toggle", {"open": "true"}) 6// We now collapse the implementors block. 7set-property: ("#implementations-list .implementors-toggle", {"open": "false"}) 8// And now we click on the link to the method to ensure it'll expand the implementors block. 9click: "//*[@class='sidebar']//a[@href='#method.must_use']" 10assert-property: ("#implementations-list .implementors-toggle", {"open": "true"}) 11 12define-function: ("collapsed-from-search", (), block { 13 // Now we do the same through search result. 14 // First we reload the page without the anchor in the URL. 15 go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" 16 // Then we collapse the section again... 17 set-property: ("#implementations-list .implementors-toggle", {"open": "false"}) 18 // Then we run the search. 19 write: (".search-input", "foo::must_use") 20 wait-for: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']" 21 click: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']" 22 assert-property: ("#implementations-list .implementors-toggle", {"open": "true"}) 23}) 24 25call-function: ("collapsed-from-search", {}) 26 27// Now running the same check but with mobile. 28set-window-size: (600, 600) 29go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" 30// We check that the implementors block is expanded. 31assert-property: ("#implementations-list .implementors-toggle", {"open": "true"}) 32// We now collapse the implementors block. 33set-property: ("#implementations-list .implementors-toggle", {"open": "false"}) 34// First we expand the mobile menu. 35click: ".sidebar-menu-toggle" 36// Then we click on the link to the method to ensure it'll expand the implementors block. 37click: "//*[@class='sidebar shown']//a[@href='#method.must_use']" 38assert-property: ("#implementations-list .implementors-toggle", {"open": "true"}) 39 40call-function: ("collapsed-from-search", {})