Update to new browser-ui-test version

This commit is contained in:
Guillaume Gomez 2024-04-01 21:11:22 +02:00
parent 6bb6b816bf
commit 59120d0ef5
59 changed files with 267 additions and 249 deletions

View file

@ -2,7 +2,7 @@
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, main_color, title_color, main_heading_color, main_heading_type_color, src_link_color, sidebar_link_color), [theme, main_color, title_color, main_heading_color, main_heading_type_color, src_link_color, sidebar_link_color],
block { block {
go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html" go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
// This is needed to ensure that the text color is computed. // This is needed to ensure that the text color is computed.

View file

@ -8,7 +8,7 @@ show-text: true
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, doc_code_color, doc_inline_code_color), [theme, doc_code_color, doc_inline_code_color],
block { block {
// Set the theme. // Set the theme.
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}

View file

@ -4,7 +4,7 @@ show-text: true
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, background, color, border), [theme, background, color, border],
block { block {
// Setting the theme. // Setting the theme.
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}

View file

@ -8,7 +8,7 @@ assert-css: ("#toggle-all-docs", {"cursor": "pointer"})
assert-css: ("#copy-path", {"cursor": "pointer"}) assert-css: ("#copy-path", {"cursor": "pointer"})
// the search tabs // the search tabs
write: (".search-input", "Foo") write-into: (".search-input", "Foo")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...

View file

@ -10,7 +10,7 @@ assert-false: "pre.example-line-numbers"
// Let's now check some CSS properties... // Let's now check some CSS properties...
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, color), [theme, color],
block { block {
// We now set the setting to show the line numbers on code examples. // We now set the setting to show the line numbers on code examples.
set-local-storage: { set-local-storage: {

View file

@ -6,7 +6,7 @@ compare-elements-css: (".impl-items .docblock table td", ".top-doc .docblock tab
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, border_color, zebra_stripe_color), [theme, border_color, zebra_stripe_color],
block { block {
set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|} set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}
reload: reload:

View file

@ -2,7 +2,7 @@
// current content displayed. // current content displayed.
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// First, we check that the search results are hidden when the Escape key is pressed. // First, we check that the search results are hidden when the Escape key is pressed.
write: (".search-input", "test") write-into: (".search-input", "test")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
wait-for: "#search h1" // The search element is empty before the first search wait-for: "#search h1" // The search element is empty before the first search

View file

@ -10,7 +10,7 @@ assert-window-property: {"srcIndex": null}
// Form input // Form input
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "Foo") write-into: (".search-input", "Foo")
press-key: 'Enter' press-key: 'Enter'
wait-for: "#search-tabs" wait-for: "#search-tabs"
assert-window-property-false: {"searchIndex": null} assert-window-property-false: {"searchIndex": null}

View file

@ -9,14 +9,14 @@ set-property: ("#implementations-list .implementors-toggle", {"open": "false"})
click: "//*[@class='sidebar']//a[@href='#method.must_use']" click: "//*[@class='sidebar']//a[@href='#method.must_use']"
assert-property: ("#implementations-list .implementors-toggle", {"open": "true"}) assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
define-function: ("collapsed-from-search", (), block { define-function: ("collapsed-from-search", [], block {
// Now we do the same through search result. // Now we do the same through search result.
// First we reload the page without the anchor in the URL. // First we reload the page without the anchor in the URL.
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// Then we collapse the section again... // Then we collapse the section again...
set-property: ("#implementations-list .implementors-toggle", {"open": "false"}) set-property: ("#implementations-list .implementors-toggle", {"open": "false"})
// Then we run the search. // Then we run the search.
write: (".search-input", "foo::must_use") write-into: (".search-input", "foo::must_use")
wait-for: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']" wait-for: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']"
click: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']" click: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']"
assert-property: ("#implementations-list .implementors-toggle", {"open": "true"}) assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})

View file

@ -2,7 +2,7 @@
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, color, code_header_color, focus_background_color, headings_color), [theme, color, code_header_color, focus_background_color, headings_color],
block { block {
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// This is needed so that the text color is computed. // This is needed so that the text color is computed.

View file

@ -4,7 +4,7 @@ show-text: true
define-function: ( define-function: (
"check-heading-anchor", "check-heading-anchor",
(heading_id), [heading_id],
block { block {
// The anchor should not be displayed by default. // The anchor should not be displayed by default.
assert-css: ("#" + |heading_id| + " .doc-anchor", { "display": "none" }) assert-css: ("#" + |heading_id| + " .doc-anchor", { "display": "none" })
@ -27,6 +27,6 @@ move-cursor-to: "#top-doc-prose-title"
// to prevent it from overlapping with the `[-]` element. // to prevent it from overlapping with the `[-]` element.
assert-css: ("#top-doc-prose-title:hover .doc-anchor", { "display": "none" }) assert-css: ("#top-doc-prose-title:hover .doc-anchor", { "display": "none" })
call-function: ("check-heading-anchor", ("top-doc-prose-sub-heading")) call-function: ("check-heading-anchor", {"heading_id": "top-doc-prose-sub-heading"})
call-function: ("check-heading-anchor", ("top-doc-prose-sub-sub-heading")) call-function: ("check-heading-anchor", {"heading_id": "top-doc-prose-sub-sub-heading"})
call-function: ("check-heading-anchor", ("you-know-the-drill")) call-function: ("check-heading-anchor", {"heading_id": "you-know-the-drill"})

View file

@ -156,7 +156,7 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, heading_color, small_heading_color, heading_border_color), [theme, heading_color, small_heading_color, heading_border_color],
block { block {
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload: reload:
@ -220,7 +220,7 @@ call-function: (
define-function: ( define-function: (
"check-since-color", "check-since-color",
(theme), [theme],
block { block {
set-local-storage: {"rustdoc-theme": |theme|} set-local-storage: {"rustdoc-theme": |theme|}
reload: reload:
@ -229,6 +229,6 @@ define-function: (
) )
go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html" go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
call-function: ("check-since-color", ("ayu")) call-function: ("check-since-color", {"theme": "ayu"})
call-function: ("check-since-color", ("dark")) call-function: ("check-since-color", {"theme": "dark"})
call-function: ("check-since-color", ("light")) call-function: ("check-since-color", {"theme": "light"})

View file

@ -7,17 +7,17 @@ assert-css: ("#help dd", {"font-size": "16px"})
click: "#help-button > a" click: "#help-button > a"
assert-css: ("#help", {"display": "block"}) assert-css: ("#help", {"display": "block"})
compare-elements-property: (".sub", "#help", ["offsetWidth"]) compare-elements-property: (".sub", "#help", ["offsetWidth"])
compare-elements-position: (".sub", "#help", ("x")) compare-elements-position: (".sub", "#help", ["x"])
set-window-size: (500, 1000) // Try mobile next. set-window-size: (500, 1000) // Try mobile next.
assert-css: ("#help", {"display": "block"}) assert-css: ("#help", {"display": "block"})
compare-elements-property: (".sub", "#help", ["offsetWidth"]) compare-elements-property: (".sub", "#help", ["offsetWidth"])
compare-elements-position: (".sub", "#help", ("x")) compare-elements-position: (".sub", "#help", ["x"])
// Checking the color of the elements of the help menu. // Checking the color of the elements of the help menu.
show-text: true show-text: true
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, color, background, box_shadow), [theme, color, background, box_shadow],
block { block {
// Setting the theme. // Setting the theme.
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
@ -60,7 +60,7 @@ assert-css: ("#help dd", {"font-size": "16px"})
click: "#help-button > a" click: "#help-button > a"
assert-css: ("#help", {"display": "none"}) assert-css: ("#help", {"display": "none"})
compare-elements-property-false: (".sub", "#help", ["offsetWidth"]) compare-elements-property-false: (".sub", "#help", ["offsetWidth"])
compare-elements-position-false: (".sub", "#help", ("x")) compare-elements-position-false: (".sub", "#help", ["x"])
// This test ensures that the "the rustdoc book" anchor link within the help popover works. // This test ensures that the "the rustdoc book" anchor link within the help popover works.
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"

View file

@ -4,7 +4,7 @@ show-text: true
define-function: ( define-function: (
"check-colors", "check-colors",
( [
theme, theme,
kw, kw,
kw2, kw2,
@ -20,7 +20,7 @@ define-function: (
question_mark, question_mark,
comment, comment,
doc_comment, doc_comment,
), ],
block { block {
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload: reload:

View file

@ -6,7 +6,7 @@ fail-on-request-error: false
define-function: ( define-function: (
"check-colors", "check-colors",
( [
theme, theme,
attr_color, attr_color,
trait_color, trait_color,
@ -16,7 +16,7 @@ define-function: (
constant_color, constant_color,
fn_color, fn_color,
assoc_type_color, assoc_type_color,
), ],
block { block {
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html" go-to: "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html"
show-text: true show-text: true

View file

@ -4,7 +4,7 @@ show-text: true
define-function: ( define-function: (
"check-item-decl-comment", "check-item-decl-comment",
(theme, url, comment_color), [theme, url, comment_color],
block { block {
go-to: |url| go-to: |url|
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
@ -15,7 +15,7 @@ define-function: (
define-function: ( define-function: (
"check-items-for-theme", "check-items-for-theme",
(theme, comment_color), [theme, comment_color],
block { block {
call-function: ("check-item-decl-comment", { call-function: ("check-item-decl-comment", {
"theme": |theme|, "theme": |theme|,

View file

@ -4,7 +4,7 @@ go-to: "file://" + |DOC_PATH| + "/lib2/struct.ItemInfoAlignmentTest.html"
// First, we try it in "desktop" mode. // First, we try it in "desktop" mode.
set-window-size: (1200, 870) set-window-size: (1200, 870)
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x")) compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ["x"])
// Next, we try it in "mobile" mode (max-width: 700px). // Next, we try it in "mobile" mode (max-width: 700px).
set-window-size: (650, 650) set-window-size: (650, 650)
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x")) compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ["x"])

View file

@ -31,13 +31,13 @@ assert-count: ("#main-content > .item-info .stab", 2)
compare-elements-position-false: ( compare-elements-position-false: (
"#main-content > .item-info .stab:nth-of-type(1)", "#main-content > .item-info .stab:nth-of-type(1)",
"#main-content > .item-info .stab:nth-of-type(2)", "#main-content > .item-info .stab:nth-of-type(2)",
("y"), ["y"],
) )
// But they should have the same `x` position. // But they should have the same `x` position.
compare-elements-position: ( compare-elements-position: (
"#main-content > .item-info .stab:nth-of-type(1)", "#main-content > .item-info .stab:nth-of-type(1)",
"#main-content > .item-info .stab:nth-of-type(2)", "#main-content > .item-info .stab:nth-of-type(2)",
("x"), ["x"],
) )
// They are supposed to have the same height too. // They are supposed to have the same height too.
compare-elements-css: ( compare-elements-css: (

View file

@ -3,7 +3,7 @@ go-to: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html"
define-function: ( define-function: (
"check-background-color", "check-background-color",
(theme, background_color), [theme, background_color],
block { block {
// Set the theme. // Set the theme.
set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" } set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" }
@ -17,6 +17,15 @@ define-function: (
}, },
) )
call-function: ("check-background-color", ("ayu", "#333")) call-function: ("check-background-color", {
call-function: ("check-background-color", ("dark", "#333")) "theme": "ayu",
call-function: ("check-background-color", ("light", "#eee")) "background_color": "#333",
})
call-function: ("check-background-color", {
"theme": "dark",
"background_color": "#333",
})
call-function: ("check-background-color", {
"theme": "light",
"background_color": "#eee",
})

View file

@ -27,14 +27,14 @@ compare-elements-position-near: (
compare-elements-position: ( compare-elements-position: (
".item-name .stab.deprecated", ".item-name .stab.deprecated",
".item-name .stab.portability", ".item-name .stab.portability",
("y"), ["y"],
) )
// Ensure no wrap // Ensure no wrap
compare-elements-position: ( compare-elements-position: (
"//*[@class='item-name']//a[text()='replaced_function']/..", "//*[@class='item-name']//a[text()='replaced_function']/..",
"//*[@class='desc docblock-short'][text()='a thing with a label']", "//*[@class='desc docblock-short'][text()='a thing with a label']",
("y"), ["y"],
) )
// Mobile view // Mobile view
@ -49,19 +49,19 @@ compare-elements-position-near: (
compare-elements-position: ( compare-elements-position: (
".item-name .stab.deprecated", ".item-name .stab.deprecated",
".item-name .stab.portability", ".item-name .stab.portability",
("y"), ["y"],
) )
// Ensure wrap // Ensure wrap
compare-elements-position-false: ( compare-elements-position-false: (
"//*[@class='item-name']//a[text()='replaced_function']/..", "//*[@class='item-name']//a[text()='replaced_function']/..",
"//*[@class='desc docblock-short'][text()='a thing with a label']", "//*[@class='desc docblock-short'][text()='a thing with a label']",
("y"), ["y"],
) )
compare-elements-position-false: ( compare-elements-position-false: (
".item-name .stab.deprecated", ".item-name .stab.deprecated",
"//*[@class='desc docblock-short'][text()='a thing with a label']", "//*[@class='desc docblock-short'][text()='a thing with a label']",
("y"), ["y"],
) )
// Ensure it doesn't expand. // Ensure it doesn't expand.
@ -72,5 +72,5 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/cfgs/index.html"
compare-elements-position-false: ( compare-elements-position-false: (
"//*[@class='stab portability']/code[text()='appservice-api-c']", "//*[@class='stab portability']/code[text()='appservice-api-c']",
"//*[@class='stab portability']/code[text()='server']", "//*[@class='stab portability']/code[text()='server']",
("y"), ["y"],
) )

View file

@ -6,8 +6,8 @@ show-text: true
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, mod, macro, struct, enum, trait, fn, type, union, keyword, [theme, mod, macro, struct, enum, trait, fn, type, union, keyword,
sidebar, sidebar_current, sidebar_current_background), sidebar, sidebar_current, sidebar_current_background],
block { block {
set-local-storage: { set-local-storage: {
"rustdoc-theme": |theme|, "rustdoc-theme": |theme|,

View file

@ -7,13 +7,13 @@ set-window-size: (1100, 600)
compare-elements-position: ( compare-elements-position: (
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']", "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
("y"), ["y"],
) )
// Checking they don't have the same x position. // Checking they don't have the same x position.
compare-elements-position-false: ( compare-elements-position-false: (
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']", "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
("x"), ["x"],
) )
// The `i` should be *after* the type. // The `i` should be *after* the type.
assert-position: ( assert-position: (
@ -37,7 +37,7 @@ compare-elements-position-near: (
compare-elements-position-false: ( compare-elements-position-false: (
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']", "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
"//*[@class='tooltip popover']", "//*[@class='tooltip popover']",
("x") ["x"]
) )
click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']" click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']"
move-cursor-to: "//h1" move-cursor-to: "//h1"
@ -48,7 +48,7 @@ set-window-size: (1055, 600)
compare-elements-position-false: ( compare-elements-position-false: (
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']", "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
("y", "x"), ["y", "x"],
) )
// Now both the `i` and the struct name should be on the next line. // Now both the `i` and the struct name should be on the next line.
@ -57,13 +57,13 @@ set-window-size: (980, 600)
compare-elements-position: ( compare-elements-position: (
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']", "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
("y"), ["y"],
) )
// Checking they don't have the same x position. // Checking they don't have the same x position.
compare-elements-position-false: ( compare-elements-position-false: (
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']", "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
("x"), ["x"],
) )
// The `i` should be *after* the type. // The `i` should be *after* the type.
assert-position: ( assert-position: (
@ -81,13 +81,13 @@ set-window-size: (650, 600)
compare-elements-position: ( compare-elements-position: (
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']", "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
("y"), ["y"],
) )
// Checking they don't have the same x position. // Checking they don't have the same x position.
compare-elements-position-false: ( compare-elements-position-false: (
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']", "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
("x"), ["x"],
) )
// The `i` should be *after* the type. // The `i` should be *after* the type.
assert-position: ( assert-position: (
@ -109,7 +109,7 @@ compare-elements-position-near: (
compare-elements-position-false: ( compare-elements-position-false: (
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']", "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
"//*[@class='tooltip popover']", "//*[@class='tooltip popover']",
("x") ["x"]
) )
assert-position: ( assert-position: (
"//*[@class='tooltip popover']", "//*[@class='tooltip popover']",
@ -122,7 +122,7 @@ assert-count: ("//*[@class='tooltip popover']", 0)
// Now check the colors. // Now check the colors.
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, header_color, content_color, type_color, trait_color, link_color), [theme, header_color, content_color, type_color, trait_color, link_color],
block { block {
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html" go-to: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html"
// This is needed to ensure that the text color is computed. // This is needed to ensure that the text color is computed.

View file

@ -31,7 +31,7 @@ assert-css: ("#settings-menu .popover", {"display": "none"})
define-function: ( define-function: (
"check-popover-colors", "check-popover-colors",
(theme, border_color), [theme, border_color],
block { block {
set-local-storage: { set-local-storage: {
"rustdoc-theme": |theme|, "rustdoc-theme": |theme|,

View file

@ -7,7 +7,7 @@ show-text: true
define-function: ( define-function: (
"check-run-button", "check-run-button",
(theme, color, background, hover_color, hover_background), [theme, color, background, hover_color, hover_background],
block { block {
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload: reload:

View file

@ -3,7 +3,7 @@ go-to: "file://" + |DOC_PATH| + "/staged_api/index.html"
define-function: ( define-function: (
"check-logo", "check-logo",
(theme, filter), [theme, filter],
block { block {
// Going to the doc page. // Going to the doc page.
go-to: "file://" + |DOC_PATH| + "/staged_api/index.html" go-to: "file://" + |DOC_PATH| + "/staged_api/index.html"

View file

@ -4,8 +4,8 @@ show-text: true
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, highlight, highlight_focus, help_border, help_color, help_hover_border, [theme, highlight, highlight_focus, help_border, help_color, help_hover_border,
help_hover_color), help_hover_color],
block { block {
set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", } set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", }
reload: reload:
@ -64,7 +64,7 @@ go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
define-function: ( define-function: (
"check-background", "check-background",
(theme, background_color_start, background_color_end), [theme, background_color_start, background_color_end],
block { block {
set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", } set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", }
reload: reload:

View file

@ -5,7 +5,7 @@ go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
show-text: true show-text: true
define-function: ( define-function: (
"check-color", "check-color",
(theme, toggle_line_color, toggle_line_hover_color), [theme, toggle_line_color, toggle_line_hover_color],
block { block {
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload: reload:

View file

@ -4,7 +4,7 @@
// First, try a search-by-name // First, try a search-by-name
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Intentionally wrong spelling of "NotableStructWithLongName" // Intentionally wrong spelling of "NotableStructWithLongName"
write: (".search-input", "NotableStructWithLongNamr") write-into: (".search-input", "NotableStructWithLongNamr")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...
@ -41,7 +41,7 @@ assert-text: (
// Now, explicit return values // Now, explicit return values
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Intentionally wrong spelling of "NotableStructWithLongName" // Intentionally wrong spelling of "NotableStructWithLongName"
write: (".search-input", "-> NotableStructWithLongNamr") write-into: (".search-input", "-> NotableStructWithLongNamr")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...
@ -58,7 +58,7 @@ assert-text: (
// Now, generic correction // Now, generic correction
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Intentionally wrong spelling of "NotableStructWithLongName" // Intentionally wrong spelling of "NotableStructWithLongName"
write: (".search-input", "NotableStructWithLongNamr, NotableStructWithLongNamr") write-into: (".search-input", "NotableStructWithLongNamr, NotableStructWithLongNamr")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...
@ -75,7 +75,7 @@ assert-text: (
// Now, generic correction plus error // Now, generic correction plus error
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Intentionally wrong spelling of "NotableStructWithLongName" // Intentionally wrong spelling of "NotableStructWithLongName"
write: (".search-input", "Foo<NotableStructWithLongNamr>,y") write-into: (".search-input", "Foo<NotableStructWithLongNamr>,y")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...
@ -91,7 +91,7 @@ assert-text: (
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Intentionally wrong spelling of "NotableStructWithLongName" // Intentionally wrong spelling of "NotableStructWithLongName"
write: (".search-input", "generic:NotableStructWithLongNamr<x>,y") write-into: (".search-input", "generic:NotableStructWithLongNamr<x>,y")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...

View file

@ -4,7 +4,7 @@ show-text: true
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, error_background), [theme, error_background],
block { block {
// Setting the theme. // Setting the theme.
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}

View file

@ -1,7 +1,7 @@
// Checks that the crate search filtering is handled correctly and changes the results. // Checks that the crate search filtering is handled correctly and changes the results.
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true show-text: true
write: (".search-input", "test") write-into: (".search-input", "test")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...

View file

@ -4,10 +4,10 @@ show-text: true
define-function: ( define-function: (
"check-search-colors", "check-search-colors",
( [
theme, border, background, search_input_color, search_input_border_focus, theme, border, background, search_input_color, search_input_border_focus,
menu_button_border, menu_button_a_color, menu_button_a_border_hover, menu_a_color, menu_button_border, menu_button_a_color, menu_button_a_border_hover, menu_a_color,
), ],
block { block {
set-local-storage: { set-local-storage: {
"rustdoc-theme": |theme|, "rustdoc-theme": |theme|,

View file

@ -1,7 +1,7 @@
// Checks that the search tab results work correctly with function signature syntax // Checks that the search tab results work correctly with function signature syntax
// First, try a search-by-name // First, try a search-by-name
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "Foo") write-into: (".search-input", "Foo")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...

View file

@ -4,7 +4,7 @@ show-text: true
define-function: ( define-function: (
"check-no-result", "check-no-result",
(theme, link, link_hover), [theme, link, link_hover],
block { block {
// Changing theme. // Changing theme.
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}

View file

@ -6,7 +6,7 @@ reload:
// First we check that the reexport has the correct ID and no background color. // First we check that the reexport has the correct ID and no background color.
assert-text: ("//*[@id='reexport.TheStdReexport']", "pub use ::std as TheStdReexport;") assert-text: ("//*[@id='reexport.TheStdReexport']", "pub use ::std as TheStdReexport;")
assert-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgba(0, 0, 0, 0)"}) assert-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgba(0, 0, 0, 0)"})
write: (".search-input", "TheStdReexport") write-into: (".search-input", "TheStdReexport")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
wait-for: "//a[@class='result-import']" wait-for: "//a[@class='result-import']"
@ -22,7 +22,7 @@ wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "#494a
// We now check that the alias is working as well on the reexport. // We now check that the alias is working as well on the reexport.
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
write: (".search-input", "AliasForTheStdReexport") write-into: (".search-input", "AliasForTheStdReexport")
wait-for: "//a[@class='result-import']" wait-for: "//a[@class='result-import']"
assert-text: ( assert-text: (
"a.result-import .result-name", "a.result-import .result-name",

View file

@ -2,7 +2,7 @@
define-function: ( define-function: (
"check-result-color", "check-result-color",
(result_kind, color, hover_color), [result_kind, color, hover_color],
block { block {
assert-css: (".result-" + |result_kind| + " ." + |result_kind|, {"color": |color|}, ALL) assert-css: (".result-" + |result_kind| + " ." + |result_kind|, {"color": |color|}, ALL)
assert-css: ( assert-css: (
@ -78,60 +78,60 @@ store-value: (hover_background_color, "#3c3c3c") // hover background color
store-value: (grey, "#999") store-value: (grey, "#999")
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"keyword", // item kind "result_kind": "keyword", // item kind
"#39afd7", // color of item kind "color": "#39afd7", // color of item kind
"#39afd7", // color of hovered/focused item kind "hover_color": "#39afd7", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"struct", // item kind "result_kind": "struct", // item kind
"#ffa0a5", // color of item kind "color": "#ffa0a5", // color of item kind
"#ffa0a5", // color of hovered/focused item kind "hover_color": "#ffa0a5", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"associatedtype", // item kind "result_kind": "associatedtype", // item kind
"#39afd7", // color of item kind "color": "#39afd7", // color of item kind
"#39afd7", // color of hovered/focused item kind "hover_color": "#39afd7", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"tymethod", // item kind "result_kind": "tymethod", // item kind
"#fdd687", // color of item kind "color": "#fdd687", // color of item kind
"#fdd687", // color of hovered/focused item kind "hover_color": "#fdd687", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"method", // item kind "result_kind": "method", // item kind
"#fdd687", // color of item kind "color": "#fdd687", // color of item kind
"#fdd687", // color of hovered/focused item kind "hover_color": "#fdd687", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"structfield", // item kind "result_kind": "structfield", // item kind
"#0096cf", // color of item kind "color": "#0096cf", // color of item kind
"#fff", // color of hovered/focused item kind "hover_color": "#fff", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"macro", // item kind "result_kind": "macro", // item kind
"#a37acc", // color of item kind "color": "#a37acc", // color of item kind
"#a37acc", // color of hovered/focused item kind "hover_color": "#a37acc", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"fn", // item kind "result_kind": "fn", // item kind
"#fdd687", // color of item kind "color": "#fdd687", // color of item kind
"#fdd687", // color of hovered/focused item kind "hover_color": "#fdd687", // color of hovered/focused item kind
), },
) )
// Checking the `<a>` container. // Checking the `<a>` container.
@ -190,60 +190,60 @@ store-value: (hover_background_color, "#616161") // hover background color
store-value: (grey, "#ccc") store-value: (grey, "#ccc")
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"keyword", // item kind "result_kind": "keyword", // item kind
"#d2991d", // color of item kind "color": "#d2991d", // color of item kind
"#d2991d", // color of hovered/focused item kind "hover_color": "#d2991d", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"struct", // item kind "result_kind": "struct", // item kind
"#2dbfb8", // color of item kind "color": "#2dbfb8", // color of item kind
"#2dbfb8", // color of hovered/focused item kind "hover_color": "#2dbfb8", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"associatedtype", // item kind "result_kind": "associatedtype", // item kind
"#d2991d", // color of item kind "color": "#d2991d", // color of item kind
"#d2991d", // color of hovered/focused item kind "hover_color": "#d2991d", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"tymethod", // item kind "result_kind": "tymethod", // item kind
"#2bab63", // color of item kind "color": "#2bab63", // color of item kind
"#2bab63", // color of hovered/focused item kind "hover_color": "#2bab63", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"method", // item kind "result_kind": "method", // item kind
"#2bab63", // color of item kind "color": "#2bab63", // color of item kind
"#2bab63", // color of hovered/focused item kind "hover_color": "#2bab63", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"structfield", // item kind "result_kind": "structfield", // item kind
"#ddd", // color of item kind "color": "#ddd", // color of item kind
"#ddd", // color of hovered/focused item kind "hover_color": "#ddd", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"macro", // item kind "result_kind": "macro", // item kind
"#09bd00", // color of item kind "color": "#09bd00", // color of item kind
"#09bd00", // color of hovered/focused item kind "hover_color": "#09bd00", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"fn", // item kind "result_kind": "fn", // item kind
"#2bab63", // color of item kind "color": "#2bab63", // color of item kind
"#2bab63", // color of hovered/focused item kind "hover_color": "#2bab63", // color of hovered/focused item kind
), },
) )
// Checking the `<a>` container. // Checking the `<a>` container.
@ -287,60 +287,60 @@ store-value: (hover_background_color, "#ccc") // hover background color
store-value: (grey, "#999") store-value: (grey, "#999")
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"keyword", // item kind "result_kind": "keyword", // item kind
"#3873ad", // color of item kind "color": "#3873ad", // color of item kind
"#3873ad", // color of hovered/focused item kind "hover_color": "#3873ad", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"struct", // item kind "result_kind": "struct", // item kind
"#ad378a", // color of item kind "color": "#ad378a", // color of item kind
"#ad378a", // color of hovered/focused item kind "hover_color": "#ad378a", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"associatedtype", // item kind "result_kind": "associatedtype", // item kind
"#3873ad", // color of item kind "color": "#3873ad", // color of item kind
"#3873ad", // color of hovered/focused item kind "hover_color": "#3873ad", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"tymethod", // item kind "result_kind": "tymethod", // item kind
"#ad7c37", // color of item kind "color": "#ad7c37", // color of item kind
"#ad7c37", // color of hovered/focused item kind "hover_color": "#ad7c37", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"method", // item kind "result_kind": "method", // item kind
"#ad7c37", // color of item kind "color": "#ad7c37", // color of item kind
"#ad7c37", // color of hovered/focused item kind "hover_color": "#ad7c37", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"structfield", // item kind "result_kind": "structfield", // item kind
"#000", // color of item kind "color": "#000", // color of item kind
"#000", // color of hovered/focused item kind "hover_color": "#000", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"macro", // item kind "result_kind": "macro", // item kind
"#068000", // color of item kind "color": "#068000", // color of item kind
"#068000", // color of hovered/focused item kind "hover_color": "#068000", // color of hovered/focused item kind
), },
) )
call-function: ( call-function: (
"check-result-color", ( "check-result-color", {
"fn", // item kind "result_kind": "fn", // item kind
"#ad7c37", // color of item kind "color": "#ad7c37", // color of item kind
"#ad7c37", // color of hovered/focused item kind "hover_color": "#ad7c37", // color of hovered/focused item kind
), },
) )
// Checking the `<a>` container. // Checking the `<a>` container.
@ -358,11 +358,11 @@ show-text: true
define-function: ( define-function: (
"check-alias", "check-alias",
(theme, alias, grey), [theme, alias, grey],
block { block {
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload: reload:
write: (".search-input", "thisisanalias") write-into: (".search-input", "thisisanalias")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...

View file

@ -2,7 +2,7 @@
// Checks that the search results have the expected width. // Checks that the search results have the expected width.
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
set-window-size: (900, 1000) set-window-size: (900, 1000)
write: (".search-input", "test") write-into: (".search-input", "test")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
wait-for: "#crate-search" wait-for: "#crate-search"
@ -69,7 +69,7 @@ assert-css: ("#search", {"width": "640px"})
show-text: true show-text: true
define-function: ( define-function: (
"check-filter", "check-filter",
(theme, border, filter, hover_border, hover_filter), [theme, border, filter, hover_border, hover_filter],
block { block {
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload: reload:

View file

@ -5,7 +5,7 @@
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// This should link to the inherent impl // This should link to the inherent impl
write: (".search-input", "ZyxwvutMethodDisambiguation -> bool") write-into: (".search-input", "ZyxwvutMethodDisambiguation -> bool")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...
@ -25,7 +25,7 @@ assert: "section:target"
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// This should link to the trait impl // This should link to the trait impl
write: (".search-input", "ZyxwvutMethodDisambiguation, usize -> usize") write-into: (".search-input", "ZyxwvutMethodDisambiguation, usize -> usize")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...

View file

@ -1,6 +1,6 @@
// Checks that the "keyword" results have the expected text alongside them. // Checks that the "keyword" results have the expected text alongside them.
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "CookieMonster") write-into: (".search-input", "CookieMonster")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...

View file

@ -1,7 +1,7 @@
// Checks that the search tab results work correctly with function signature syntax // Checks that the search tab results work correctly with function signature syntax
// First, try a search-by-name // First, try a search-by-name
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "Foo") write-into: (".search-input", "Foo")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...
@ -23,7 +23,7 @@ wait-for-attribute: ("#search-tabs > button:nth-of-type(3)", {"class": "selected
// Now try search-by-return // Now try search-by-return
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "-> String") write-into: (".search-input", "-> String")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...
@ -45,7 +45,7 @@ wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected
// Try with a search-by-return with no results // Try with a search-by-return with no results
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "-> Something") write-into: (".search-input", "-> Something")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...
@ -55,7 +55,7 @@ assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Return Types"
// Try with a search-by-parameter // Try with a search-by-parameter
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "usize,pattern") write-into: (".search-input", "usize,pattern")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...
@ -65,7 +65,7 @@ assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Parameters",
// Try with a search-by-parameter-and-return // Try with a search-by-parameter-and-return
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "pattern -> str") write-into: (".search-input", "pattern -> str")
// To be SURE that the search will be run. // To be SURE that the search will be run.
press-key: 'Enter' press-key: 'Enter'
// Waiting for the search results to appear... // Waiting for the search results to appear...

View file

@ -4,9 +4,9 @@ show-text: true
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, background, background_selected, background_hover, border_bottom, [theme, background, background_selected, background_hover, border_bottom,
border_bottom_selected, border_bottom_hover, border_top, border_top_selected, border_bottom_selected, border_bottom_hover, border_top, border_top_selected,
border_top_hover), border_top_hover],
block { block {
// Setting the theme. // Setting the theme.
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
@ -93,12 +93,12 @@ assert-property: ("#search-tabs > button:nth-child(3) > .count", {"offsetWidth":
compare-elements-position: ( compare-elements-position: (
"#search-tabs > button:nth-child(1) > .count", "#search-tabs > button:nth-child(1) > .count",
"#search-tabs > button:nth-child(2) > .count", "#search-tabs > button:nth-child(2) > .count",
("y") ["y"]
) )
compare-elements-position: ( compare-elements-position: (
"#search-tabs > button:nth-child(2) > .count", "#search-tabs > button:nth-child(2) > .count",
"#search-tabs > button:nth-child(3) > .count", "#search-tabs > button:nth-child(3) > .count",
("y") ["y"]
) )
// Check that counts are beside the titles and haven't wrapped // Check that counts are beside the titles and haven't wrapped
compare-elements-position-near: ( compare-elements-position-near: (
@ -135,12 +135,12 @@ assert-property: ("#search-tabs > button:nth-child(3) > .count", {"offsetWidth":
compare-elements-position: ( compare-elements-position: (
"#search-tabs > button:nth-child(1) > .count", "#search-tabs > button:nth-child(1) > .count",
"#search-tabs > button:nth-child(2) > .count", "#search-tabs > button:nth-child(2) > .count",
("y") ["y"]
) )
compare-elements-position: ( compare-elements-position: (
"#search-tabs > button:nth-child(2) > .count", "#search-tabs > button:nth-child(2) > .count",
"#search-tabs > button:nth-child(3) > .count", "#search-tabs > button:nth-child(3) > .count",
("y") ["y"]
) )
// Check that counts are NOT beside the titles; now they have wrapped // Check that counts are NOT beside the titles; now they have wrapped
compare-elements-position-near-false: ( compare-elements-position-near-false: (

View file

@ -6,7 +6,7 @@ fail-on-request-error: false
define-function: ( define-function: (
"check-setting", "check-setting",
(storage_value, setting_attribute_value, toggle_attribute_value), [storage_value, setting_attribute_value, toggle_attribute_value],
block { block {
assert-local-storage: {"rustdoc-auto-hide-large-items": |storage_value|} assert-local-storage: {"rustdoc-auto-hide-large-items": |storage_value|}
click: "#settings-menu" click: "#settings-menu"

View file

@ -3,7 +3,7 @@
define-function: ( define-function: (
"check-setting", "check-setting",
(storage_value, setting_attribute_value, toggle_attribute_value), [storage_value, setting_attribute_value, toggle_attribute_value],
block { block {
assert-local-storage: {"rustdoc-auto-hide-method-docs": |storage_value|} assert-local-storage: {"rustdoc-auto-hide-method-docs": |storage_value|}
click: "#settings-menu" click: "#settings-menu"

View file

@ -2,7 +2,7 @@
define-function: ( define-function: (
"check-setting", "check-setting",
(storage_value, setting_attribute_value, toggle_attribute_value), [storage_value, setting_attribute_value, toggle_attribute_value],
block { block {
assert-local-storage: {"rustdoc-auto-hide-trait-implementations": |storage_value|} assert-local-storage: {"rustdoc-auto-hide-trait-implementations": |storage_value|}
click: "#settings-menu" click: "#settings-menu"

View file

@ -2,7 +2,7 @@
define-function: ( define-function: (
"check-setting", "check-setting",
(storage_value, setting_attribute_value), [storage_value, setting_attribute_value],
block { block {
assert-local-storage: {"rustdoc-go-to-only-result": |storage_value|} assert-local-storage: {"rustdoc-go-to-only-result": |storage_value|}
click: "#settings-menu" click: "#settings-menu"
@ -32,7 +32,7 @@ assert-local-storage: {"rustdoc-go-to-only-result": "true"}
go-to: "file://" + |DOC_PATH| + "/lib2/index.html" go-to: "file://" + |DOC_PATH| + "/lib2/index.html"
// We enter it into the search. // We enter it into the search.
write: (".search-input", "HasALongTraitWithParams") write-into: (".search-input", "HasALongTraitWithParams")
wait-for-document-property: {"title": "HasALongTraitWithParams in lib2 - Rust"} wait-for-document-property: {"title": "HasALongTraitWithParams in lib2 - Rust"}
assert-window-property: ({"location": "/lib2/struct.HasALongTraitWithParams.html"}, ENDS_WITH) assert-window-property: ({"location": "/lib2/struct.HasALongTraitWithParams.html"}, ENDS_WITH)

View file

@ -304,7 +304,7 @@ wait-for: "#settings"
assert-css: (".setting-radio", {"cursor": "pointer"}) assert-css: (".setting-radio", {"cursor": "pointer"})
assert-attribute-false: ("#settings", {"class": "popover"}, CONTAINS) assert-attribute-false: ("#settings", {"class": "popover"}, CONTAINS)
compare-elements-position: (".sub form", "#settings", ("x")) compare-elements-position: (".sub form", "#settings", ["x"])
// Check that setting-line has the same margin in this mode as in the popover. // Check that setting-line has the same margin in this mode as in the popover.
assert-css: (".setting-line", {"margin": |setting_line_margin|}) assert-css: (".setting-line", {"margin": |setting_line_margin|})

View file

@ -6,12 +6,12 @@ show-text: true
define-function: ( define-function: (
"check-colors", "check-colors",
( [
theme, struct, struct_hover, struct_hover_background, enum, enum_hover, theme, struct, struct_hover, struct_hover_background, enum, enum_hover,
enum_hover_background, union, union_hover, union_hover_background, trait, trait_hover, enum_hover_background, union, union_hover, union_hover_background, trait, trait_hover,
trait_hover_background, fn, fn_hover, fn_hover_background, type, type_hover, trait_hover_background, fn, fn_hover, fn_hover_background, type, type_hover,
type_hover_background, keyword, keyword_hover, keyword_hover_background, type_hover_background, keyword, keyword_hover, keyword_hover_background,
), ],
block { block {
set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" } set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" }
reload: reload:

View file

@ -57,7 +57,7 @@ show-text: true
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, color, background), [theme, color, background],
block { block {
set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|} set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}
reload: reload:

View file

@ -30,9 +30,9 @@ show-text: true
define-function: ( define-function: (
"check-colors", "check-colors",
( [
theme, color, color_hover, background, background_hover, background_toggle, theme, color, color_hover, background, background_hover, background_toggle,
), ],
block { block {
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload: reload:

View file

@ -6,7 +6,7 @@ show-text: true
// First, check the sidebar colors. // First, check the sidebar colors.
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, color, background_color), [theme, color, background_color],
block { block {
set-local-storage: { set-local-storage: {
"rustdoc-theme": |theme|, "rustdoc-theme": |theme|,

View file

@ -6,7 +6,7 @@ show-text: true
// First, check the sidebar colors. // First, check the sidebar colors.
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, color, background_color), [theme, color, background_color],
block { block {
set-local-storage: { set-local-storage: {
"rustdoc-theme": |theme|, "rustdoc-theme": |theme|,

View file

@ -21,7 +21,7 @@ assert-attribute-false: (".src-line-numbers > a:nth-child(7)", {"class": "line-h
define-function: ( define-function: (
"check-colors", "check-colors",
(theme, color, background_color, highlight_color, highlight_background_color), [theme, color, background_color, highlight_color, highlight_background_color],
block { block {
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload: reload:
@ -61,7 +61,7 @@ call-function: ("check-colors", {
}) })
// This is to ensure that the content is correctly align with the line numbers. // This is to ensure that the content is correctly align with the line numbers.
compare-elements-position: ("//*[@id='1']", ".rust > code > span", ("y")) compare-elements-position: ("//*[@id='1']", ".rust > code > span", ["y"])
// Check the `href` property so that users can treat anchors as links. // Check the `href` property so that users can treat anchors as links.
assert-property: (".src-line-numbers > a:nth-child(1)", { assert-property: (".src-line-numbers > a:nth-child(1)", {
"href": |DOC_PATH| + "/src/test_docs/lib.rs.html#1" "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#1"
@ -122,7 +122,7 @@ store-property: (
) )
define-function: ( define-function: (
"check-sidebar-dir-entry", "check-sidebar-dir-entry",
(x, y), [x, y],
block { block {
assert: "details:first-of-type.dir-entry[open] > summary::marker" assert: "details:first-of-type.dir-entry[open] > summary::marker"
assert-css: ("#src-sidebar > details:first-of-type.dir-entry", {"padding-left": "4px"}) assert-css: ("#src-sidebar > details:first-of-type.dir-entry", {"padding-left": "4px"})

View file

@ -3,7 +3,7 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true show-text: true
define-function: ( define-function: (
"check-badge", "check-badge",
(theme, background, color), [theme, background, color],
block { block {
set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|} set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"

View file

@ -7,7 +7,7 @@ assert: "#method\.a_method:target"
define-function: ( define-function: (
"check-style", "check-style",
(theme, background, border), [theme, background, border],
block { block {
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload: reload:

View file

@ -49,7 +49,7 @@ assert-attribute: ("details.toggle", {"open": ""}, ALL)
show-text: true show-text: true
define-function: ( define-function: (
"check-color", "check-color",
(theme, filter), [theme, filter],
block { block {
// Setting the theme. // Setting the theme.
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}

View file

@ -47,18 +47,18 @@ assert-css: (".mobile-topbar h2", {"overflow-x": "hidden"})
// On desktop, they wrap when too big. // On desktop, they wrap when too big.
set-window-size: (1100, 800) set-window-size: (1100, 800)
go-to: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html" go-to: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ("y")) compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ["y"])
go-to: "file://" + |DOC_PATH| + "/lib2/index.html" go-to: "file://" + |DOC_PATH| + "/lib2/index.html"
compare-elements-position: (".main-heading h1", ".main-heading .out-of-band", ("y")) compare-elements-position: (".main-heading h1", ".main-heading .out-of-band", ["y"])
// make sure there is a gap between them // make sure there is a gap between them
compare-elements-position-near-false: (".main-heading h1", ".main-heading .out-of-band", {"x": 550}) compare-elements-position-near-false: (".main-heading h1", ".main-heading .out-of-band", {"x": 550})
// On mobile, they always wrap. // On mobile, they always wrap.
set-window-size: (600, 600) set-window-size: (600, 600)
go-to: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html" go-to: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ("y")) compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ["y"])
go-to: "file://" + |DOC_PATH| + "/lib2/index.html" go-to: "file://" + |DOC_PATH| + "/lib2/index.html"
compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ("y")) compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ["y"])
// Now we will check that the scrolling is working. // Now we will check that the scrolling is working.
// First on an item with "hidden methods". // First on an item with "hidden methods".

View file

@ -13,7 +13,7 @@ define-function: (
"sup-check", "sup-check",
// `theme` is the theme being tested. // `theme` is the theme being tested.
// `color` is the expected color of the `<sup>` element. // `color` is the expected color of the `<sup>` element.
(theme, color), [theme, color],
block { block {
// Set the theme. // Set the theme.
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
@ -23,6 +23,15 @@ define-function: (
}, },
) )
call-function: ("sup-check", ("ayu", "#c5c5c5")) call-function: ("sup-check", {
call-function: ("sup-check", ("dark", "#ddd")) "theme": "ayu",
call-function: ("sup-check", ("light", "black")) "color": "#c5c5c5",
})
call-function: ("sup-check", {
"theme": "dark",
"color": "#ddd",
})
call-function: ("sup-check", {
"theme": "light",
"color": "black",
})

View file

@ -5,7 +5,7 @@ show-text: true
store-value: (default_y_pos, 5) store-value: (default_y_pos, 5)
define-function: ( define-function: (
"check-warning", "check-warning",
(theme, color, border_color), [theme, color, border_color],
block { block {
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload: reload:

View file

@ -3,25 +3,25 @@ go-to: "file://" + |DOC_PATH| + "/lib2/trait.Whitespace.html"
show-text: true show-text: true
// First, we check in the trait definition if the where clause is "on its own" (not on the same // First, we check in the trait definition if the where clause is "on its own" (not on the same
// line than "pub trait Whitespace<Idx>"). // line than "pub trait Whitespace<Idx>").
compare-elements-position-false: (".item-decl code", "div.where", ("y")) compare-elements-position-false: (".item-decl code", "div.where", ["y"])
// And that the code following it isn't on the same line either. // And that the code following it isn't on the same line either.
compare-elements-position-false: (".item-decl .fn", "div.where", ("y")) compare-elements-position-false: (".item-decl .fn", "div.where", ["y"])
go-to: "file://" + |DOC_PATH| + "/lib2/struct.WhereWhitespace.html" go-to: "file://" + |DOC_PATH| + "/lib2/struct.WhereWhitespace.html"
// We make the screen a bit wider to ensure that the trait impl is on one line. // We make the screen a bit wider to ensure that the trait impl is on one line.
set-window-size: (915, 915) set-window-size: (915, 915)
compare-elements-position-false: ("#method\.new .fn", "#method\.new div.where", ("y")) compare-elements-position-false: ("#method\.new .fn", "#method\.new div.where", ["y"])
// We ensure that both the trait name and the struct name are on the same line in // We ensure that both the trait name and the struct name are on the same line in
// "impl<K, T> Whitespace<&K> for WhereWhitespace<T>". // "impl<K, T> Whitespace<&K> for WhereWhitespace<T>".
compare-elements-position: ( compare-elements-position: (
"#trait-implementations-list .impl h3 .trait", "#trait-implementations-list .impl h3 .trait",
"#trait-implementations-list .impl h3 .struct", "#trait-implementations-list .impl h3 .struct",
("y"), ["y"],
) )
// And we now check that the where condition isn't on the same line. // And we now check that the where condition isn't on the same line.
compare-elements-position-false: ( compare-elements-position-false: (
"#trait-implementations-list .impl h3 .trait", "#trait-implementations-list .impl h3 .trait",
"#trait-implementations-list .impl h3 div.where", "#trait-implementations-list .impl h3 div.where",
("y"), ["y"],
) )