Rollup merge of #93453 - GuillaumeGomez:theme-change-test, r=jsha

Add GUI theme change test

r? `@jsha`
This commit is contained in:
Matthias Krüger 2022-01-29 14:46:35 +01:00 committed by GitHub
commit d62b414b80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View file

@ -72,7 +72,7 @@ ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}"
# https://github.com/puppeteer/puppeteer/issues/375
#
# We also specify the version in case we need to update it to go around cache limitations.
RUN npm install -g browser-ui-test@0.5.3 --unsafe-perm=true
RUN npm install -g browser-ui-test@0.5.8 --unsafe-perm=true
ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \

View file

@ -9,3 +9,19 @@ click: "#theme-choices > button:last-child"
wait-for: 500
// should be the light theme so let's check the color
assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
goto: file://|DOC_PATH|/settings.html
click: "#theme-light"
wait-for: 500
assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
assert-local-storage: { "rustdoc-theme": "light" }
click: "#theme-dark"
wait-for: 500
assert-css: ("body", { "background-color": "rgb(53, 53, 53)" })
assert-local-storage: { "rustdoc-theme": "dark" }
click: "#theme-ayu"
wait-for: 500
assert-css: ("body", { "background-color": "rgb(15, 20, 25)" })
assert-local-storage: { "rustdoc-theme": "ayu" }