Make use of wait-for*-false commands

This commit is contained in:
Guillaume Gomez 2024-09-28 18:04:00 +02:00
parent 62cbd2b7bd
commit 2f16ff7b37

View File

@ -87,8 +87,7 @@ assert-css: ("#settings", {"display": "block"})
// Then, click the toggle button. // Then, click the toggle button.
click: "input#line-numbers" click: "input#line-numbers"
wait-for: 100 // FIXME: `wait-for-false` does not exist wait-for-false: "pre.example-line-numbers"
assert-false: "pre.example-line-numbers"
assert-local-storage: {"rustdoc-line-numbers": "false" } assert-local-storage: {"rustdoc-line-numbers": "false" }
// Check that the rounded corners are back. // Check that the rounded corners are back.
@ -107,8 +106,7 @@ assert-css: (
click: "input#line-numbers" click: "input#line-numbers"
wait-for: "pre.example-line-numbers" wait-for: "pre.example-line-numbers"
assert-local-storage: {"rustdoc-line-numbers": "true" } assert-local-storage: {"rustdoc-line-numbers": "true" }
wait-for: 100 // FIXME: `wait-for-false` does not exist wait-for: "pre.example-line-numbers"
assert: "pre.example-line-numbers"
// Same check with scraped examples line numbers. // Same check with scraped examples line numbers.
go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
@ -195,15 +193,13 @@ define-function: ("check-line-numbers-existence", [], block {
// Then, click the toggle button. // Then, click the toggle button.
click: "input#line-numbers" click: "input#line-numbers"
wait-for: 100 // FIXME: `wait-for-false` does not exist wait-for-local-storage-false: {"rustdoc-line-numbers": "true" }
assert-local-storage-false: {"rustdoc-line-numbers": "true" }
assert-false: ".example-line-numbers" assert-false: ".example-line-numbers"
// Line numbers should still be there. // Line numbers should still be there.
assert: ".src-line-numbers" assert: ".src-line-numbers"
// Now disabling the setting. // Now disabling the setting.
click: "input#line-numbers" click: "input#line-numbers"
wait-for: 100 // FIXME: `wait-for-false` does not exist wait-for-local-storage: {"rustdoc-line-numbers": "true" }
assert-local-storage: {"rustdoc-line-numbers": "true" }
assert-false: ".example-line-numbers" assert-false: ".example-line-numbers"
// Line numbers should still be there. // Line numbers should still be there.
assert: ".src-line-numbers" assert: ".src-line-numbers"
@ -246,12 +242,10 @@ wait-for: "#settings"
// Then, click the toggle button. // Then, click the toggle button.
click: "input#line-numbers" click: "input#line-numbers"
wait-for: 100 // FIXME: `wait-for-false` does not exist wait-for-count: (".example-wrap > pre.example-line-numbers", 0)
assert-local-storage-false: {"rustdoc-line-numbers": "true" } assert-local-storage-false: {"rustdoc-line-numbers": "true" }
assert-count: (".example-wrap > pre.example-line-numbers", 0)
// Now turning off the setting. // Now turning off the setting.
click: "input#line-numbers" click: "input#line-numbers"
wait-for: 100 // FIXME: `wait-for-false` does not exist wait-for-count: (".example-wrap > pre.example-line-numbers", 2)
assert-local-storage: {"rustdoc-line-numbers": "true" } assert-local-storage: {"rustdoc-line-numbers": "true" }
assert-count: (".example-wrap > pre.example-line-numbers", 2)