about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-03-25 22:16:44 +0000
committerbors <bors@rust-lang.org>2022-03-25 22:16:44 +0000
commita2ebd5a1f12f4242edf66cbbd471c421bec62753 (patch)
tree95aa8e83497622c2837fd33b22ebd195a4e9924a
parentd53246fedde4c193eae8a003546a8f0f9f85d223 (diff)
parente0a697aad445983707a4b61809c1727325635568 (diff)
downloadrust-a2ebd5a1f12f4242edf66cbbd471c421bec62753.tar.gz
rust-a2ebd5a1f12f4242edf66cbbd471c421bec62753.zip
Auto merge of #95172 - GuillaumeGomez:reduce-wait-for, r=notriddle
Reduce wait-for instructions for rustdoc GUI tests

r? `@notriddle`
-rw-r--r--src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version2
-rw-r--r--src/test/rustdoc-gui/default-settings.goml4
-rw-r--r--src/test/rustdoc-gui/search-filter.goml6
-rw-r--r--src/test/rustdoc-gui/search-result-go-to-first.goml3
-rw-r--r--src/test/rustdoc-gui/sidebar-source-code-display.goml6
-rw-r--r--src/test/rustdoc-gui/sidebar-source-code.goml9
-rw-r--r--src/test/rustdoc-gui/theme-change.goml15
-rw-r--r--src/test/rustdoc-gui/theme-in-history.goml3
-rw-r--r--src/test/rustdoc-gui/toggle-docs.goml9
9 files changed, 20 insertions, 37 deletions
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version
index fab77af2a1a..fcbb5375b7e 100644
--- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version
@@ -1 +1 @@
-0.8.3
\ No newline at end of file
+0.8.4
\ No newline at end of file
diff --git a/src/test/rustdoc-gui/default-settings.goml b/src/test/rustdoc-gui/default-settings.goml
index 68b674a11f2..90f0b087a1b 100644
--- a/src/test/rustdoc-gui/default-settings.goml
+++ b/src/test/rustdoc-gui/default-settings.goml
@@ -4,5 +4,5 @@
 // check.
 goto: file://|DOC_PATH|/settings/index.html
 // Wait a bit to be sure the default theme is applied.
-wait-for: 1000
-assert-css: ("body", {"background-color": "rgb(15, 20, 25)"})
+// If the theme isn't applied, the command will time out.
+wait-for-css: ("body", {"background-color": "rgb(15, 20, 25)"})
diff --git a/src/test/rustdoc-gui/search-filter.goml b/src/test/rustdoc-gui/search-filter.goml
index 3f78d60f28c..aca8390dfb3 100644
--- a/src/test/rustdoc-gui/search-filter.goml
+++ b/src/test/rustdoc-gui/search-filter.goml
@@ -24,11 +24,9 @@ assert-property: ("#crate-search", {"value": "lib2"})
 // Now we check that leaving the search results and putting them back keeps the
 // crate filtering.
 press-key: "Escape"
-wait-for: 100
-assert-css: ("#main-content", {"display": "block"})
+wait-for-css: ("#main-content", {"display": "block"})
 focus: ".search-input"
-wait-for: 100
-assert-css: ("#main-content", {"display": "none"})
+wait-for-css: ("#main-content", {"display": "none"})
 // We check that there is no more "test_docs" appearing.
 assert-false: "#results .externcrate"
 assert-property: ("#crate-search", {"value": "lib2"})
diff --git a/src/test/rustdoc-gui/search-result-go-to-first.goml b/src/test/rustdoc-gui/search-result-go-to-first.goml
index cadd7f6a3f3..255470a3e35 100644
--- a/src/test/rustdoc-gui/search-result-go-to-first.goml
+++ b/src/test/rustdoc-gui/search-result-go-to-first.goml
@@ -16,5 +16,4 @@ assert-css: ("#main-content", {"display": "none"})
 // Now we can check that the feature is working as expected!
 goto: file://|DOC_PATH|/test_docs/index.html?search=struct%3AFoo&go_to_first=true
 // Waiting for the page to load...
-wait-for: 500
-assert-text: (".fqn .in-band", "Struct test_docs::Foo")
+wait-for-text: (".fqn .in-band", "Struct test_docs::Foo")
diff --git a/src/test/rustdoc-gui/sidebar-source-code-display.goml b/src/test/rustdoc-gui/sidebar-source-code-display.goml
index 27229705a9f..377ee9c6eef 100644
--- a/src/test/rustdoc-gui/sidebar-source-code-display.goml
+++ b/src/test/rustdoc-gui/sidebar-source-code-display.goml
@@ -5,8 +5,7 @@ goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
 assert-false: "#sidebar-toggle"
 // For some reason, we need to wait a bit here because it seems like the transition on opacity
 // is being applied whereas it can't be reproduced in a browser...
-wait-for: 500
-assert-css: (".sidebar > *", {"visibility": "hidden", "opacity": 0})
+wait-for-css: (".sidebar > *", {"visibility": "hidden", "opacity": 0})
 
 // Let's retry with javascript enabled.
 javascript: true
