-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UI regression test for rustdoc sidebar position
- Loading branch information
1 parent
a4ec2c4
commit 53e2d9b
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Checks the sidebar display. | ||
go-to: |DOC_PATH| + "/sysinfo" | ||
|
||
set-window-size: (1000, 1000) | ||
|
||
// First we check that the rustdoc sidebar is not overlaying the docs.rs topbar. | ||
store-size: (".rustdoc-page .nav-container", {"height": topbar_height}) | ||
assert-position: (".rustdoc .sidebar", {"y": |topbar_height|, "x": 0}) | ||
|
||
// We check the same in "mobile mode". | ||
set-window-size: (600, 1000) | ||
assert-position: (".rustdoc .mobile-topbar", {"y": |topbar_height|, "x": 0}) | ||
// We check when the sidebar is shown now. | ||
click: ".rustdoc .mobile-topbar .sidebar-menu-toggle" | ||
wait-for: ".rustdoc .sidebar.shown" | ||
// The mobile sidebar is supposed to be under the rustdoc mobile topbar + docs.rs topbar. | ||
store-size: (".rustdoc .mobile-topbar", {"height": rustdoc_topbar_height}) | ||
assert-position: (".rustdoc .sidebar.shown", { | ||
"y": |topbar_height| + |rustdoc_topbar_height|, | ||
"x": 0, | ||
}) | ||
|
||
// We reset the window's size. | ||
set-window-size: (1000, 1000) | ||
|
||
// We now go to the source code page. | ||
wait-for: ".main-heading a.src" | ||
click: ".main-heading a.src" | ||
|
||
// We wait for the page to load... | ||
wait-for: ".rustdoc.src" | ||
// We check that the sidebar has the correct position. | ||
assert-position: (".rustdoc .sidebar", {"y": |topbar_height|, "x": 0}) | ||
// We expand the sidebar. | ||
click: "#src-sidebar-toggle button" | ||
wait-for: ".src-sidebar-expanded" | ||
// We check the position again. | ||
assert-position: (".rustdoc .sidebar", {"y": |topbar_height|, "x": 0}) | ||
|
||
// We check in "mobile mode". | ||
set-window-size: (600, 1000) | ||
// We check the position again. | ||
assert-position: (".rustdoc .sidebar", {"y": |topbar_height|, "x": 0}) |