2022-09-08 16:41:29 -05:00
|
|
|
// Checking the colors of the codeblocks tooltips.
|
2022-10-07 13:17:05 -05:00
|
|
|
goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
|
2022-09-08 16:41:29 -05:00
|
|
|
show-text: true
|
|
|
|
|
2022-10-19 05:01:59 -05:00
|
|
|
define-function: (
|
|
|
|
"check-colors",
|
2022-11-17 07:31:50 -06:00
|
|
|
(theme, background, color, border),
|
2023-01-06 08:18:51 -06:00
|
|
|
block {
|
2022-10-19 05:01:59 -05:00
|
|
|
// Setting the theme.
|
2023-01-06 08:18:51 -06:00
|
|
|
local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
|
|
|
|
reload:
|
2022-10-19 05:01:59 -05:00
|
|
|
|
|
|
|
// compile_fail block
|
2023-01-06 08:18:51 -06:00
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.compile_fail .tooltip",
|
|
|
|
{"color": "rgba(255, 0, 0, 0.5)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.compile_fail",
|
|
|
|
{"border-left": "2px solid rgba(255, 0, 0, 0.5)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
2022-10-19 05:01:59 -05:00
|
|
|
|
2023-01-06 08:18:51 -06:00
|
|
|
move-cursor-to: ".docblock .example-wrap.compile_fail .tooltip"
|
2022-10-19 05:01:59 -05:00
|
|
|
|
2023-01-06 08:18:51 -06:00
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.compile_fail .tooltip",
|
|
|
|
{"color": "rgb(255, 0, 0)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.compile_fail",
|
|
|
|
{"border-left": "2px solid rgb(255, 0, 0)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
2023-01-26 14:32:33 -06:00
|
|
|
click: ".docblock .example-wrap.compile_fail .tooltip"
|
|
|
|
assert-text: (
|
|
|
|
".popover.tooltip",
|
|
|
|
"This example deliberately fails to compile"
|
|
|
|
)
|
|
|
|
assert-css: (".popover.tooltip", {
|
|
|
|
"color": |color|,
|
|
|
|
"background-color": |background|,
|
|
|
|
"border-color": |border|,
|
|
|
|
})
|
2022-10-19 05:01:59 -05:00
|
|
|
|
|
|
|
// should_panic block
|
2023-01-06 08:18:51 -06:00
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.should_panic .tooltip",
|
|
|
|
{"color": "rgba(255, 0, 0, 0.5)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.should_panic",
|
|
|
|
{"border-left": "2px solid rgba(255, 0, 0, 0.5)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
2022-10-19 05:01:59 -05:00
|
|
|
|
2023-01-06 08:18:51 -06:00
|
|
|
move-cursor-to: ".docblock .example-wrap.should_panic .tooltip"
|
2022-10-19 05:01:59 -05:00
|
|
|
|
2023-01-06 08:18:51 -06:00
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.should_panic .tooltip",
|
|
|
|
{"color": "rgb(255, 0, 0)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.should_panic",
|
|
|
|
{"border-left": "2px solid rgb(255, 0, 0)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
2023-01-26 14:32:33 -06:00
|
|
|
click: ".docblock .example-wrap.should_panic .tooltip"
|
|
|
|
assert-text: (
|
|
|
|
".popover.tooltip",
|
|
|
|
"This example panics"
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
2023-01-26 14:32:33 -06:00
|
|
|
assert-css: (".popover.tooltip", {
|
|
|
|
"color": |color|,
|
|
|
|
"background-color": |background|,
|
|
|
|
"border-color": |border|,
|
|
|
|
})
|
2022-10-19 05:01:59 -05:00
|
|
|
|
|
|
|
// ignore block
|
2023-01-06 08:18:51 -06:00
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.ignore .tooltip",
|
|
|
|
{"color": "rgba(255, 142, 0, 0.6)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.ignore",
|
|
|
|
{"border-left": "2px solid rgba(255, 142, 0, 0.6)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
2022-10-19 05:01:59 -05:00
|
|
|
|
2023-01-06 08:18:51 -06:00
|
|
|
move-cursor-to: ".docblock .example-wrap.ignore .tooltip"
|
2022-10-19 05:01:59 -05:00
|
|
|
|
2023-01-06 08:18:51 -06:00
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.ignore .tooltip",
|
|
|
|
{"color": "rgb(255, 142, 0)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
|
|
|
assert-css: (
|
2022-10-19 05:01:59 -05:00
|
|
|
".docblock .example-wrap.ignore",
|
|
|
|
{"border-left": "2px solid rgb(255, 142, 0)"},
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
2023-01-26 14:32:33 -06:00
|
|
|
click: ".docblock .example-wrap.ignore .tooltip"
|
|
|
|
assert-text: (
|
|
|
|
".popover.tooltip",
|
|
|
|
"This example is not tested"
|
|
|
|
)
|
|
|
|
assert-css: (".popover.tooltip", {
|
|
|
|
"color": |color|,
|
|
|
|
"background-color": |background|,
|
|
|
|
"border-color": |border|,
|
|
|
|
})
|
|
|
|
click: ".docblock .example-wrap.ignore .tooltip"
|
|
|
|
assert-false: ".popover.tooltip"
|
2023-01-06 08:18:51 -06:00
|
|
|
},
|
2022-10-19 05:01:59 -05:00
|
|
|
)
|
|
|
|
|
2022-11-17 07:31:50 -06:00
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "ayu",
|
2023-01-26 14:32:33 -06:00
|
|
|
"background": "rgb(15, 20, 25)",
|
2022-11-17 07:31:50 -06:00
|
|
|
"color": "rgb(197, 197, 197)",
|
|
|
|
"border": "rgb(92, 103, 115)",
|
|
|
|
})
|
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "dark",
|
2023-01-26 14:32:33 -06:00
|
|
|
"background": "rgb(53, 53, 53)",
|
|
|
|
"color": "rgb(221, 221, 221)",
|
2022-11-17 07:31:50 -06:00
|
|
|
"border": "rgb(224, 224, 224)",
|
|
|
|
})
|
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "light",
|
2023-01-26 14:32:33 -06:00
|
|
|
"background": "rgb(255, 255, 255)",
|
|
|
|
"color": "rgb(0, 0, 0)",
|
2022-11-17 07:31:50 -06:00
|
|
|
"border": "rgb(224, 224, 224)",
|
|
|
|
})
|