Skip to content

Commit 5b75f8a

Browse files
Update rustdoc GUI tests
1 parent 0d156f2 commit 5b75f8a

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
44

55
// The next/prev buttons vertically scroll the code viewport between examples
6+
move-cursor-to: ".scraped-example-list > .scraped-example"
67
store-property: (".scraped-example-list > .scraped-example pre", {"scrollTop": initialScrollTop})
78
focus: ".scraped-example-list > .scraped-example .next"
89
press-key: "Enter"

tests/rustdoc-gui/scrape-examples-color.goml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ define-function: (
1010
block {
1111
call-function: ("switch-theme", {"theme": |theme|})
1212
wait-for: ".more-examples-toggle"
13-
assert-css: (".scraped-example .example-wrap .rust span.highlight:not(.focus)", {
13+
assert-css: (".scraped-example .rust span.highlight:not(.focus)", {
1414
"background-color": |highlight|,
1515
}, ALL)
16-
assert-css: (".scraped-example .example-wrap .rust span.highlight.focus", {
16+
assert-css: (".scraped-example .rust span.highlight.focus", {
1717
"background-color": |highlight_focus|,
1818
}, ALL)
1919

@@ -67,11 +67,11 @@ define-function: (
6767
[theme, background_color_start, background_color_end],
6868
block {
6969
call-function: ("switch-theme", {"theme": |theme|})
70-
assert-css: (".scraped-example:not(.expanded) .code-wrapper::before", {
70+
assert-css: (".scraped-example:not(.expanded)::before", {
7171
"background-image": "linear-gradient(" + |background_color_start| + ", " +
7272
|background_color_end| + ")",
7373
})
74-
assert-css: (".scraped-example:not(.expanded) .code-wrapper::after", {
74+
assert-css: (".scraped-example:not(.expanded)::after", {
7575
"background-image": "linear-gradient(to top, " + |background_color_start| + ", " +
7676
|background_color_end| + ")",
7777
})

tests/rustdoc-gui/scrape-examples-layout.goml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@ go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
33

44
// Check that it's not zero.
55
assert-property-false: (
6-
".more-scraped-examples .scraped-example .code-wrapper .src-line-numbers",
6+
".more-scraped-examples .scraped-example .src-line-numbers",
77
{"clientWidth": "0"}
88
)
99

1010
// Check that examples with very long lines have the same width as ones that don't.
1111
store-property: (
12-
".more-scraped-examples .scraped-example:nth-child(2) .code-wrapper .src-line-numbers",
12+
".more-scraped-examples .scraped-example:nth-child(2) .src-line-numbers",
1313
{"clientWidth": clientWidth},
1414
)
1515

1616
assert-property: (
17-
".more-scraped-examples .scraped-example:nth-child(3) .code-wrapper .src-line-numbers",
17+
".more-scraped-examples .scraped-example:nth-child(3) .src-line-numbers",
1818
{"clientWidth": |clientWidth|}
1919
)
2020

2121
assert-property: (
22-
".more-scraped-examples .scraped-example:nth-child(4) .code-wrapper .src-line-numbers",
22+
".more-scraped-examples .scraped-example:nth-child(4) .src-line-numbers",
2323
{"clientWidth": |clientWidth|}
2424
)
2525

2626
assert-property: (
27-
".more-scraped-examples .scraped-example:nth-child(5) .code-wrapper .src-line-numbers",
27+
".more-scraped-examples .scraped-example:nth-child(5) .src-line-numbers",
2828
{"clientWidth": |clientWidth|}
2929
)
3030

3131
assert-property: (
32-
".more-scraped-examples .scraped-example:nth-child(6) .code-wrapper .src-line-numbers",
32+
".more-scraped-examples .scraped-example:nth-child(6) .src-line-numbers",
3333
{"clientWidth": |clientWidth|}
3434
)
3535

@@ -39,10 +39,10 @@ assert-property: (
3939
store-value: (offset_y, 4)
4040

4141
// First with desktop
42-
assert-position: (".scraped-example .code-wrapper", {"y": 226})
43-
assert-position: (".scraped-example .code-wrapper .prev", {"y": 226 + |offset_y|})
42+
assert-position: (".scraped-example", {"y": 226})
43+
assert-position: (".scraped-example .prev", {"y": 226 + |offset_y|})
4444

4545
// Then with mobile
4646
set-window-size: (600, 600)
47-
assert-position: (".scraped-example .code-wrapper", {"y": 308})
48-
assert-position: (".scraped-example .code-wrapper .prev", {"y": 308 + |offset_y|})
47+
assert-position: (".scraped-example", {"y": 284})
48+
assert-position: (".scraped-example .prev", {"y": 284 + |offset_y|})

0 commit comments

Comments
 (0)