diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-05-30 12:12:29 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-05-30 12:12:43 +0200 |
| commit | 70db59ca3534d00227d903e10149e5fb677c0067 (patch) | |
| tree | ed00509dbd04062a9758eeb651471bed2730cdd6 | |
| parent | 5b6c5933ccbf6152230d757611dff9d223ae4233 (diff) | |
| download | rust-70db59ca3534d00227d903e10149e5fb677c0067.tar.gz rust-70db59ca3534d00227d903e10149e5fb677c0067.zip | |
Add GUI test for settings display
| -rw-r--r-- | src/test/rustdoc-gui/settings.goml | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/settings.goml b/src/test/rustdoc-gui/settings.goml index 1b2d1e31f52..2302201fbb6 100644 --- a/src/test/rustdoc-gui/settings.goml +++ b/src/test/rustdoc-gui/settings.goml @@ -1,5 +1,6 @@ // This test ensures that the settings menu display is working as expected. goto: file://|DOC_PATH|/test_docs/index.html +show-text: true // needed when we check for colors below. // First, we check that the settings page doesn't exist. assert-false: "#settings" // We now click on the settings button. @@ -43,6 +44,65 @@ assert: ".setting-line.hidden #preferred-light-theme" // We check that the correct theme is selected. assert-property: ("#theme .choices #theme-dark", {"checked": "true"}) +// Some style checks... +// First we check the "default" display. +assert-css: ( + "#theme-dark", + { + "border-color": "rgb(221, 221, 221)", + "box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset", + }, +) +assert-css: ("#theme-light", {"border-color": "rgb(221, 221, 221)", "box-shadow": "none"}) +// Let's start with the hover. +move-cursor-to: "#theme-dark" +assert-css: ( + "#theme-dark", + { + "border-color": "rgb(33, 150, 243)", + "box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset", + }, +) +move-cursor-to: "#theme-light" +assert-css: ("#theme-light", {"border-color": "rgb(33, 150, 243)", "box-shadow": "none"}) +move-cursor-to: "#theme-ayu" +// Let's now check with the focus. +focus: "#theme-dark" +assert-css: ( + "#theme-dark", + { + "border-color": "rgb(221, 221, 221)", + "box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset, rgb(33, 150, 243) 0px 0px 2px 2px", + }, +) +focus: "#theme-light" +assert-css: ( + "#theme-light", + { + "border-color": "rgb(221, 221, 221)", + "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px", + }, +) +// Now we check we both focus and hover. +move-cursor-to: "#theme-dark" +focus: "#theme-dark" +assert-css: ( + "#theme-dark", + { + "border-color": "rgb(33, 150, 243)", + "box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset, rgb(33, 150, 243) 0px 0px 2px 2px", + }, +) +move-cursor-to: "#theme-light" +focus: "#theme-light" +assert-css: ( + "#theme-light", + { + "border-color": "rgb(33, 150, 243)", + "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px", + }, +) + // We now switch the display. click: "#use-system-theme" // Wait for the hidden element to show up. |
