Skip to content

Commit d30cb5b

Browse files
Improve GUI tests by using variables
1 parent a4046e9 commit d30cb5b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Diff for: src/test/rustdoc-gui/check-stab-in-docblock.goml

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@ size: (786, 600)
77
// Confirms that there 3 paragraphs.
88
assert-count: (".top-doc .docblock p", 3)
99
// Checking that there is no scrollable content.
10+
store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(1)", "clientHeight")
11+
store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(1)", "clientWidth")
1012
assert-property: (
1113
".top-doc .docblock p:nth-of-type(1)",
12-
{"scrollHeight": "120", "clientHeight": "120", "scrollWidth": "502", "clientWidth": "502"},
14+
{"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|},
1315
)
16+
store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(2)", "clientHeight")
17+
store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(2)", "clientWidth")
1418
assert-property: (
1519
".top-doc .docblock p:nth-of-type(2)",
16-
{"scrollHeight": "48", "clientHeight": "48", "scrollWidth": "502", "clientWidth": "502"},
20+
{"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|},
1721
)
22+
store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(3)", "clientHeight")
23+
store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(3)", "clientWidth")
1824
assert-property: (
1925
".top-doc .docblock p:nth-of-type(3)",
20-
{"scrollHeight": "48", "clientHeight": "48", "scrollWidth": "502", "clientWidth": "502"},
26+
{"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|},
2127
)

Diff for: src/test/rustdoc-gui/type-declation-overflow.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ assert-property: (".item-decl pre", {"scrollWidth": "950"})
3232
size: (600, 600)
3333
goto: file://|DOC_PATH|/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html
3434
// It shouldn't have an overflow in the topbar either.
35-
assert-property: (".mobile-topbar .location", {"scrollWidth": "500"})
36-
assert-property: (".mobile-topbar .location", {"clientWidth": "500"})
35+
store-property: (scrollWidth, ".mobile-topbar .location", "scrollWidth")
36+
assert-property: (".mobile-topbar .location", {"clientWidth": |scrollWidth|})
3737
assert-css: (".mobile-topbar .location", {"overflow-x": "hidden"})

0 commit comments

Comments
 (0)