@@ -17,6 +16,5 @@ assert-css: (".sidebar > *:not(#sidebar-toggle)", {"visibility": "hidden", "opac
 // Let's expand the sidebar now.
 click: "#sidebar-toggle"
 // Because of the transition CSS, better wait a second before checking.
-wait-for: 1000
-assert-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
+wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
 assert-css: (".sidebar > *:not(#sidebar-toggle)", {"visibility": "visible", "opacity": 1})
diff --git a/src/test/rustdoc-gui/sidebar-source-code.goml b/src/test/rustdoc-gui/sidebar-source-code.goml
index 0cb8e776385..8b4a8bd40dd 100644
--- a/src/test/rustdoc-gui/sidebar-source-code.goml
+++ b/src/test/rustdoc-gui/sidebar-source-code.goml
@@ -7,16 +7,13 @@ size: (1100, 800)
 assert-css: ("nav.sidebar", {"width": "50px"})
 // We now click on the button to expand the sidebar.
 click: (10, 10)
-// We wait for the sidebar to be expanded (there is a 0.5s animation).
-wait-for: 600
-assert-css: ("nav.sidebar.expanded", {"width": "300px"})
+// We wait for the sidebar to be expanded.
+wait-for-css: ("nav.sidebar.expanded", {"width": "300px"})
 assert-css: ("nav.sidebar.expanded a", {"font-size": "14px"})
 // We collapse the sidebar.
 click: (10, 10)
-// We wait for the sidebar to be collapsed (there is a 0.5s animation).
-wait-for: 600
 // We ensure that the class has been removed.
-assert-false: "nav.sidebar.expanded"
+wait-for: "nav.sidebar:not(.expanded)"
 assert: "nav.sidebar"
 
 // We now switch to mobile mode.
diff --git a/src/test/rustdoc-gui/theme-change.goml b/src/test/rustdoc-gui/theme-change.goml
index 73edee64e43..333391ba279 100644
--- a/src/test/rustdoc-gui/theme-change.goml
+++ b/src/test/rustdoc-gui/theme-change.goml
@@ -2,26 +2,21 @@
 goto: file://|DOC_PATH|/test_docs/index.html
 click: "#theme-picker"
 click: "#theme-choices > button:first-child"
-wait-for: 500
 // should be the ayu theme so let's check the color
-assert-css: ("body", { "background-color": "rgb(15, 20, 25)" })
+wait-for-css: ("body", { "background-color": "rgb(15, 20, 25)" })
 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)" })
+wait-for-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)" })
+wait-for-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)" })
+wait-for-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)" })
+wait-for-css: ("body", { "background-color": "rgb(15, 20, 25)" })
 assert-local-storage: { "rustdoc-theme": "ayu" }
diff --git a/src/test/rustdoc-gui/theme-in-history.goml b/src/test/rustdoc-gui/theme-in-history.goml
index b53799188ef..3b66c85d8da 100644
--- a/src/test/rustdoc-gui/theme-in-history.goml
+++ b/src/test/rustdoc-gui/theme-in-history.goml
@@ -12,8 +12,7 @@ click: "#settings-menu"
 wait-for: ".settings"
 // We change the theme to "light".
 click: "#theme-light"
-wait-for: 250
-assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
+wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
 assert-local-storage: { "rustdoc-theme": "light" }
 
 // We go back in history.
diff --git a/src/test/rustdoc-gui/toggle-docs.goml b/src/test/rustdoc-gui/toggle-docs.goml
index bbc85ecd4ad..63962b576df 100644
--- a/src/test/rustdoc-gui/toggle-docs.goml
+++ b/src/test/rustdoc-gui/toggle-docs.goml
@@ -8,9 +8,8 @@ wait-for: 50
 assert-attribute-false: ("#main-content > details.top-doc", {"open": ""})
 assert-text: ("#toggle-all-docs", "[+]")
 click: "#toggle-all-docs"
-wait-for: 50
 // Not collapsed anymore so the "open" attribute should be back.
-assert-attribute: ("#main-content > details.top-doc", {"open": ""})
+wait-for-attribute: ("#main-content > details.top-doc", {"open": ""})
 assert-text: ("#toggle-all-docs", "[−]")
 
 // Check that it works on non-module pages as well.
@@ -27,8 +26,7 @@ assert-attribute-false: (
 
 // We collapse them all.
 click: "#toggle-all-docs"
-wait-for: 50
-assert-text: ("#toggle-all-docs", "[+]")
+wait-for-text: ("#toggle-all-docs", "[+]")
 // We check that all <details> are collapsed (except for the impl block ones).
 assert-attribute-false: ("details.rustdoc-toggle:not(.implementors-toggle)", {"open": ""}, ALL)
 assert-attribute: ("#implementations-list > details.implementors-toggle", {"open": ""})
@@ -40,6 +38,5 @@ assert-attribute-false: (
 )
 // We open them all again.
 click: "#toggle-all-docs"
-wait-for: 50
-assert-text: ("#toggle-all-docs", "[−]")
+wait-for-text: ("#toggle-all-docs", "[−]")
 assert-attribute: ("details.rustdoc-toggle", {"open": ""}, ALL)