Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate GUI colors test to original CSS color format #114348

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 30 additions & 43 deletions tests/rustdoc-gui/pocket-menu.goml
Original file line number Diff line number Diff line change
Expand Up @@ -29,52 +29,39 @@ click: "#help-button"
assert-css: ("#help-button .popover", {"display": "none"})
assert-css: ("#settings-menu .popover", {"display": "none"})

// We check the borders color now:

// Ayu theme
set-local-storage: {
"rustdoc-theme": "ayu",
"rustdoc-use-system-theme": "false",
}
reload:

click: "#help-button"
assert-css: (
"#help-button .popover",
{"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:
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": "rgb(224, 224, 224)"},
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"])
}
)
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"])
// We check the borders color now:
call-function: ("check-popover-colors", {
"theme": "ayu",
"border_color": "#5c6773",
})
call-function: ("check-popover-colors", {
"theme": "dark",
"border_color": "#e0e0e0",
})
call-function: ("check-popover-colors", {
"theme": "light",
"border_color": "#e0e0e0",
})

// Opening the mobile sidebar should close the settings popover.
set-window-size: (650, 600)
Expand Down
Loading