diff --git a/tests/rustdoc-gui/scrape-examples-button-focus.goml b/tests/rustdoc-gui/scrape-examples-button-focus.goml index af4293dfc0057..4950a48bf0c41 100644 --- a/tests/rustdoc-gui/scrape-examples-button-focus.goml +++ b/tests/rustdoc-gui/scrape-examples-button-focus.goml @@ -3,6 +3,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" store-property: (".scraped-example-list > .scraped-example pre", {"scrollTop": initialScrollTop}) focus: ".scraped-example-list > .scraped-example .next" press-key: "Enter" diff --git a/tests/rustdoc-gui/scrape-examples-color.goml b/tests/rustdoc-gui/scrape-examples-color.goml index 588ba08a60c7a..8baf2edb79b23 100644 --- a/tests/rustdoc-gui/scrape-examples-color.goml +++ b/tests/rustdoc-gui/scrape-examples-color.goml @@ -10,10 +10,10 @@ define-function: ( block { call-function: ("switch-theme", {"theme": |theme|}) wait-for: ".more-examples-toggle" - assert-css: (".scraped-example .example-wrap .rust span.highlight:not(.focus)", { + assert-css: (".scraped-example .rust span.highlight:not(.focus)", { "background-color": |highlight|, }, ALL) - assert-css: (".scraped-example .example-wrap .rust span.highlight.focus", { + assert-css: (".scraped-example .rust span.highlight.focus", { "background-color": |highlight_focus|, }, ALL) @@ -67,11 +67,11 @@ define-function: ( [theme, background_color_start, background_color_end], block { call-function: ("switch-theme", {"theme": |theme|}) - assert-css: (".scraped-example:not(.expanded) .code-wrapper::before", { + assert-css: (".scraped-example:not(.expanded)::before", { "background-image": "linear-gradient(" + |background_color_start| + ", " + |background_color_end| + ")", }) - assert-css: (".scraped-example:not(.expanded) .code-wrapper::after", { + assert-css: (".scraped-example:not(.expanded)::after", { "background-image": "linear-gradient(to top, " + |background_color_start| + ", " + |background_color_end| + ")", }) diff --git a/tests/rustdoc-gui/scrape-examples-layout.goml b/tests/rustdoc-gui/scrape-examples-layout.goml index 4fc1c1ac065f4..036d66cc379dd 100644 --- a/tests/rustdoc-gui/scrape-examples-layout.goml +++ b/tests/rustdoc-gui/scrape-examples-layout.goml @@ -3,33 +3,33 @@ go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" // Check that it's not zero. assert-property-false: ( - ".more-scraped-examples .scraped-example .code-wrapper .src-line-numbers", + ".more-scraped-examples .scraped-example .src-line-numbers", {"clientWidth": "0"} ) // Check that examples with very long lines have the same width as ones that don't. store-property: ( - ".more-scraped-examples .scraped-example:nth-child(2) .code-wrapper .src-line-numbers", + ".more-scraped-examples .scraped-example:nth-child(2) .src-line-numbers", {"clientWidth": clientWidth}, ) assert-property: ( - ".more-scraped-examples .scraped-example:nth-child(3) .code-wrapper .src-line-numbers", + ".more-scraped-examples .scraped-example:nth-child(3) .src-line-numbers", {"clientWidth": |clientWidth|} ) assert-property: ( - ".more-scraped-examples .scraped-example:nth-child(4) .code-wrapper .src-line-numbers", + ".more-scraped-examples .scraped-example:nth-child(4) .src-line-numbers", {"clientWidth": |clientWidth|} ) assert-property: ( - ".more-scraped-examples .scraped-example:nth-child(5) .code-wrapper .src-line-numbers", + ".more-scraped-examples .scraped-example:nth-child(5) .src-line-numbers", {"clientWidth": |clientWidth|} ) assert-property: ( - ".more-scraped-examples .scraped-example:nth-child(6) .code-wrapper .src-line-numbers", + ".more-scraped-examples .scraped-example:nth-child(6) .src-line-numbers", {"clientWidth": |clientWidth|} ) @@ -39,10 +39,10 @@ assert-property: ( store-value: (offset_y, 4) // First with desktop -assert-position: (".scraped-example .code-wrapper", {"y": 226}) -assert-position: (".scraped-example .code-wrapper .prev", {"y": 226 + |offset_y|}) +assert-position: (".scraped-example", {"y": 226}) +assert-position: (".scraped-example .prev", {"y": 226 + |offset_y|}) // Then with mobile set-window-size: (600, 600) -assert-position: (".scraped-example .code-wrapper", {"y": 308}) -assert-position: (".scraped-example .code-wrapper .prev", {"y": 308 + |offset_y|}) +assert-position: (".scraped-example", {"y": 284}) +assert-position: (".scraped-example .prev", {"y": 284 + |offset_y|})