1 // This test ensures that the mobile sidebar preserves scroll position.
2 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
3 // Switching to "mobile view" by reducing the width to 600px.
5 assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
8 scroll-to: "//h2[@id='blanket-implementations']"
9 assert-window-property: {"pageYOffset": "651"}
11 // Open the sidebar menu.
12 click: ".sidebar-menu-toggle"
13 wait-for-css: (".sidebar", {"left": "0px"})
15 // We are no longer "scrolled". It's important that the user can't
16 // scroll the body at all, but these test scripts are run only in Chrome,
17 // and we need to use a more complicated solution to this problem because
18 // of Mobile Safari...
19 assert-window-property: {"pageYOffset": "0"}
21 // Close the sidebar menu. Make sure the scroll position gets restored.
22 click: ".sidebar-menu-toggle"
23 wait-for-css: (".sidebar", {"left": "-1000px"})
24 assert-window-property: {"pageYOffset": "651"}
26 // Now test that scrollability returns when the browser window is just resized.
27 click: ".sidebar-menu-toggle"
28 wait-for-css: (".sidebar", {"left": "0px"})
29 assert-window-property: {"pageYOffset": "0"}
31 assert-window-property: {"pageYOffset": "651"}