Update rustdoc GUI tests
This commit is contained in:
@@ -129,13 +129,13 @@ define-function: ("check-line-numbers-existence", [], block {
|
||||
wait-for-local-storage-false: {"rustdoc-line-numbers": "true" }
|
||||
assert-false: ".example-line-numbers"
|
||||
// Line numbers should still be there.
|
||||
assert-css: ("[data-nosnippet]", { "display": "inline-block"})
|
||||
assert-css: ("[data-nosnippet]", { "display": "block"})
|
||||
// Now disabling the setting.
|
||||
click: "input#line-numbers"
|
||||
wait-for-local-storage: {"rustdoc-line-numbers": "true" }
|
||||
assert-false: ".example-line-numbers"
|
||||
// Line numbers should still be there.
|
||||
assert-css: ("[data-nosnippet]", { "display": "inline-block"})
|
||||
assert-css: ("[data-nosnippet]", { "display": "block"})
|
||||
// Closing settings menu.
|
||||
click: "#settings-menu"
|
||||
wait-for-css: ("#settings", {"display": "none"})
|
||||
|
||||
@@ -5,7 +5,7 @@ go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
|
||||
// The next/prev buttons vertically scroll the code viewport between examples
|
||||
move-cursor-to: ".scraped-example-list > .scraped-example"
|
||||
wait-for: ".scraped-example-list > .scraped-example .next"
|
||||
store-value: (initialScrollTop, 250)
|
||||
store-value: (initialScrollTop, 236)
|
||||
assert-property: (".scraped-example-list > .scraped-example .rust", {
|
||||
"scrollTop": |initialScrollTop|,
|
||||
}, NEAR)
|
||||
|
||||
@@ -31,17 +31,32 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/trait_bounds/index.html"
|
||||
click: "#settings-menu"
|
||||
wait-for: "#settings"
|
||||
|
||||
store-size: (".example-wrap .rust code", {"width": rust_width, "height": rust_height})
|
||||
store-size: (".example-wrap .language-text code", {"width": txt_width, "height": txt_height})
|
||||
store-property: (".example-wrap .rust code", {"scrollWidth": rust_width, "scrollHeight": rust_height})
|
||||
store-property: (".example-wrap .language-text code", {"scrollWidth": txt_width, "scrollHeight": txt_height})
|
||||
call-function: ("click-code-wrapping", {"expected": "true"})
|
||||
wait-for-size-false: (".example-wrap .rust code", {"width": |rust_width|, "height": |rust_height|})
|
||||
wait-for-property-false: (
|
||||
".example-wrap .rust code",
|
||||
{"scrollWidth": |rust_width|, "scrollHeight": |rust_height|},
|
||||
)
|
||||
|
||||
store-size: (".example-wrap .rust code", {"width": new_rust_width, "height": new_rust_height})
|
||||
store-size: (".example-wrap .language-text code", {"width": new_txt_width, "height": new_txt_height})
|
||||
store-property: (
|
||||
".example-wrap .rust code",
|
||||
{"scrollWidth": new_rust_width, "scrollHeight": new_rust_height},
|
||||
)
|
||||
store-property: (
|
||||
".example-wrap .language-text code",
|
||||
{"scrollWidth": new_txt_width, "scrollHeight": new_txt_height},
|
||||
)
|
||||
|
||||
assert: |rust_width| > |new_rust_width| && |rust_height| < |new_rust_height|
|
||||
assert: |txt_width| > |new_txt_width| && |txt_height| < |new_txt_height|
|
||||
|
||||
call-function: ("click-code-wrapping", {"expected": "false"})
|
||||
wait-for-size: (".example-wrap .rust code", {"width": |rust_width|, "height": |rust_height|})
|
||||
assert-size: (".example-wrap .language-text code", {"width": |txt_width|, "height": |txt_height|})
|
||||
wait-for-property: (
|
||||
".example-wrap .rust code",
|
||||
{"scrollWidth": |rust_width|, "scrollHeight": |rust_height|},
|
||||
)
|
||||
assert-property: (
|
||||
".example-wrap .language-text code",
|
||||
{"scrollWidth": |txt_width|, "scrollHeight": |txt_height|},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user