Skip to content

Commit 273b221

Browse files
authored
Rollup merge of rust-lang#110016 - GuillaumeGomez:gui-collapsed-mobile, r=notriddle
Run collapsed GUI test in mobile mode as well Extending test from rust-lang#109818 to be run on mobile as well. Part of rust-lang#66181. r? `@notriddle`
2 parents e708189 + 529ceee commit 273b221

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

tests/rustdoc-gui/go-to-collapsed-elem.goml

+26-7
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,32 @@ property: ("#implementations-list .implementors-toggle", {"open": "false"})
99
click: "//*[@class='sidebar']//a[@href='#method.must_use']"
1010
assert-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)
1429
goto: "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.
1633
property: ("#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']"
2138
assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
39+
40+
call-function: ("collapsed-from-search", {})

0 commit comments

Comments
 (0)