2021-07-12 16:48:25 +02:00
|
|
|
// The goal of this test is to ensure the color of the text is the one expected.
|
2022-10-07 20:17:05 +02:00
|
|
|
goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo"
|
2021-07-12 16:48:25 +02:00
|
|
|
|
|
|
|
// This is needed so that the text color is computed.
|
|
|
|
show-text: true
|
|
|
|
|
|
|
|
// Ayu theme
|
2021-12-12 18:28:58 +01:00
|
|
|
local-storage: {
|
|
|
|
"rustdoc-theme": "ayu",
|
|
|
|
"rustdoc-use-system-theme": "false",
|
|
|
|
}
|
2021-07-12 16:48:25 +02:00
|
|
|
reload:
|
|
|
|
|
|
|
|
// Waiting for the search results to appear...
|
|
|
|
wait-for: "#titles"
|
2021-12-12 18:28:58 +01:00
|
|
|
assert-css: (
|
|
|
|
"//*[@class='desc']//*[text()='Just a normal struct.']",
|
|
|
|
{"color": "rgb(197, 197, 197)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
"//*[@class='result-name']/*[text()='test_docs::']",
|
|
|
|
{"color": "rgb(0, 150, 207)"},
|
|
|
|
)
|
2021-07-12 16:48:25 +02:00
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Checking the color of "keyword" text.
|
2021-12-12 18:28:58 +01:00
|
|
|
assert-css: (
|
|
|
|
"//*[@class='result-name']//*[text()='(keyword)']",
|
|
|
|
{"color": "rgb(120, 135, 151)"},
|
|
|
|
)
|
2021-07-12 17:42:59 +02:00
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Checking the color of "keyword".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-keyword .keyword",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(57, 175, 215)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-keyword",
|
|
|
|
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-keyword"
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:hover",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:hover .keyword",
|
|
|
|
{"color": "rgb(57, 175, 215)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-keyword"
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:focus",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:focus .keyword",
|
|
|
|
{"color": "rgb(57, 175, 215)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "struct".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-struct .struct",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(255, 160, 165)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-struct",
|
|
|
|
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-struct"
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:hover",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:hover .struct",
|
|
|
|
{"color": "rgb(255, 160, 165)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-struct"
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:focus",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:focus .struct",
|
|
|
|
{"color": "rgb(255, 160, 165)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "associated type".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-associatedtype .associatedtype",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(57, 175, 215)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype",
|
|
|
|
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-associatedtype"
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:hover",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:hover .associatedtype",
|
|
|
|
{"color": "rgb(57, 175, 215)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-associatedtype"
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:focus",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:focus .associatedtype",
|
|
|
|
{"color": "rgb(57, 175, 215)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "type method".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-tymethod .tymethod",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(253, 214, 135)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-tymethod",
|
|
|
|
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-tymethod .tymethod",
|
|
|
|
{"color": "rgb(253, 214, 135)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-tymethod"
|
|
|
|
assert-css: (
|
|
|
|
".result-tymethod:hover",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-tymethod"
|
|
|
|
assert-css: (
|
|
|
|
".result-tymethod:focus",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "method".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-method .method",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(253, 214, 135)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-method",
|
|
|
|
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-method"
|
|
|
|
assert-css: (
|
|
|
|
".result-method:hover",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-method:hover .method",
|
|
|
|
{"color": "rgb(253, 214, 135)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-method"
|
|
|
|
assert-css: (
|
|
|
|
".result-method:focus",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-method:focus .method",
|
|
|
|
{"color": "rgb(253, 214, 135)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "struct field".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-structfield .structfield",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(0, 150, 207)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-structfield",
|
|
|
|
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-structfield"
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:hover",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:hover .structfield",
|
|
|
|
{"color": "rgb(255, 255, 255)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-structfield"
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:focus",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:focus .structfield",
|
|
|
|
{"color": "rgb(255, 255, 255)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "macro".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-macro .macro",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(163, 122, 204)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-macro",
|
|
|
|
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-macro"
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:hover",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:hover .macro",
|
|
|
|
{"color": "rgb(163, 122, 204)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-macro"
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:focus",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:focus .macro",
|
|
|
|
{"color": "rgb(163, 122, 204)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "fn".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-fn .fn",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(253, 214, 135)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-fn",
|
|
|
|
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-fn"
|
|
|
|
assert-css: (
|
|
|
|
".result-fn:hover",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-fn:hover .fn",
|
|
|
|
{"color": "rgb(253, 214, 135)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-fn"
|
|
|
|
assert-css: (
|
|
|
|
".result-fn:focus",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-fn:focus .fn",
|
|
|
|
{"color": "rgb(253, 214, 135)"},
|
|
|
|
)
|
2022-09-27 20:23:00 +02:00
|
|
|
|
2022-08-20 15:13:53 +02:00
|
|
|
// Checking the `<a>` container.
|
2022-10-01 17:11:33 +02:00
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
|
2022-08-20 15:13:53 +02:00
|
|
|
assert-css: (
|
|
|
|
"//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
|
|
|
|
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
2022-09-27 20:23:00 +02:00
|
|
|
ALL,
|
2022-08-20 15:13:53 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// Checking color and background on hover.
|
|
|
|
move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
|
|
|
|
assert-css: (
|
|
|
|
"//*[@class='result-name']/*[text()='test_docs::']",
|
|
|
|
{"color": "rgb(255, 255, 255)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
"//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
|
|
|
|
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
|
|
)
|
|
|
|
|
2021-07-12 16:48:25 +02:00
|
|
|
// Dark theme
|
2021-12-12 18:28:58 +01:00
|
|
|
local-storage: {
|
|
|
|
"rustdoc-theme": "dark",
|
|
|
|
"rustdoc-use-system-theme": "false",
|
|
|
|
}
|
2021-07-12 16:48:25 +02:00
|
|
|
reload:
|
|
|
|
|
|
|
|
// Waiting for the search results to appear...
|
|
|
|
wait-for: "#titles"
|
2021-12-12 18:28:58 +01:00
|
|
|
assert-css: (
|
|
|
|
"//*[@class='desc']//*[text()='Just a normal struct.']",
|
|
|
|
{"color": "rgb(221, 221, 221)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
"//*[@class='result-name']/*[text()='test_docs::']",
|
|
|
|
{"color": "rgb(221, 221, 221)"},
|
|
|
|
)
|
2021-07-12 16:48:25 +02:00
|
|
|
|
2022-10-01 17:11:33 +02:00
|
|
|
// Checking the color for "keyword" text.
|
2021-12-12 18:28:58 +01:00
|
|
|
assert-css: (
|
|
|
|
"//*[@class='result-name']//*[text()='(keyword)']",
|
|
|
|
{"color": "rgb(221, 221, 221)"},
|
|
|
|
)
|
2021-07-12 17:42:59 +02:00
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Checking the color of "keyword".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-keyword .keyword",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(210, 153, 29)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-keyword",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-keyword"
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:hover",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:hover .keyword",
|
|
|
|
{"color": "rgb(210, 153, 29)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-keyword"
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:focus",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:focus .keyword",
|
|
|
|
{"color": "rgb(210, 153, 29)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "struct".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-struct .struct",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(45, 191, 184)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-struct",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-struct"
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:hover",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:hover .struct",
|
|
|
|
{"color": "rgb(45, 191, 184)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-struct"
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:focus",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:focus .struct",
|
|
|
|
{"color": "rgb(45, 191, 184)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "associated type".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-associatedtype .associatedtype",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(210, 153, 29)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-associatedtype"
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:hover",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:hover .associatedtype",
|
|
|
|
{"color": "rgb(210, 153, 29)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-associatedtype"
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:focus",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:focus .associatedtype",
|
|
|
|
{"color": "rgb(210, 153, 29)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "type method".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-tymethod .tymethod",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(43, 171, 99)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-tymethod",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-tymethod"
|
|
|
|
assert-css: (
|
|
|
|
".result-tymethod:hover",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-tymethod:hover .tymethod",
|
|
|
|
{"color": "rgb(43, 171, 99)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-tymethod"
|
|
|
|
assert-css: (
|
|
|
|
".result-tymethod:focus",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-tymethod:focus .tymethod",
|
|
|
|
{"color": "rgb(43, 171, 99)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "method".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-method .method",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(43, 171, 99)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-method",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-method"
|
|
|
|
assert-css: (
|
|
|
|
".result-method:hover",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-method:hover .method",
|
|
|
|
{"color": "rgb(43, 171, 99)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-method"
|
|
|
|
assert-css: (
|
|
|
|
".result-method:focus",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-method:focus .method",
|
|
|
|
{"color": "rgb(43, 171, 99)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "struct field".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-structfield .structfield",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(221, 221, 221)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-structfield",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-structfield"
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:hover",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:hover .structfield",
|
|
|
|
{"color": "rgb(221, 221, 221)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-structfield"
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:focus",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:focus .structfield",
|
|
|
|
{"color": "rgb(221, 221, 221)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "macro".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-macro .macro",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(9, 189, 0)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-macro",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-macro"
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:hover",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:hover .macro",
|
|
|
|
{"color": "rgb(9, 189, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-macro"
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:focus",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:focus .macro",
|
|
|
|
{"color": "rgb(9, 189, 0)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "fn".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-fn .fn",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(43, 171, 99)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-08-20 15:13:53 +02:00
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-fn",
|
2022-08-20 15:13:53 +02:00
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
move-cursor-to: ".result-fn"
|
2022-08-20 15:13:53 +02:00
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-fn:hover",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
2022-08-20 15:13:53 +02:00
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-fn:hover .fn",
|
|
|
|
{"color": "rgb(43, 171, 99)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-fn"
|
|
|
|
assert-css: (
|
|
|
|
".result-fn:focus",
|
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-fn:focus .fn",
|
|
|
|
{"color": "rgb(43, 171, 99)"},
|
|
|
|
)
|
|
|
|
|
|
|
|
// Checking the `<a>` container.
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
|
2022-08-20 15:13:53 +02:00
|
|
|
assert-css: (
|
|
|
|
"//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
|
2022-10-01 17:11:33 +02:00
|
|
|
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
2022-08-20 15:13:53 +02:00
|
|
|
)
|
|
|
|
|
2021-07-12 16:48:25 +02:00
|
|
|
// Light theme
|
|
|
|
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
|
|
|
|
reload:
|
|
|
|
|
|
|
|
// Waiting for the search results to appear...
|
|
|
|
wait-for: "#titles"
|
2021-12-12 18:28:58 +01:00
|
|
|
assert-css: (
|
|
|
|
"//*[@class='desc']//*[text()='Just a normal struct.']",
|
|
|
|
{"color": "rgb(0, 0, 0)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
"//*[@class='result-name']/*[text()='test_docs::']",
|
|
|
|
{"color": "rgb(0, 0, 0)"},
|
|
|
|
)
|
2021-07-12 17:42:59 +02:00
|
|
|
|
2022-10-01 17:11:33 +02:00
|
|
|
// Checking the color for "keyword" text.
|
2021-12-12 18:28:58 +01:00
|
|
|
assert-css: (
|
|
|
|
"//*[@class='result-name']//*[text()='(keyword)']",
|
|
|
|
{"color": "rgb(0, 0, 0)"},
|
|
|
|
)
|
2022-03-15 20:41:24 +01:00
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Checking the color of "keyword".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-keyword .keyword",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(56, 115, 173)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-keyword",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-keyword"
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:hover",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:hover .keyword",
|
|
|
|
{"color": "rgb(56, 115, 173)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-keyword"
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:focus",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-keyword:focus .keyword",
|
|
|
|
{"color": "rgb(56, 115, 173)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "struct".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-struct .struct",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(173, 55, 138)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-struct",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-struct"
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:hover",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:hover .struct",
|
|
|
|
{"color": "rgb(173, 55, 138)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-struct"
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:focus",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-struct:focus .struct",
|
|
|
|
{"color": "rgb(173, 55, 138)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "associated type".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-associatedtype .associatedtype",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(56, 115, 173)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-associatedtype"
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:hover",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:hover .associatedtype",
|
|
|
|
{"color": "rgb(56, 115, 173)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-associatedtype"
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:focus",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-associatedtype:focus .associatedtype",
|
|
|
|
{"color": "rgb(56, 115, 173)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "type method".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-tymethod .tymethod",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(173, 124, 55)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-tymethod",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-tymethod"
|
|
|
|
assert-css: (
|
|
|
|
".result-tymethod:hover",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-tymethod:hover .tymethod",
|
|
|
|
{"color": "rgb(173, 124, 55)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-tymethod"
|
|
|
|
assert-css: (
|
|
|
|
".result-tymethod:focus",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-tymethod:focus .tymethod",
|
|
|
|
{"color": "rgb(173, 124, 55)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "method".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-method .method",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(173, 124, 55)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-method",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-method"
|
|
|
|
assert-css: (
|
|
|
|
".result-method:hover",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-method:hover .method",
|
|
|
|
{"color": "rgb(173, 124, 55)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-method"
|
|
|
|
assert-css: (
|
|
|
|
".result-method:focus",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-method:focus .method",
|
|
|
|
{"color": "rgb(173, 124, 55)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "struct field".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-structfield .structfield",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(0, 0, 0)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-structfield",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-structfield"
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:hover",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:hover .structfield",
|
|
|
|
{"color": "rgb(0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-structfield"
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:focus",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-structfield:focus .structfield",
|
|
|
|
{"color": "rgb(0, 0, 0)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "macro".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-macro .macro",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(6, 128, 0)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-macro",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".result-macro"
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:hover",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:hover .macro",
|
|
|
|
{"color": "rgb(6, 128, 0)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-macro"
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:focus",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-macro:focus .macro",
|
|
|
|
{"color": "rgb(6, 128, 0)"},
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:23:00 +02:00
|
|
|
// Check the color of "fn".
|
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-fn .fn",
|
2022-09-27 20:23:00 +02:00
|
|
|
{"color": "rgb(173, 124, 55)"},
|
|
|
|
ALL,
|
|
|
|
)
|
2022-08-20 15:13:53 +02:00
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-fn",
|
2022-08-20 15:13:53 +02:00
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
move-cursor-to: ".result-fn"
|
2022-08-20 15:13:53 +02:00
|
|
|
assert-css: (
|
2022-10-01 17:11:33 +02:00
|
|
|
".result-fn:hover",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
2022-08-20 15:13:53 +02:00
|
|
|
)
|
2022-10-01 17:11:33 +02:00
|
|
|
assert-css: (
|
|
|
|
".result-fn:hover .fn",
|
|
|
|
{"color": "rgb(173, 124, 55)"},
|
|
|
|
)
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".result-fn"
|
|
|
|
assert-css: (
|
|
|
|
".result-fn:focus",
|
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
".result-fn:focus .fn",
|
|
|
|
{"color": "rgb(173, 124, 55)"},
|
|
|
|
)
|
|
|
|
|
|
|
|
// Checking the `<a>` container.
|
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
|
2022-08-20 15:13:53 +02:00
|
|
|
assert-css: (
|
|
|
|
"//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
|
2022-10-01 17:11:33 +02:00
|
|
|
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
2022-08-20 15:13:53 +02:00
|
|
|
)
|
|
|
|
|
2022-03-15 20:41:24 +01:00
|
|
|
// Check the alias more specifically in the dark theme.
|
2022-10-07 20:17:05 +02:00
|
|
|
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2022-03-15 20:41:24 +01:00
|
|
|
// We set the theme so we're sure that the correct values will be used, whatever the computer
|
|
|
|
// this test is running on.
|
|
|
|
local-storage: {
|
|
|
|
"rustdoc-theme": "dark",
|
|
|
|
"rustdoc-use-system-theme": "false",
|
|
|
|
}
|
|
|
|
// If the text isn't displayed, the browser doesn't compute color style correctly...
|
|
|
|
show-text: true
|
|
|
|
// We reload the page so the local storage settings are being used.
|
|
|
|
reload:
|
|
|
|
write: (".search-input", "thisisanalias")
|
2022-07-16 13:53:43 +02:00
|
|
|
// To be SURE that the search will be run.
|
|
|
|
press-key: 'Enter'
|
2022-03-15 20:41:24 +01:00
|
|
|
// Waiting for the search results to appear...
|
|
|
|
wait-for: "#titles"
|
|
|
|
// Checking that the colors for the alias element are the ones expected.
|
|
|
|
assert-css: (".result-name > .alias", {"color": "rgb(255, 255, 255)"})
|
|
|
|
assert-css: (".result-name > .alias > .grey", {"color": "rgb(204, 204, 204)"})
|