Skip to content

Commit e3ff707

Browse files
Update rustdoc-gui tests
1 parent 6346af2 commit e3ff707

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

tests/rustdoc-gui/docblock-code-block-line-number.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ define-function: ("check-line-numbers-existence", [], block {
129129
wait-for-local-storage-false: {"rustdoc-line-numbers": "true" }
130130
assert-false: ".example-line-numbers"
131131
// Line numbers should still be there.
132-
assert-css: ("[data-nosnippet]", { "display": "inline-block"})
132+
assert-css: ("[data-nosnippet]", { "display": "block"})
133133
// Now disabling the setting.
134134
click: "input#line-numbers"
135135
wait-for-local-storage: {"rustdoc-line-numbers": "true" }
136136
assert-false: ".example-line-numbers"
137137
// Line numbers should still be there.
138-
assert-css: ("[data-nosnippet]", { "display": "inline-block"})
138+
assert-css: ("[data-nosnippet]", { "display": "block"})
139139
// Closing settings menu.
140140
click: "#settings-menu"
141141
wait-for-css: ("#settings", {"display": "none"})

tests/rustdoc-gui/scrape-examples-button-focus.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
55
// The next/prev buttons vertically scroll the code viewport between examples
66
move-cursor-to: ".scraped-example-list > .scraped-example"
77
wait-for: ".scraped-example-list > .scraped-example .next"
8-
store-value: (initialScrollTop, 250)
8+
store-value: (initialScrollTop, 236)
99
assert-property: (".scraped-example-list > .scraped-example .rust", {
1010
"scrollTop": |initialScrollTop|,
1111
}, NEAR)

tests/rustdoc-gui/source-code-wrapping.goml

+22-7
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,32 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/trait_bounds/index.html"
3131
click: "#settings-menu"
3232
wait-for: "#settings"
3333

34-
store-size: (".example-wrap .rust code", {"width": rust_width, "height": rust_height})
35-
store-size: (".example-wrap .language-text code", {"width": txt_width, "height": txt_height})
34+
store-property: (".example-wrap .rust code", {"scrollWidth": rust_width, "scrollHeight": rust_height})
35+
store-property: (".example-wrap .language-text code", {"scrollWidth": txt_width, "scrollHeight": txt_height})
3636
call-function: ("click-code-wrapping", {"expected": "true"})
37-
wait-for-size-false: (".example-wrap .rust code", {"width": |rust_width|, "height": |rust_height|})
37+
wait-for-property-false: (
38+
".example-wrap .rust code",
39+
{"scrollWidth": |rust_width|, "scrollHeight": |rust_height|},
40+
)
3841

39-
store-size: (".example-wrap .rust code", {"width": new_rust_width, "height": new_rust_height})
40-
store-size: (".example-wrap .language-text code", {"width": new_txt_width, "height": new_txt_height})
42+
store-property: (
43+
".example-wrap .rust code",
44+
{"scrollWidth": new_rust_width, "scrollHeight": new_rust_height},
45+
)
46+
store-property: (
47+
".example-wrap .language-text code",
48+
{"scrollWidth": new_txt_width, "scrollHeight": new_txt_height},
49+
)
4150

4251
assert: |rust_width| > |new_rust_width| && |rust_height| < |new_rust_height|
4352
assert: |txt_width| > |new_txt_width| && |txt_height| < |new_txt_height|
4453

4554
call-function: ("click-code-wrapping", {"expected": "false"})
46-
wait-for-size: (".example-wrap .rust code", {"width": |rust_width|, "height": |rust_height|})
47-
assert-size: (".example-wrap .language-text code", {"width": |txt_width|, "height": |txt_height|})
55+
wait-for-property: (
56+
".example-wrap .rust code",
57+
{"scrollWidth": |rust_width|, "scrollHeight": |rust_height|},
58+
)
59+
assert-property: (
60+
".example-wrap .language-text code",
61+
{"scrollWidth": |txt_width|, "scrollHeight": |txt_height|},
62+
)

0 commit comments

Comments
 (0)