Rollup merge of #114348 - GuillaumeGomez:migrate-gui-test-color-25, r=notriddle

Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
This commit is contained in:
Matthias Krüger 2023-08-04 07:25:46 +02:00 committed by GitHub
commit fb15056663
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,52 +29,39 @@ click: "#help-button"
assert-css: ("#help-button .popover", {"display": "none"}) assert-css: ("#help-button .popover", {"display": "none"})
assert-css: ("#settings-menu .popover", {"display": "none"}) assert-css: ("#settings-menu .popover", {"display": "none"})
define-function: (
"check-popover-colors",
(theme, border_color),
block {
set-local-storage: {
"rustdoc-theme": |theme|,
"rustdoc-use-system-theme": "false",
}
reload:
click: "#help-button"
assert-css: (
"#help-button .popover",
{"display": "block", "border-color": |border_color|},
)
compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-color"])
compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
}
)
// We check the borders color now: // We check the borders color now:
call-function: ("check-popover-colors", {
// Ayu theme "theme": "ayu",
set-local-storage: { "border_color": "#5c6773",
"rustdoc-theme": "ayu", })
"rustdoc-use-system-theme": "false", call-function: ("check-popover-colors", {
} "theme": "dark",
reload: "border_color": "#e0e0e0",
})
click: "#help-button" call-function: ("check-popover-colors", {
assert-css: ( "theme": "light",
"#help-button .popover", "border_color": "#e0e0e0",
{"display": "block", "border-color": "rgb(92, 103, 115)"}, })
)
compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-color"])
compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
// Dark theme
set-local-storage: {
"rustdoc-theme": "dark",
"rustdoc-use-system-theme": "false",
}
reload:
click: "#help-button"
assert-css: (
"#help-button .popover",
{"display": "block", "border-color": "rgb(224, 224, 224)"},
)
compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-color"])
compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
// Light theme
set-local-storage: {
"rustdoc-theme": "light",
"rustdoc-use-system-theme": "false",
}
reload:
click: "#help-button"
assert-css: (
"#help-button .popover",
{"display": "block", "border-color": "rgb(224, 224, 224)"},
)
compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-color"])
compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
// Opening the mobile sidebar should close the settings popover. // Opening the mobile sidebar should close the settings popover.
set-window-size: (650, 600) set-window-size: (650, 600)