diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-12-01 15:58:16 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-12-01 15:58:16 +0100 |
| commit | 188f31eba0c190425bb1fde67005cfd535686c36 (patch) | |
| tree | 01e28d33ecca9d8c44031a21214e012ff68148c0 /src/test/rustdoc-gui | |
| parent | f76c4b84c9d3def13d4514db0d13201693552274 (diff) | |
| download | rust-188f31eba0c190425bb1fde67005cfd535686c36.tar.gz rust-188f31eba0c190425bb1fde67005cfd535686c36.zip | |
Add GUI test for toggle filter and opacity
Diffstat (limited to 'src/test/rustdoc-gui')
| -rw-r--r-- | src/test/rustdoc-gui/toggle-docs.goml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/toggle-docs.goml b/src/test/rustdoc-gui/toggle-docs.goml index 8c9fd0a8866..b7d10723767 100644 --- a/src/test/rustdoc-gui/toggle-docs.goml +++ b/src/test/rustdoc-gui/toggle-docs.goml @@ -40,3 +40,32 @@ assert-attribute-false: ( click: "#toggle-all-docs" wait-for-text: ("#toggle-all-docs", "[−]") assert-attribute: ("details.rustdoc-toggle", {"open": ""}, ALL) + +// Checking the toggles style. +show-text: true +define-function: ( + "check-color", + (theme, filter), + [ + // Setting the theme. + ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}), + // We reload the page so the local storage settings are being used. + ("reload"), + + ("assert-css", ("details.rustdoc-toggle > summary::before", { + "opacity": "0.5", + "filter": |filter|, + }, ALL)), + ("move-cursor-to", "details.rustdoc-toggle summary"), + ("assert-css", ("details.rustdoc-toggle > summary:hover::before", { + "opacity": "1", + "filter": |filter|, + })), + // moving the cursor somewhere else to not mess with next function calls. + ("move-cursor-to", ".search-input"), + ] +) + +call-function: ("check-color", {"theme": "ayu", "filter": "invert(1)"}) +call-function: ("check-color", {"theme": "dark", "filter": "invert(1)"}) +call-function: ("check-color", {"theme": "light", "filter": "none"}) |
