Auto merge of #95172 - GuillaumeGomez:reduce-wait-for, r=notriddle
Reduce wait-for instructions for rustdoc GUI tests r? `@notriddle`
This commit is contained in:
commit
a2ebd5a1f1
@ -1 +1 @@
|
|||||||
0.8.3
|
0.8.4
|
@ -4,5 +4,5 @@
|
|||||||
// check.
|
// check.
|
||||||
goto: file://|DOC_PATH|/settings/index.html
|
goto: file://|DOC_PATH|/settings/index.html
|
||||||
// Wait a bit to be sure the default theme is applied.
|
// Wait a bit to be sure the default theme is applied.
|
||||||
wait-for: 1000
|
// If the theme isn't applied, the command will time out.
|
||||||
assert-css: ("body", {"background-color": "rgb(15, 20, 25)"})
|
wait-for-css: ("body", {"background-color": "rgb(15, 20, 25)"})
|
||||||
|
@ -24,11 +24,9 @@ assert-property: ("#crate-search", {"value": "lib2"})
|
|||||||
// Now we check that leaving the search results and putting them back keeps the
|
// Now we check that leaving the search results and putting them back keeps the
|
||||||
// crate filtering.
|
// crate filtering.
|
||||||
press-key: "Escape"
|
press-key: "Escape"
|
||||||
wait-for: 100
|
wait-for-css: ("#main-content", {"display": "block"})
|
||||||
assert-css: ("#main-content", {"display": "block"})
|
|
||||||
focus: ".search-input"
|
focus: ".search-input"
|
||||||
wait-for: 100
|
wait-for-css: ("#main-content", {"display": "none"})
|
||||||
assert-css: ("#main-content", {"display": "none"})
|
|
||||||
// We check that there is no more "test_docs" appearing.
|
// We check that there is no more "test_docs" appearing.
|
||||||
assert-false: "#results .externcrate"
|
assert-false: "#results .externcrate"
|
||||||
assert-property: ("#crate-search", {"value": "lib2"})
|
assert-property: ("#crate-search", {"value": "lib2"})
|
||||||
|
@ -16,5 +16,4 @@ assert-css: ("#main-content", {"display": "none"})
|
|||||||
// Now we can check that the feature is working as expected!
|
// 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
|
goto: file://|DOC_PATH|/test_docs/index.html?search=struct%3AFoo&go_to_first=true
|
||||||
// Waiting for the page to load...
|
// Waiting for the page to load...
|
||||||
wait-for: 500
|
wait-for-text: (".fqn .in-band", "Struct test_docs::Foo")
|
||||||
assert-text: (".fqn .in-band", "Struct test_docs::Foo")
|
|
||||||
|
@ -5,8 +5,7 @@ goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
|
|||||||
assert-false: "#sidebar-toggle"
|
assert-false: "#sidebar-toggle"
|
||||||
// For some reason, we need to wait a bit here because it seems like the transition on opacity
|
// 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...
|
// is being applied whereas it can't be reproduced in a browser...
|
||||||
wait-for: 500
|
wait-for-css: (".sidebar > *", {"visibility": "hidden", "opacity": 0})
|
||||||
assert-css: (".sidebar > *", {"visibility": "hidden", "opacity": 0})
|
|
||||||
|
|
||||||
// Let's retry with javascript enabled.
|
// Let's retry with javascript enabled.
|
||||||
javascript: true
|
javascript: true
|
||||||
@ -17,6 +16,5 @@ assert-css: (".sidebar > *:not(#sidebar-toggle)", {"visibility": "hidden", "opac
|
|||||||
// Let's expand the sidebar now.
|
// Let's expand the sidebar now.
|
||||||
click: "#sidebar-toggle"
|
click: "#sidebar-toggle"
|
||||||
// Because of the transition CSS, better wait a second before checking.
|
// Because of the transition CSS, better wait a second before checking.
|
||||||
wait-for: 1000
|
wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
|
||||||
assert-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
|
|
||||||
assert-css: (".sidebar > *:not(#sidebar-toggle)", {"visibility": "visible", "opacity": 1})
|
assert-css: (".sidebar > *:not(#sidebar-toggle)", {"visibility": "visible", "opacity": 1})
|
||||||
|
@ -7,16 +7,13 @@ size: (1100, 800)
|
|||||||
assert-css: ("nav.sidebar", {"width": "50px"})
|
assert-css: ("nav.sidebar", {"width": "50px"})
|
||||||
// We now click on the button to expand the sidebar.
|
// We now click on the button to expand the sidebar.
|
||||||
click: (10, 10)
|
click: (10, 10)
|
||||||
// We wait for the sidebar to be expanded (there is a 0.5s animation).
|
// We wait for the sidebar to be expanded.
|
||||||
wait-for: 600
|
wait-for-css: ("nav.sidebar.expanded", {"width": "300px"})
|
||||||
assert-css: ("nav.sidebar.expanded", {"width": "300px"})
|
|
||||||
assert-css: ("nav.sidebar.expanded a", {"font-size": "14px"})
|
assert-css: ("nav.sidebar.expanded a", {"font-size": "14px"})
|
||||||
// We collapse the sidebar.
|
// We collapse the sidebar.
|
||||||
click: (10, 10)
|
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.
|
// We ensure that the class has been removed.
|
||||||
assert-false: "nav.sidebar.expanded"
|
wait-for: "nav.sidebar:not(.expanded)"
|
||||||
assert: "nav.sidebar"
|
assert: "nav.sidebar"
|
||||||
|
|
||||||
// We now switch to mobile mode.
|
// We now switch to mobile mode.
|
||||||
|
@ -2,26 +2,21 @@
|
|||||||
goto: file://|DOC_PATH|/test_docs/index.html
|
goto: file://|DOC_PATH|/test_docs/index.html
|
||||||
click: "#theme-picker"
|
click: "#theme-picker"
|
||||||
click: "#theme-choices > button:first-child"
|
click: "#theme-choices > button:first-child"
|
||||||
wait-for: 500
|
|
||||||
// should be the ayu theme so let's check the color
|
// 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"
|
click: "#theme-choices > button:last-child"
|
||||||
wait-for: 500
|
|
||||||
// should be the light theme so let's check the color
|
// 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
|
goto: file://|DOC_PATH|/settings.html
|
||||||
click: "#theme-light"
|
click: "#theme-light"
|
||||||
wait-for: 500
|
wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
|
||||||
assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
|
|
||||||
assert-local-storage: { "rustdoc-theme": "light" }
|
assert-local-storage: { "rustdoc-theme": "light" }
|
||||||
|
|
||||||
click: "#theme-dark"
|
click: "#theme-dark"
|
||||||
wait-for: 500
|
wait-for-css: ("body", { "background-color": "rgb(53, 53, 53)" })
|
||||||
assert-css: ("body", { "background-color": "rgb(53, 53, 53)" })
|
|
||||||
assert-local-storage: { "rustdoc-theme": "dark" }
|
assert-local-storage: { "rustdoc-theme": "dark" }
|
||||||
|
|
||||||
click: "#theme-ayu"
|
click: "#theme-ayu"
|
||||||
wait-for: 500
|
wait-for-css: ("body", { "background-color": "rgb(15, 20, 25)" })
|
||||||
assert-css: ("body", { "background-color": "rgb(15, 20, 25)" })
|
|
||||||
assert-local-storage: { "rustdoc-theme": "ayu" }
|
assert-local-storage: { "rustdoc-theme": "ayu" }
|
||||||
|
@ -12,8 +12,7 @@ click: "#settings-menu"
|
|||||||
wait-for: ".settings"
|
wait-for: ".settings"
|
||||||
// We change the theme to "light".
|
// We change the theme to "light".
|
||||||
click: "#theme-light"
|
click: "#theme-light"
|
||||||
wait-for: 250
|
wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
|
||||||
assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
|
|
||||||
assert-local-storage: { "rustdoc-theme": "light" }
|
assert-local-storage: { "rustdoc-theme": "light" }
|
||||||
|
|
||||||
// We go back in history.
|
// We go back in history.
|
||||||
|
@ -8,9 +8,8 @@ wait-for: 50
|
|||||||
assert-attribute-false: ("#main-content > details.top-doc", {"open": ""})
|
assert-attribute-false: ("#main-content > details.top-doc", {"open": ""})
|
||||||
assert-text: ("#toggle-all-docs", "[+]")
|
assert-text: ("#toggle-all-docs", "[+]")
|
||||||
click: "#toggle-all-docs"
|
click: "#toggle-all-docs"
|
||||||
wait-for: 50
|
|
||||||
// Not collapsed anymore so the "open" attribute should be back.
|
// 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", "[−]")
|
assert-text: ("#toggle-all-docs", "[−]")
|
||||||
|
|
||||||
// Check that it works on non-module pages as well.
|
// Check that it works on non-module pages as well.
|
||||||
@ -27,8 +26,7 @@ assert-attribute-false: (
|
|||||||
|
|
||||||
// We collapse them all.
|
// We collapse them all.
|
||||||
click: "#toggle-all-docs"
|
click: "#toggle-all-docs"
|
||||||
wait-for: 50
|
wait-for-text: ("#toggle-all-docs", "[+]")
|
||||||
assert-text: ("#toggle-all-docs", "[+]")
|
|
||||||
// We check that all <details> are collapsed (except for the impl block ones).
|
// 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-false: ("details.rustdoc-toggle:not(.implementors-toggle)", {"open": ""}, ALL)
|
||||||
assert-attribute: ("#implementations-list > details.implementors-toggle", {"open": ""})
|
assert-attribute: ("#implementations-list > details.implementors-toggle", {"open": ""})
|
||||||
@ -40,6 +38,5 @@ assert-attribute-false: (
|
|||||||
)
|
)
|
||||||
// We open them all again.
|
// We open them all again.
|
||||||
click: "#toggle-all-docs"
|
click: "#toggle-all-docs"
|
||||||
wait-for: 50
|
wait-for-text: ("#toggle-all-docs", "[−]")
|
||||||
assert-text: ("#toggle-all-docs", "[−]")
|
|
||||||
assert-attribute: ("details.rustdoc-toggle", {"open": ""}, ALL)
|
assert-attribute: ("details.rustdoc-toggle", {"open": ""}, ALL)
|
||||||
|
Loading…
Reference in New Issue
Block a user