@@ -9,13 +9,32 @@ property: ("#implementations-list .implementors-toggle", {"open": "false"})
99click: "//*[@class='sidebar']//a[@href='#method.must_use']"
1010assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
1111
12- // Now we do the same through search result.
13- // First we reload the page without the anchor in the URL.
12+ define-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+ goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
16+ // Then we collapse the section again...
17+ 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+
25+ call-function: ("collapsed-from-search", {})
26+
27+ // Now running the same check but with mobile.
28+ size: (600, 600)
1429goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
15- // Then we collapse the section again...
30+ // We check that the implementors block is expanded.
31+ assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
32+ // We now collapse the implementors block.
1633property: ("#implementations-list .implementors-toggle", {"open": "false"})
17- // Then we run the search .
18- write: (".search-input", "foo::must_use")
19- wait-for: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html# method.must_use']"
20- click: "//*[@id='search ']//a[@href='../test_docs/struct.Foo.html #method.must_use']"
34+ // First we expand the mobile menu .
35+ click: ".sidebar-menu-toggle"
36+ // Then we click on the link to the method to ensure it'll expand the implementors block.
37+ click: "//*[@class='sidebar shown ']//a[@href='#method.must_use']"
2138assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
39+
40+ call-function: ("collapsed-from-search", {})
0 commit comments