rustdoc: add test case for huge logo

This commit is contained in:
Michael Howell 2022-11-05 10:14:31 -07:00
parent cb184bb023
commit 21894801c6
7 changed files with 57 additions and 2 deletions

View File

@ -0,0 +1,21 @@
// huge_logo crate has a custom 712x860 logo
// test to ensure the maximum size in the layout works correctly
goto: "file://" + |DOC_PATH| + "/huge_logo/index.html"
size: (1280, 1024)
// offsetWidth = width of sidebar
assert-property: (".sidebar .logo-container", {"offsetWidth": "200", "offsetHeight": 100})
assert-property: (".sidebar .logo-container img", {"offsetWidth": "100", "offsetHeight": 100})
size: (400, 600)
// offset = size + margin
assert-property: (".mobile-topbar .logo-container", {"offsetWidth": "55", "offsetHeight": 45})
assert-property: (".mobile-topbar .logo-container img", {"offsetWidth": "35", "offsetHeight": 35})
goto: "file://" + |DOC_PATH| + "/src/huge_logo/lib.rs.html"
size: (1280, 1024)
assert-property: (".sub-logo-container", {"offsetWidth": "60", "offsetHeight": 60})
size: (400, 600)
assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 35})

View File

@ -14,6 +14,7 @@ click: "#crate-search"
// We select "lib2" option then press enter to change the filter.
press-key: "ArrowDown"
press-key: "ArrowDown"
press-key: "ArrowDown"
press-key: "Enter"
// Waiting for the search results to appear...
wait-for: "#titles"
@ -37,6 +38,7 @@ assert-property: ("#crate-search", {"value": "lib2"})
click: "#crate-search"
press-key: "ArrowUp"
press-key: "ArrowUp"
press-key: "ArrowUp"
press-key: "Enter"
// Waiting for the search results to appear...
wait-for: "#titles"

View File

@ -28,7 +28,7 @@ assert: "//*[@class='dir-entry' and @open]/*[text()='sub_mod']"
// Only "another_folder" should be "open" in "lib2".
assert: "//*[@class='dir-entry' and not(@open)]/*[text()='another_mod']"
// All other trees should be collapsed.
assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 5)
assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 6)
// We now switch to mobile mode.
size: (600, 600)

View File

@ -78,7 +78,7 @@ assert: ".source-sidebar-expanded"
// We check that the first entry of the sidebar is collapsed
assert-property: ("#source-sidebar details:first-of-type", {"open": "false"})
assert-text: ("#source-sidebar details:first-of-type > summary", "implementors")
assert-text: ("#source-sidebar details:first-of-type > summary", "huge_logo")
// We now click on it.
click: "#source-sidebar details:first-of-type > summary"
assert-property: ("#source-sidebar details:first-of-type", {"open": "true"})

View File

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "huge_logo"
version = "0.1.0"

View File

@ -0,0 +1,8 @@
[package]
name = "huge_logo"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

File diff suppressed because one or more lines are too long