2021-05-02 11:59:31 -05:00
|
|
|
goto: file://|DOC_PATH|/test_docs/index.html
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 18:48:24 -06:00
|
|
|
show-text: true
|
|
|
|
local-storage: {"rustdoc-theme": "light"}
|
|
|
|
// We reload the page so the local storage settings are being used.
|
|
|
|
reload:
|
|
|
|
|
2021-06-19 05:56:55 -05:00
|
|
|
assert-text: (".sidebar > .location", "Crate test_docs")
|
2021-05-02 11:59:31 -05:00
|
|
|
// In modules, we only have one "location" element.
|
2021-06-19 05:56:55 -05:00
|
|
|
assert-count: (".sidebar .location", 1)
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 18:48:24 -06:00
|
|
|
assert-text: ("#all-types", "All Items")
|
|
|
|
assert-css: ("#all-types", {"color": "rgb(56, 115, 173)"})
|
2021-05-02 11:59:31 -05:00
|
|
|
// We check that we have the crates list and that the "current" on is "test_docs".
|
2021-11-04 10:27:02 -05:00
|
|
|
assert-text: (".sidebar-elems .crate > ul > li > a.current", "test_docs")
|
2021-05-02 11:59:31 -05:00
|
|
|
// And we're also supposed to have the list of items in the current module.
|
2021-11-04 10:27:02 -05:00
|
|
|
assert-text: (".sidebar-elems .items > ul > li:nth-child(1)", "Modules")
|
|
|
|
assert-text: (".sidebar-elems .items > ul > li:nth-child(2)", "Macros")
|
|
|
|
assert-text: (".sidebar-elems .items > ul > li:nth-child(3)", "Structs")
|
|
|
|
assert-text: (".sidebar-elems .items > ul > li:nth-child(4)", "Enums")
|
|
|
|
assert-text: (".sidebar-elems .items > ul > li:nth-child(5)", "Traits")
|
|
|
|
assert-text: (".sidebar-elems .items > ul > li:nth-child(6)", "Functions")
|
|
|
|
assert-text: (".sidebar-elems .items > ul > li:nth-child(7)", "Type Definitions")
|
|
|
|
assert-text: (".sidebar-elems .items > ul > li:nth-child(8)", "Unions")
|
|
|
|
assert-text: (".sidebar-elems .items > ul > li:nth-child(9)", "Keywords")
|
2021-06-16 09:16:11 -05:00
|
|
|
assert-text: ("#structs + .item-table .item-left > a", "Foo")
|
|
|
|
click: "#structs + .item-table .item-left > a"
|
2021-05-02 11:59:31 -05:00
|
|
|
|
|
|
|
// PAGE: struct.Foo.html
|
2021-06-19 05:56:55 -05:00
|
|
|
assert-count: (".sidebar .location", 2)
|
2021-05-31 04:51:22 -05:00
|
|
|
// We check that there is no crate listed outside of the top level.
|
|
|
|
assert-false: ".sidebar-elems > .crate"
|
2022-01-11 16:39:51 -06:00
|
|
|
|
|
|
|
click: ".sidebar-links a"
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 18:48:24 -06:00
|
|
|
assert-property-false: ("html", {"scrollTop": "0"})
|
2022-01-11 16:39:51 -06:00
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 18:48:24 -06:00
|
|
|
click: ".sidebar h2.location a"
|
2022-01-11 16:39:51 -06:00
|
|
|
assert-property: ("html", {"scrollTop": "0"})
|
|
|
|
|
2021-05-31 05:11:05 -05:00
|
|
|
// We now go back to the crate page to click on the "lib2" crate link.
|
|
|
|
goto: file://|DOC_PATH|/test_docs/index.html
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 18:48:24 -06:00
|
|
|
assert-css: (".sidebar-elems .crate > ul > li:first-child > a", {"color": "rgb(56, 115, 173)"})
|
2021-11-04 10:27:02 -05:00
|
|
|
click: ".sidebar-elems .crate > ul > li:first-child > a"
|
2021-05-02 11:59:31 -05:00
|
|
|
|
|
|
|
// PAGE: lib2/index.html
|
2021-05-31 04:51:22 -05:00
|
|
|
goto: file://|DOC_PATH|/lib2/index.html
|
2021-06-19 05:56:55 -05:00
|
|
|
assert-text: (".sidebar > .location", "Crate lib2")
|
2021-05-02 11:59:31 -05:00
|
|
|
// We check that we have the crates list and that the "current" on is now "lib2".
|
2021-11-04 10:27:02 -05:00
|
|
|
assert-text: (".sidebar-elems .crate > ul > li > a.current", "lib2")
|
2021-05-02 11:59:31 -05:00
|
|
|
// We now go to the "foobar" function page.
|
2021-06-19 05:56:55 -05:00
|
|
|
assert-text: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules")
|
|
|
|
assert-text: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs")
|
|
|
|
assert-text: (".sidebar-elems > .items > ul > li:nth-child(3)", "Traits")
|
|
|
|
assert-text: (".sidebar-elems > .items > ul > li:nth-child(4)", "Functions")
|
|
|
|
assert-text: (".sidebar-elems > .items > ul > li:nth-child(5)", "Type Definitions")
|
2021-06-16 09:16:11 -05:00
|
|
|
assert-text: ("#functions + .item-table .item-left > a", "foobar")
|
|
|
|
click: "#functions + .item-table .item-left > a"
|
2021-05-02 11:59:31 -05:00
|
|
|
|
|
|
|
// PAGE: fn.foobar.html
|
|
|
|
// In items containing no items (like functions or constants) and in modules, we have one
|
|
|
|
// "location" elements.
|
2021-06-19 05:56:55 -05:00
|
|
|
assert-count: (".sidebar .location", 1)
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 18:48:24 -06:00
|
|
|
assert-text: (".sidebar .sidebar-elems .location", "In lib2")
|
2021-05-31 05:11:05 -05:00
|
|
|
// We check that we don't have the crate list.
|
|
|
|
assert-false: ".sidebar-elems > .crate"
|
|
|
|
|
|
|
|
goto: ./module/index.html
|
2021-06-19 05:56:55 -05:00
|
|
|
assert-text: (".sidebar > .location", "Module module")
|
2021-05-31 04:51:22 -05:00
|
|
|
// We check that we don't have the crate list.
|
|
|
|
assert-false: ".sidebar-elems > .crate"
|
2021-05-02 11:59:31 -05:00
|
|
|
|
2021-05-31 05:11:05 -05:00
|
|
|
goto: ./sub_module/sub_sub_module/index.html
|
2021-06-19 05:56:55 -05:00
|
|
|
assert-text: (".sidebar > .location", "Module sub_sub_module")
|
2021-05-31 04:51:22 -05:00
|
|
|
// We check that we don't have the crate list.
|
2021-11-04 10:27:02 -05:00
|
|
|
assert-false: ".sidebar-elems .crate"
|
|
|
|
assert-text: (".sidebar-elems .items > ul > li:nth-child(1)", "Functions")
|
2021-06-16 09:16:11 -05:00
|
|
|
assert-text: ("#functions + .item-table .item-left > a", "foo")
|