Update GUI tests
This commit is contained in:
parent
e8762757c3
commit
44e5b3bf3e
3 changed files with 20 additions and 34 deletions
|
@ -5,36 +5,25 @@ assert-false: "#settings"
|
||||||
// We now click on the settings button.
|
// We now click on the settings button.
|
||||||
click: "#settings-menu"
|
click: "#settings-menu"
|
||||||
wait-for: "#settings"
|
wait-for: "#settings"
|
||||||
assert: "#main-content.hidden"
|
|
||||||
assert-css: ("#settings", {"display": "block"})
|
assert-css: ("#settings", {"display": "block"})
|
||||||
// Let's close it by clicking on the same button.
|
// Let's close it by clicking on the same button.
|
||||||
click: "#settings-menu"
|
click: "#settings-menu"
|
||||||
assert-false: "#alternative-display #settings"
|
wait-for-css: ("#settings", {"display": "none"})
|
||||||
assert: "#not-displayed #settings"
|
|
||||||
assert: "#main-content:not(.hidden)"
|
|
||||||
|
|
||||||
// Let's open and then close it again with the "close settings" button.
|
|
||||||
click: "#settings-menu"
|
|
||||||
wait-for: "#alternative-display #settings"
|
|
||||||
assert: "#main-content.hidden"
|
|
||||||
click: "#back"
|
|
||||||
wait-for: "#not-displayed #settings"
|
|
||||||
assert: "#main-content:not(.hidden)"
|
|
||||||
|
|
||||||
// Let's check that pressing "ESCAPE" is closing it.
|
// Let's check that pressing "ESCAPE" is closing it.
|
||||||
click: "#settings-menu"
|
click: "#settings-menu"
|
||||||
wait-for: "#alternative-display #settings"
|
wait-for-css: ("#settings", {"display": "block"})
|
||||||
press-key: "Escape"
|
press-key: "Escape"
|
||||||
wait-for: "#not-displayed #settings"
|
wait-for-css: ("#settings", {"display": "none"})
|
||||||
assert: "#main-content:not(.hidden)"
|
|
||||||
|
|
||||||
// Let's click on it when the search results are displayed.
|
// Let's click on it when the search results are displayed.
|
||||||
focus: ".search-input"
|
focus: ".search-input"
|
||||||
write: "test"
|
write: "test"
|
||||||
wait-for: "#alternative-display #search"
|
wait-for: "#alternative-display #search"
|
||||||
click: "#settings-menu"
|
click: "#settings-menu"
|
||||||
wait-for: "#alternative-display #settings"
|
wait-for-css: ("#settings", {"display": "block"})
|
||||||
assert: "#not-displayed #search"
|
// Ensure that the search is still displayed.
|
||||||
|
wait-for: "#alternative-display #search"
|
||||||
assert: "#main-content.hidden"
|
assert: "#main-content.hidden"
|
||||||
|
|
||||||
// Now let's check the content of the settings menu.
|
// Now let's check the content of the settings menu.
|
||||||
|
|
|
@ -12,15 +12,3 @@ assert-css: ("#help", {"display": "flex"})
|
||||||
assert-false: "#help.hidden"
|
assert-false: "#help.hidden"
|
||||||
press-key: "Escape"
|
press-key: "Escape"
|
||||||
assert-css: ("#help.hidden", {"display": "none"})
|
assert-css: ("#help.hidden", {"display": "none"})
|
||||||
// Check for the themes list.
|
|
||||||
assert-css: ("#theme-choices", {"display": "none"})
|
|
||||||
press-key: "t"
|
|
||||||
assert-css: ("#theme-choices", {"display": "block"})
|
|
||||||
press-key: "t"
|
|
||||||
// We ensure that 't' hides back the menu.
|
|
||||||
assert-css: ("#theme-choices", {"display": "none"})
|
|
||||||
press-key: "t"
|
|
||||||
assert-css: ("#theme-choices", {"display": "block"})
|
|
||||||
press-key: "Escape"
|
|
||||||
// We ensure that 'Escape' hides the menu too.
|
|
||||||
assert-css: ("#theme-choices", {"display": "none"})
|
|
||||||
|
|
|
@ -1,12 +1,21 @@
|
||||||
// Ensures that the theme change is working as expected.
|
// Ensures that the theme change is working as expected.
|
||||||
goto: file://|DOC_PATH|/test_docs/index.html
|
goto: file://|DOC_PATH|/test_docs/index.html
|
||||||
click: "#theme-picker"
|
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
|
||||||
click: "#theme-choices > button:first-child"
|
reload:
|
||||||
// should be the ayu theme so let's check the color
|
click: "#settings-menu"
|
||||||
|
wait-for: "#theme-ayu"
|
||||||
|
click: "#theme-ayu"
|
||||||
|
// should be the ayu theme so let's check the color.
|
||||||
wait-for-css: ("body", { "background-color": "rgb(15, 20, 25)" })
|
wait-for-css: ("body", { "background-color": "rgb(15, 20, 25)" })
|
||||||
click: "#theme-choices > button:last-child"
|
assert-local-storage: { "rustdoc-theme": "ayu" }
|
||||||
// should be the light theme so let's check the color
|
click: "#theme-light"
|
||||||
|
// should be the light theme so let's check the color.
|
||||||
wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
|
wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
|
||||||
|
assert-local-storage: { "rustdoc-theme": "light" }
|
||||||
|
click: "#theme-dark"
|
||||||
|
// Should be the dark theme so let's check the color.
|
||||||
|
wait-for-css: ("body", { "background-color": "rgb(53, 53, 53)" })
|
||||||
|
assert-local-storage: { "rustdoc-theme": "dark" }
|
||||||
|
|
||||||
goto: file://|DOC_PATH|/settings.html
|
goto: file://|DOC_PATH|/settings.html
|
||||||
wait-for: "#settings"
|
wait-for: "#settings"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue