diff options
Diffstat (limited to 'tests/rustdoc-gui')
27 files changed, 337 insertions, 281 deletions
diff --git a/tests/rustdoc-gui/anchors.goml b/tests/rustdoc-gui/anchors.goml index 0904aa90e..e9b772969 100644 --- a/tests/rustdoc-gui/anchors.goml +++ b/tests/rustdoc-gui/anchors.goml @@ -75,35 +75,35 @@ call-function: ( "check-colors", { "theme": "ayu", - "main_color": "rgb(197, 197, 197)", - "title_color": "rgb(255, 255, 255)", - "main_heading_color": "rgb(255, 255, 255)", - "main_heading_type_color": "rgb(255, 160, 165)", - "src_link_color": "rgb(57, 175, 215)", - "sidebar_link_color": "rgb(83, 177, 219)", + "main_color": "#c5c5c5", + "title_color": "#fff", + "main_heading_color": "#fff", + "main_heading_type_color": "#ffa0a5", + "src_link_color": "#39afd7", + "sidebar_link_color": "#53b1db", }, ) call-function: ( "check-colors", { "theme": "dark", - "main_color": "rgb(221, 221, 221)", - "title_color": "rgb(221, 221, 221)", - "main_heading_color": "rgb(221, 221, 221)", - "main_heading_type_color": "rgb(45, 191, 184)", - "src_link_color": "rgb(210, 153, 29)", - "sidebar_link_color": "rgb(253, 191, 53)", + "main_color": "#ddd", + "title_color": "#ddd", + "main_heading_color": "#ddd", + "main_heading_type_color": "#2dbfb8", + "src_link_color": "#d2991d", + "sidebar_link_color": "#fdbf35", }, ) call-function: ( "check-colors", { "theme": "light", - "main_color": "rgb(0, 0, 0)", - "title_color": "rgb(0, 0, 0)", - "main_heading_color": "rgb(0, 0, 0)", - "main_heading_type_color": "rgb(173, 55, 138)", - "src_link_color": "rgb(56, 115, 173)", - "sidebar_link_color": "rgb(53, 109, 164)", + "main_color": "black", + "title_color": "black", + "main_heading_color": "black", + "main_heading_type_color": "#ad378a", + "src_link_color": "#3873ad", + "sidebar_link_color": "#356da4", }, ) diff --git a/tests/rustdoc-gui/check-stab-in-docblock.goml b/tests/rustdoc-gui/check-stab-in-docblock.goml index 2f6263621..f25c88690 100644 --- a/tests/rustdoc-gui/check-stab-in-docblock.goml +++ b/tests/rustdoc-gui/check-stab-in-docblock.goml @@ -7,20 +7,26 @@ set-window-size: (786, 600) // Confirms that there 3 paragraphs. assert-count: (".top-doc .docblock p", 3) // Checking that there is no scrollable content. -store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(1)", "clientHeight") -store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(1)", "clientWidth") +store-property: (".top-doc .docblock p:nth-of-type(1)", { + "clientHeight": clientHeight, + "clientWidth": clientWidth, +}) assert-property: ( ".top-doc .docblock p:nth-of-type(1)", {"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|}, ) -store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(2)", "clientHeight") -store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(2)", "clientWidth") +store-property: (".top-doc .docblock p:nth-of-type(2)", { + "clientHeight": clientHeight, + "clientWidth": clientWidth, +}) assert-property: ( ".top-doc .docblock p:nth-of-type(2)", {"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|}, ) -store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(3)", "clientHeight") -store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(3)", "clientWidth") +store-property: (".top-doc .docblock p:nth-of-type(3)", { + "clientHeight": clientHeight, + "clientWidth": clientWidth, +}) assert-property: ( ".top-doc .docblock p:nth-of-type(3)", {"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|}, diff --git a/tests/rustdoc-gui/codeblock-sub.goml b/tests/rustdoc-gui/codeblock-sub.goml index 03575cc6a..a4b055876 100644 --- a/tests/rustdoc-gui/codeblock-sub.goml +++ b/tests/rustdoc-gui/codeblock-sub.goml @@ -1,5 +1,5 @@ // Test that code blocks nested within <sub> do not have a line height of 0. go-to: "file://" + |DOC_PATH| + "/test_docs/codeblock_sub/index.html" -store-property: (codeblock_sub_1, "#codeblock-sub-1", "offsetHeight") +store-property: ("#codeblock-sub-1", {"offsetHeight": codeblock_sub_1}) assert-property-false: ("#codeblock-sub-3", { "offsetHeight": |codeblock_sub_1| }) diff --git a/tests/rustdoc-gui/codeblock-tooltip.goml b/tests/rustdoc-gui/codeblock-tooltip.goml index 2ed0579d3..e1c81ed79 100644 --- a/tests/rustdoc-gui/codeblock-tooltip.goml +++ b/tests/rustdoc-gui/codeblock-tooltip.goml @@ -109,19 +109,19 @@ define-function: ( call-function: ("check-colors", { "theme": "ayu", - "background": "rgb(15, 20, 25)", - "color": "rgb(197, 197, 197)", - "border": "rgb(92, 103, 115)", + "background": "#0f1419", + "color": "#c5c5c5", + "border": "#5c6773", }) call-function: ("check-colors", { "theme": "dark", - "background": "rgb(53, 53, 53)", - "color": "rgb(221, 221, 221)", - "border": "rgb(224, 224, 224)", + "background": "#353535", + "color": "#ddd", + "border": "#e0e0e0", }) call-function: ("check-colors", { "theme": "light", - "background": "rgb(255, 255, 255)", - "color": "rgb(0, 0, 0)", - "border": "rgb(224, 224, 224)", + "background": "white", + "color": "black", + "border": "#e0e0e0", }) diff --git a/tests/rustdoc-gui/docblock-details.goml b/tests/rustdoc-gui/docblock-details.goml index 58ff17619..8e6d2ba82 100644 --- a/tests/rustdoc-gui/docblock-details.goml +++ b/tests/rustdoc-gui/docblock-details.goml @@ -9,7 +9,7 @@ reload: assert-text: (".top-doc .docblock > h3", "Hello") assert-css: ( ".top-doc .docblock > h3", - {"border-bottom": "1px solid rgb(210, 210, 210)"}, + {"border-bottom": "1px solid #d2d2d2"}, ) // We now check that the `<summary>` doesn't have a bottom border and has the correct display. assert-css: ( diff --git a/tests/rustdoc-gui/highlight-colors.goml b/tests/rustdoc-gui/highlight-colors.goml index 4f5e1c110..d162674fa 100644 --- a/tests/rustdoc-gui/highlight-colors.goml +++ b/tests/rustdoc-gui/highlight-colors.goml @@ -43,52 +43,52 @@ define-function: ( call-function: ("check-colors", { "theme": "ayu", - "kw": "rgb(255, 119, 51)", - "kw2": "rgb(255, 119, 51)", - "prelude_ty": "rgb(105, 242, 223)", - "prelude_val": "rgb(255, 119, 51)", - "lifetime": "rgb(255, 119, 51)", - "number": "rgb(184, 204, 82)", - "string": "rgb(184, 204, 82)", - "bool_val": "rgb(255, 119, 51)", - "self": "rgb(54, 163, 217)", - "attr": "rgb(230, 225, 207)", - "macro": "rgb(163, 122, 204)", - "question_mark": "rgb(255, 144, 17)", - "comment": "rgb(120, 135, 151)", - "doc_comment": "rgb(161, 172, 136)", + "kw": "#ff7733", + "kw2": "#ff7733", + "prelude_ty": "#69f2df", + "prelude_val": "#ff7733", + "lifetime": "#ff7733", + "number": "#b8cc52", + "string": "#b8cc52", + "bool_val": "#ff7733", + "self": "#36a3d9", + "attr": "#e6e1cf", + "macro": "#a37acc", + "question_mark": "#ff9011", + "comment": "#788797", + "doc_comment": "#a1ac88", }) call-function: ("check-colors", { "theme": "dark", - "kw": "rgb(171, 138, 193)", - "kw2": "rgb(118, 154, 203)", - "prelude_ty": "rgb(118, 154, 203)", - "prelude_val": "rgb(238, 104, 104)", - "lifetime": "rgb(217, 127, 38)", - "number": "rgb(131, 163, 0)", - "string": "rgb(131, 163, 0)", - "bool_val": "rgb(238, 104, 104)", - "self": "rgb(238, 104, 104)", - "attr": "rgb(238, 104, 104)", - "macro": "rgb(62, 153, 159)", - "question_mark": "rgb(255, 144, 17)", - "comment": "rgb(141, 141, 139)", - "doc_comment": "rgb(140, 163, 117)", + "kw": "#ab8ac1", + "kw2": "#769acb", + "prelude_ty": "#769acb", + "prelude_val": "#ee6868", + "lifetime": "#d97f26", + "number": "#83a300", + "string": "#83a300", + "bool_val": "#ee6868", + "self": "#ee6868", + "attr": "#ee6868", + "macro": "#3e999f", + "question_mark": "#ff9011", + "comment": "#8d8d8b", + "doc_comment": "#8ca375", }) call-function: ("check-colors", { "theme": "light", - "kw": "rgb(137, 89, 168)", - "kw2": "rgb(66, 113, 174)", - "prelude_ty": "rgb(66, 113, 174)", - "prelude_val": "rgb(200, 40, 41)", - "lifetime": "rgb(183, 101, 20)", - "number": "rgb(113, 140, 0)", - "string": "rgb(113, 140, 0)", - "bool_val": "rgb(200, 40, 41)", - "self": "rgb(200, 40, 41)", - "attr": "rgb(200, 40, 41)", - "macro": "rgb(62, 153, 159)", - "question_mark": "rgb(255, 144, 17)", - "comment": "rgb(142, 144, 140)", - "doc_comment": "rgb(77, 77, 76)", + "kw": "#8959a8", + "kw2": "#4271ae", + "prelude_ty": "#4271ae", + "prelude_val": "#c82829", + "lifetime": "#b76514", + "number": "#718c00", + "string": "#718c00", + "bool_val": "#c82829", + "self": "#c82829", + "attr": "#c82829", + "macro": "#3e999f", + "question_mark": "#ff9011", + "comment": "#8e908c", + "doc_comment": "#4d4d4c", }) diff --git a/tests/rustdoc-gui/item-info.goml b/tests/rustdoc-gui/item-info.goml index 60fd7c4e1..030ff8f8a 100644 --- a/tests/rustdoc-gui/item-info.goml +++ b/tests/rustdoc-gui/item-info.goml @@ -4,8 +4,8 @@ go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html" // We set a fixed size so there is no chance of "random" resize. set-window-size: (1100, 800) // We check that ".item-info" is bigger than its content. -assert-css: (".item-info", {"width": "840px"}) -assert-css: (".item-info .stab", {"width": "289px"}) +assert-size: (".item-info", {"width": 840}) +assert-size: (".item-info .stab", {"width": 289}) assert-position: (".item-info .stab", {"x": 245}) // Now we ensure that they're not rendered on the same line. diff --git a/tests/rustdoc-gui/jump-to-def-background.goml b/tests/rustdoc-gui/jump-to-def-background.goml index 3a7d48284..6adc36b0e 100644 --- a/tests/rustdoc-gui/jump-to-def-background.goml +++ b/tests/rustdoc-gui/jump-to-def-background.goml @@ -17,6 +17,6 @@ define-function: ( }, ) -call-function: ("check-background-color", ("ayu", "rgb(51, 51, 51)")) -call-function: ("check-background-color", ("dark", "rgb(51, 51, 51)")) -call-function: ("check-background-color", ("light", "rgb(238, 238, 238)")) +call-function: ("check-background-color", ("ayu", "#333")) +call-function: ("check-background-color", ("dark", "#333")) +call-function: ("check-background-color", ("light", "#eee")) diff --git a/tests/rustdoc-gui/notable-trait.goml b/tests/rustdoc-gui/notable-trait.goml index f65da5774..ecb57c274 100644 --- a/tests/rustdoc-gui/notable-trait.goml +++ b/tests/rustdoc-gui/notable-trait.goml @@ -225,12 +225,12 @@ assert: "#method\.create_an_iterator_from_read .tooltip:focus" // Now we check that the focus isn't given back to the wrong item when opening // another popover. -store-window-property: (scroll, "scrollY") +store-window-property: {"scrollY": scroll} click: "#method\.create_an_iterator_from_read .fn" // We ensure that the scroll position changed. assert-window-property-false: {"scrollY": |scroll|} // Store the new position. -store-window-property: (scroll, "scrollY") +store-window-property: {"scrollY": scroll} click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']" wait-for: "//*[@class='tooltip popover']" click: "#settings-menu a" @@ -239,12 +239,12 @@ click: ".search-input" assert-window-property-false: {"scrollY": |scroll|} // Same but with Escape handling. -store-window-property: (scroll, "scrollY") +store-window-property: {"scrollY": scroll} click: "#method\.create_an_iterator_from_read .fn" // We ensure that the scroll position changed. assert-window-property-false: {"scrollY": |scroll|} // Store the new position. -store-window-property: (scroll, "scrollY") +store-window-property: {"scrollY": scroll} click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']" wait-for: "//*[@class='tooltip popover']" click: "#settings-menu a" diff --git a/tests/rustdoc-gui/scrape-examples-button-focus.goml b/tests/rustdoc-gui/scrape-examples-button-focus.goml index 77061ea2a..af4293dfc 100644 --- a/tests/rustdoc-gui/scrape-examples-button-focus.goml +++ b/tests/rustdoc-gui/scrape-examples-button-focus.goml @@ -3,7 +3,7 @@ go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html" // The next/prev buttons vertically scroll the code viewport between examples -store-property: (initialScrollTop, ".scraped-example-list > .scraped-example pre", "scrollTop") +store-property: (".scraped-example-list > .scraped-example pre", {"scrollTop": initialScrollTop}) focus: ".scraped-example-list > .scraped-example .next" press-key: "Enter" assert-property-false: (".scraped-example-list > .scraped-example pre", { @@ -16,7 +16,7 @@ assert-property: (".scraped-example-list > .scraped-example pre", { }, NEAR) // The expand button increases the scrollHeight of the minimized code viewport -store-property: (smallOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight") +store-property: (".scraped-example-list > .scraped-example pre", {"offsetHeight": smallOffsetHeight}) assert-property-false: (".scraped-example-list > .scraped-example pre", { "scrollHeight": |smallOffsetHeight| }, NEAR) @@ -25,7 +25,7 @@ press-key: "Enter" assert-property-false: (".scraped-example-list > .scraped-example pre", { "offsetHeight": |smallOffsetHeight| }, NEAR) -store-property: (fullOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight") +store-property: (".scraped-example-list > .scraped-example pre", {"offsetHeight": fullOffsetHeight}) assert-property: (".scraped-example-list > .scraped-example pre", { "scrollHeight": |fullOffsetHeight| }, NEAR) diff --git a/tests/rustdoc-gui/scrape-examples-color.goml b/tests/rustdoc-gui/scrape-examples-color.goml index 8ddb06fcc..0052d18dc 100644 --- a/tests/rustdoc-gui/scrape-examples-color.goml +++ b/tests/rustdoc-gui/scrape-examples-color.goml @@ -33,30 +33,30 @@ define-function: ( call-function: ("check-colors", { "theme": "ayu", - "highlight": "rgb(91, 59, 1)", - "highlight_focus": "rgb(124, 75, 15)", - "help_border": "rgb(170, 170, 170)", - "help_color": "rgb(238, 238, 238)", - "help_hover_border": "rgb(255, 255, 255)", - "help_hover_color": "rgb(255, 255, 255)", + "highlight": "#5b3b01", + "highlight_focus": "#7c4b0f", + "help_border": "#aaa", + "help_color": "#eee", + "help_hover_border": "#fff", + "help_hover_color": "#fff", }) call-function: ("check-colors", { "theme": "dark", - "highlight": "rgb(91, 59, 1)", - "highlight_focus": "rgb(124, 75, 15)", - "help_border": "rgb(170, 170, 170)", - "help_color": "rgb(238, 238, 238)", - "help_hover_border": "rgb(255, 255, 255)", - "help_hover_color": "rgb(255, 255, 255)", + "highlight": "#5b3b01", + "highlight_focus": "#7c4b0f", + "help_border": "#aaa", + "help_color": "#eee", + "help_hover_border": "#fff", + "help_hover_color": "#fff", }) call-function: ("check-colors", { "theme": "light", - "highlight": "rgb(252, 255, 214)", - "highlight_focus": "rgb(246, 253, 176)", - "help_border": "rgb(85, 85, 85)", - "help_color": "rgb(51, 51, 51)", - "help_hover_border": "rgb(0, 0, 0)", - "help_hover_color": "rgb(0, 0, 0)", + "highlight": "#fcffd6", + "highlight_focus": "#f6fdb0", + "help_border": "#555", + "help_color": "#333", + "help_hover_border": "#000", + "help_hover_color": "#000", }) // Now testing the top and bottom background in case there is only one scraped examples. @@ -81,16 +81,16 @@ define-function: ( call-function: ("check-background", { "theme": "ayu", - "background_color_start": "rgb(15, 20, 25)", + "background_color_start": "rgba(15, 20, 25, 1)", "background_color_end": "rgba(15, 20, 25, 0)", }) call-function: ("check-background", { "theme": "dark", - "background_color_start": "rgb(53, 53, 53)", + "background_color_start": "rgba(53, 53, 53, 1)", "background_color_end": "rgba(53, 53, 53, 0)", }) call-function: ("check-background", { "theme": "light", - "background_color_start": "rgb(255, 255, 255)", + "background_color_start": "rgba(255, 255, 255, 1)", "background_color_end": "rgba(255, 255, 255, 0)", }) diff --git a/tests/rustdoc-gui/scrape-examples-layout.goml b/tests/rustdoc-gui/scrape-examples-layout.goml index 160056d6d..4fc1c1ac0 100644 --- a/tests/rustdoc-gui/scrape-examples-layout.goml +++ b/tests/rustdoc-gui/scrape-examples-layout.goml @@ -9,9 +9,8 @@ assert-property-false: ( // Check that examples with very long lines have the same width as ones that don't. store-property: ( - clientWidth, ".more-scraped-examples .scraped-example:nth-child(2) .code-wrapper .src-line-numbers", - "clientWidth" + {"clientWidth": clientWidth}, ) assert-property: ( @@ -40,8 +39,8 @@ assert-property: ( store-value: (offset_y, 4) // First with desktop -assert-position: (".scraped-example .code-wrapper", {"y": 253}) -assert-position: (".scraped-example .code-wrapper .prev", {"y": 253 + |offset_y|}) +assert-position: (".scraped-example .code-wrapper", {"y": 226}) +assert-position: (".scraped-example .code-wrapper .prev", {"y": 226 + |offset_y|}) // Then with mobile set-window-size: (600, 600) diff --git a/tests/rustdoc-gui/search-corrections.goml b/tests/rustdoc-gui/search-corrections.goml new file mode 100644 index 000000000..5d1b83b35 --- /dev/null +++ b/tests/rustdoc-gui/search-corrections.goml @@ -0,0 +1,56 @@ +// ignore-tidy-linelength + +// Checks that the search tab result tell the user about corrections +// First, try a search-by-name +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" +// Intentionally wrong spelling of "NotableStructWithLongName" +write: (".search-input", "NotableStructWithLongNamr") +// To be SURE that the search will be run. +press-key: 'Enter' +// Waiting for the search results to appear... +wait-for: "#search-tabs" + +// Corrections aren't shown on the "In Names" tab. +assert: "#search-tabs button.selected:first-child" +assert-css: (".search-corrections", { + "display": "none" +}) + +// Corrections do get shown on the "In Parameters" tab. +click: "#search-tabs button:nth-child(2)" +assert: "#search-tabs button.selected:nth-child(2)" +assert-css: (".search-corrections", { + "display": "block" +}) +assert-text: ( + ".search-corrections", + "Type \"notablestructwithlongnamr\" not found. Showing results for closest type name \"notablestructwithlongname\" instead." +) + +// Corrections do get shown on the "In Return Type" tab. +click: "#search-tabs button:nth-child(3)" +assert: "#search-tabs button.selected:nth-child(3)" +assert-css: (".search-corrections", { + "display": "block" +}) +assert-text: ( + ".search-corrections", + "Type \"notablestructwithlongnamr\" not found. Showing results for closest type name \"notablestructwithlongname\" instead." +) + +// Now, explicit return values +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" +// Intentionally wrong spelling of "NotableStructWithLongName" +write: (".search-input", "-> NotableStructWithLongNamr") +// To be SURE that the search will be run. +press-key: 'Enter' +// Waiting for the search results to appear... +wait-for: "#search-tabs" + +assert-css: (".search-corrections", { + "display": "block" +}) +assert-text: ( + ".search-corrections", + "Type \"notablestructwithlongnamr\" not found. Showing results for closest type name \"notablestructwithlongname\" instead." +) diff --git a/tests/rustdoc-gui/search-result-color.goml b/tests/rustdoc-gui/search-result-color.goml index da46a90df..90f7160b7 100644 --- a/tests/rustdoc-gui/search-result-color.goml +++ b/tests/rustdoc-gui/search-result-color.goml @@ -47,89 +47,89 @@ reload: wait-for: "#search-tabs" assert-css: ( "#search-tabs > button > .count", - {"color": "rgb(136, 136, 136)"}, + {"color": "#888"}, ALL, ) assert-css: ( "//*[@class='desc'][text()='Just a normal struct.']", - {"color": "rgb(197, 197, 197)"}, + {"color": "#c5c5c5"}, ) assert-css: ( "//*[@class='result-name']/*[text()='test_docs::']", - {"color": "rgb(0, 150, 207)"}, + {"color": "#0096cf"}, ) // Checking the color of the bottom border. assert-css: ( ".search-results > a", - {"border-bottom-color": "rgba(170, 170, 170, 0.2)"} + {"border-bottom-color": "#aaa3"} ) // Checking the color of "keyword" text. assert-css: ( "//*[@class='result-name']//*[text()='(keyword)']", - {"color": "rgb(120, 135, 151)"}, + {"color": "#788797"}, ) -store-value: (entry_color, "rgb(0, 150, 207)") // color of the search entry -store-value: (hover_entry_color, "rgb(255, 255, 255)") // color of the hovered/focused search entry -store-value: (background_color, "rgba(0, 0, 0, 0)") // background color -store-value: (hover_background_color, "rgb(60, 60, 60)") // hover background color +store-value: (entry_color, "#0096cf") // color of the search entry +store-value: (hover_entry_color, "#fff") // color of the hovered/focused search entry +store-value: (background_color, "transparent") // background color +store-value: (hover_background_color, "#3c3c3c") // hover background color call-function: ( "check-result-color", ( "keyword", // item kind - "rgb(57, 175, 215)", // color of item kind - "rgb(57, 175, 215)", // color of hovered/focused item kind + "#39afd7", // color of item kind + "#39afd7", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "struct", // item kind - "rgb(255, 160, 165)", // color of item kind - "rgb(255, 160, 165)", // color of hovered/focused item kind + "#ffa0a5", // color of item kind + "#ffa0a5", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "associatedtype", // item kind - "rgb(57, 175, 215)", // color of item kind - "rgb(57, 175, 215)", // color of hovered/focused item kind + "#39afd7", // color of item kind + "#39afd7", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "tymethod", // item kind - "rgb(253, 214, 135)", // color of item kind - "rgb(253, 214, 135)", // color of hovered/focused item kind + "#fdd687", // color of item kind + "#fdd687", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "method", // item kind - "rgb(253, 214, 135)", // color of item kind - "rgb(253, 214, 135)", // color of hovered/focused item kind + "#fdd687", // color of item kind + "#fdd687", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "structfield", // item kind - "rgb(0, 150, 207)", // color of item kind - "rgb(255, 255, 255)", // color of hovered/focused item kind + "#0096cf", // color of item kind + "#fff", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "macro", // item kind - "rgb(163, 122, 204)", // color of item kind - "rgb(163, 122, 204)", // color of hovered/focused item kind + "#a37acc", // color of item kind + "#a37acc", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "fn", // item kind - "rgb(253, 214, 135)", // color of item kind - "rgb(253, 214, 135)", // color of hovered/focused item kind + "#fdd687", // color of item kind + "#fdd687", // color of hovered/focused item kind ), ) @@ -138,7 +138,7 @@ move-cursor-to: ".search-input" focus: ".search-input" // To ensure the `<a>` container isnt focus or hover. assert-css: ( "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a", - {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"}, + {"color": "#0096cf", "background-color": "transparent"}, ALL, ) @@ -146,11 +146,11 @@ assert-css: ( move-cursor-to: "//*[@class='desc'][text()='Just a normal struct.']" assert-css: ( "//*[@class='result-name']/*[text()='test_docs::']", - {"color": "rgb(255, 255, 255)"}, + {"color": "#fff"}, ) assert-css: ( "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a", - {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, + {"color": "#fff", "background-color": "rgb(60, 60, 60)"}, ) // Dark theme @@ -164,89 +164,89 @@ reload: wait-for: "#search-tabs" assert-css: ( "#search-tabs > button > .count", - {"color": "rgb(136, 136, 136)"}, + {"color": "#888"}, ALL, ) assert-css: ( "//*[@class='desc'][text()='Just a normal struct.']", - {"color": "rgb(221, 221, 221)"}, + {"color": "#ddd"}, ) assert-css: ( "//*[@class='result-name']/*[text()='test_docs::']", - {"color": "rgb(221, 221, 221)"}, + {"color": "#ddd"}, ) // Checking the color of the bottom border. assert-css: ( ".search-results > a", - {"border-bottom-color": "rgba(170, 170, 170, 0.2)"} + {"border-bottom-color": "#aaa3"} ) // Checking the color for "keyword" text. assert-css: ( "//*[@class='result-name']//*[text()='(keyword)']", - {"color": "rgb(221, 221, 221)"}, + {"color": "#ddd"}, ) -store-value: (entry_color, "rgb(221, 221, 221)") // color of the search entry -store-value: (hover_entry_color, "rgb(221, 221, 221)") // color of the hovered/focused search entry -store-value: (background_color, "rgba(0, 0, 0, 0)") // background color -store-value: (hover_background_color, "rgb(97, 97, 97)") // hover background color +store-value: (entry_color, "#ddd") // color of the search entry +store-value: (hover_entry_color, "#ddd") // color of the hovered/focused search entry +store-value: (background_color, "transparent") // background color +store-value: (hover_background_color, "#616161") // hover background color call-function: ( "check-result-color", ( "keyword", // item kind - "rgb(210, 153, 29)", // color of item kind - "rgb(210, 153, 29)", // color of hovered/focused item kind + "#d2991d", // color of item kind + "#d2991d", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "struct", // item kind - "rgb(45, 191, 184)", // color of item kind - "rgb(45, 191, 184)", // color of hovered/focused item kind + "#2dbfb8", // color of item kind + "#2dbfb8", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "associatedtype", // item kind - "rgb(210, 153, 29)", // color of item kind - "rgb(210, 153, 29)", // color of hovered/focused item kind + "#d2991d", // color of item kind + "#d2991d", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "tymethod", // item kind - "rgb(43, 171, 99)", // color of item kind - "rgb(43, 171, 99)", // color of hovered/focused item kind + "#2bab63", // color of item kind + "#2bab63", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "method", // item kind - "rgb(43, 171, 99)", // color of item kind - "rgb(43, 171, 99)", // color of hovered/focused item kind + "#2bab63", // color of item kind + "#2bab63", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "structfield", // item kind - "rgb(221, 221, 221)", // color of item kind - "rgb(221, 221, 221)", // color of hovered/focused item kind + "#ddd", // color of item kind + "#ddd", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "macro", // item kind - "rgb(9, 189, 0)", // color of item kind - "rgb(9, 189, 0)", // color of hovered/focused item kind + "#09bd00", // color of item kind + "#09bd00", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "fn", // item kind - "rgb(43, 171, 99)", // color of item kind - "rgb(43, 171, 99)", // color of hovered/focused item kind + "#2bab63", // color of item kind + "#2bab63", // color of hovered/focused item kind ), ) @@ -255,7 +255,7 @@ move-cursor-to: ".search-input" focus: ".search-input" // To ensure the `<a>` container isnt focus or hover. assert-css: ( "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a", - {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"}, + {"color": "#ddd", "background-color": "transparent"}, ) // Light theme @@ -266,89 +266,89 @@ reload: wait-for: "#search-tabs" assert-css: ( "#search-tabs > button > .count", - {"color": "rgb(136, 136, 136)"}, + {"color": "#888"}, ALL, ) assert-css: ( "//*[@class='desc'][text()='Just a normal struct.']", - {"color": "rgb(0, 0, 0)"}, + {"color": "#000"}, ) assert-css: ( "//*[@class='result-name']/*[text()='test_docs::']", - {"color": "rgb(0, 0, 0)"}, + {"color": "#000"}, ) // Checking the color of the bottom border. assert-css: ( ".search-results > a", - {"border-bottom-color": "rgba(170, 170, 170, 0.2)"} + {"border-bottom-color": "#aaa3"} ) // Checking the color for "keyword" text. assert-css: ( "//*[@class='result-name']//*[text()='(keyword)']", - {"color": "rgb(0, 0, 0)"}, + {"color": "#000"}, ) -store-value: (entry_color, "rgb(0, 0, 0)") // color of the search entry -store-value: (hover_entry_color, "rgb(0, 0, 0)") // color of the hovered/focused search entry -store-value: (background_color, "rgba(0, 0, 0, 0)") // background color -store-value: (hover_background_color, "rgb(204, 204, 204)") // hover background color +store-value: (entry_color, "#000") // color of the search entry +store-value: (hover_entry_color, "#000") // color of the hovered/focused search entry +store-value: (background_color, "transparent") // background color +store-value: (hover_background_color, "#ccc") // hover background color call-function: ( "check-result-color", ( "keyword", // item kind - "rgb(56, 115, 173)", // color of item kind - "rgb(56, 115, 173)", // color of hovered/focused item kind + "#3873ad", // color of item kind + "#3873ad", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "struct", // item kind - "rgb(173, 55, 138)", // color of item kind - "rgb(173, 55, 138)", // color of hovered/focused item kind + "#ad378a", // color of item kind + "#ad378a", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "associatedtype", // item kind - "rgb(56, 115, 173)", // color of item kind - "rgb(56, 115, 173)", // color of hovered/focused item kind + "#3873ad", // color of item kind + "#3873ad", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "tymethod", // item kind - "rgb(173, 124, 55)", // color of item kind - "rgb(173, 124, 55)", // color of hovered/focused item kind + "#ad7c37", // color of item kind + "#ad7c37", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "method", // item kind - "rgb(173, 124, 55)", // color of item kind - "rgb(173, 124, 55)", // color of hovered/focused item kind + "#ad7c37", // color of item kind + "#ad7c37", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "structfield", // item kind - "rgb(0, 0, 0)", // color of item kind - "rgb(0, 0, 0)", // color of hovered/focused item kind + "#000", // color of item kind + "#000", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "macro", // item kind - "rgb(6, 128, 0)", // color of item kind - "rgb(6, 128, 0)", // color of hovered/focused item kind + "#068000", // color of item kind + "#068000", // color of hovered/focused item kind ), ) call-function: ( "check-result-color", ( "fn", // item kind - "rgb(173, 124, 55)", // color of item kind - "rgb(173, 124, 55)", // color of hovered/focused item kind + "#ad7c37", // color of item kind + "#ad7c37", // color of hovered/focused item kind ), ) @@ -357,7 +357,7 @@ move-cursor-to: ".search-input" focus: ".search-input" // To ensure the `<a>` container isnt focus or hover. assert-css: ( "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a", - {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"}, + {"color": "#000", "background-color": "transparent"}, ) // Check the alias. @@ -386,16 +386,16 @@ define-function: ( call-function: ("check-alias", { "theme": "ayu", - "alias": "rgb(197, 197, 197)", - "grey": "rgb(153, 153, 153)", + "alias": "#c5c5c5", + "grey": "#999", }) call-function: ("check-alias", { "theme": "dark", - "alias": "rgb(255, 255, 255)", - "grey": "rgb(204, 204, 204)", + "alias": "#fff", + "grey": "#ccc", }) call-function: ("check-alias", { "theme": "light", - "alias": "rgb(0, 0, 0)", - "grey": "rgb(153, 153, 153)", + "alias": "#000", + "grey": "#999", }) diff --git a/tests/rustdoc-gui/search-result-display.goml b/tests/rustdoc-gui/search-result-display.goml index 93c71f23f..ee5598e4b 100644 --- a/tests/rustdoc-gui/search-result-display.goml +++ b/tests/rustdoc-gui/search-result-display.goml @@ -32,8 +32,8 @@ set-text: ( ) // Then we compare again to confirm the height didn't change. -assert-css: ("#crate-search", {"width": "527px"}) -assert-css: (".search-results-title", {"height": "50px", "width": "640px"}) +assert-size: ("#crate-search", {"width": 527}) +assert-size: (".search-results-title", {"height": 50, "width": 640}) // And we check that the `<select>` isn't bigger than its container (".search-results-title"). assert-css: ("#search", {"width": "640px"}) diff --git a/tests/rustdoc-gui/settings.goml b/tests/rustdoc-gui/settings.goml index 733be9beb..c37d96932 100644 --- a/tests/rustdoc-gui/settings.goml +++ b/tests/rustdoc-gui/settings.goml @@ -10,7 +10,7 @@ wait-for: "#settings" assert-css: ("#settings", {"display": "block"}) // Store the line margin to compare with the settings.html later. -store-css: (setting_line_margin, ".setting-line", "margin") +store-css: (".setting-line", {"margin": setting_line_margin}) // Let's close it by clicking on the same button. click: "#settings-menu" @@ -256,6 +256,15 @@ set-local-storage: {"rustdoc-disable-shortcuts": "false"} click: ".setting-line:last-child .setting-check span" assert-local-storage: {"rustdoc-disable-shortcuts": "true"} +// We now check that focusing a toggle and pressing Space is like clicking on it. +assert-local-storage: {"rustdoc-disable-shortcuts": "true"} +focus: ".setting-line:last-child .setting-check input" +press-key: "Space" +assert-local-storage: {"rustdoc-disable-shortcuts": "false"} +focus: ".setting-line:last-child .setting-check input" +press-key: "Space" +assert-local-storage: {"rustdoc-disable-shortcuts": "true"} + // Make sure that "Disable keyboard shortcuts" actually took effect. press-key: "Escape" press-key: "?" @@ -292,7 +301,7 @@ wait-for-css: ("#help-button .popover", {"display": "block"}) // Now we go to the settings page to check that the CSS is loaded as expected. go-to: "file://" + |DOC_PATH| + "/settings.html" wait-for: "#settings" -assert-css: (".setting-line", {"position": "relative"}) +assert-css: (".setting-radio", {"cursor": "pointer"}) assert-attribute-false: ("#settings", {"class": "popover"}, CONTAINS) compare-elements-position: (".sub form", "#settings", ("x")) @@ -313,4 +322,4 @@ reload: set-window-size: (300, 1000) click: "#settings-menu" wait-for: "#settings" -assert-css: (".setting-line", {"position": "relative"}) +assert-css: (".setting-radio", {"cursor": "pointer"}) diff --git a/tests/rustdoc-gui/sidebar-source-code-display.goml b/tests/rustdoc-gui/sidebar-source-code-display.goml index 20bf0596f..0c680bcc9 100644 --- a/tests/rustdoc-gui/sidebar-source-code-display.goml +++ b/tests/rustdoc-gui/sidebar-source-code-display.goml @@ -121,28 +121,28 @@ define-function: ( call-function: ("check-colors", { "theme": "light", - "color": "rgb(0, 0, 0)", - "color_hover": "rgb(0, 0, 0)", - "background": "rgb(255, 255, 255)", - "background_hover": "rgb(224, 224, 224)", + "color": "black", + "color_hover": "#000", + "background": "#fff", + "background_hover": "#e0e0e0", "background_toggle": "rgba(0, 0, 0, 0)", - "background_toggle_hover": "rgb(224, 224, 224)", + "background_toggle_hover": "#e0e0e0", }) call-function: ("check-colors", { "theme": "dark", - "color": "rgb(221, 221, 221)", - "color_hover": "rgb(221, 221, 221)", - "background": "rgb(51, 51, 51)", - "background_hover": "rgb(68, 68, 68)", + "color": "#ddd", + "color_hover": "#ddd", + "background": "#333", + "background_hover": "#444", "background_toggle": "rgba(0, 0, 0, 0)", - "background_toggle_hover": "rgb(103, 103, 103)", + "background_toggle_hover": "#676767", }) call-function: ("check-colors", { "theme": "ayu", - "color": "rgb(197, 197, 197)", - "color_hover": "rgb(255, 180, 76)", + "color": "#c5c5c5", + "color_hover": "#ffb44c", "background": "rgb(20, 25, 31)", - "background_hover": "rgb(20, 25, 31)", + "background_hover": "#14191f", "background_toggle": "rgba(0, 0, 0, 0)", "background_toggle_hover": "rgba(70, 70, 70, 0.33)", }) diff --git a/tests/rustdoc-gui/sidebar.goml b/tests/rustdoc-gui/sidebar.goml index 3c1ed009a..574cc629a 100644 --- a/tests/rustdoc-gui/sidebar.goml +++ b/tests/rustdoc-gui/sidebar.goml @@ -152,14 +152,16 @@ assert-property: (".sidebar", {"clientWidth": "200"}) // Checks that all.html and index.html have their sidebar link in the same place. go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" -store-property: (index_sidebar_width, ".sidebar .location a", "clientWidth") -store-property: (index_sidebar_height, ".sidebar .location a", "clientHeight") -store-property: (index_sidebar_x, ".sidebar .location a", "offsetTop") -store-property: (index_sidebar_y, ".sidebar .location a", "offsetLeft") +store-property: (".sidebar .location a", { + "clientWidth": index_sidebar_width, + "clientHeight": index_sidebar_height, + "offsetTop": index_sidebar_y, + "offsetLeft": index_sidebar_x, +}) go-to: "file://" + |DOC_PATH| + "/test_docs/all.html" assert-property: (".sidebar .location a", { "clientWidth": |index_sidebar_width|, "clientHeight": |index_sidebar_height|, - "offsetTop": |index_sidebar_x|, - "offsetLeft": |index_sidebar_y|, + "offsetTop": |index_sidebar_y|, + "offsetLeft": |index_sidebar_x|, }) diff --git a/tests/rustdoc-gui/source-anchor-scroll.goml b/tests/rustdoc-gui/source-anchor-scroll.goml index 3d88d5619..67f1497e7 100644 --- a/tests/rustdoc-gui/source-anchor-scroll.goml +++ b/tests/rustdoc-gui/source-anchor-scroll.goml @@ -8,13 +8,13 @@ set-window-size: (600, 800) assert-property: ("html", {"scrollTop": "0"}) click: '//a[text() = "barbar"]' -assert-property: ("html", {"scrollTop": "125"}) +assert-property: ("html", {"scrollTop": "149"}) click: '//a[text() = "bar"]' -assert-property: ("html", {"scrollTop": "156"}) +assert-property: ("html", {"scrollTop": "180"}) click: '//a[text() = "sub_fn"]' -assert-property: ("html", {"scrollTop": "53"}) +assert-property: ("html", {"scrollTop": "77"}) // We now check that clicking on lines doesn't change the scroll // Extra information: the "sub_fn" function header is on line 1. click: '//*[@id="6"]' -assert-property: ("html", {"scrollTop": "53"}) +assert-property: ("html", {"scrollTop": "77"}) diff --git a/tests/rustdoc-gui/source-code-page.goml b/tests/rustdoc-gui/source-code-page.goml index 42f3200e9..d5dd511b1 100644 --- a/tests/rustdoc-gui/source-code-page.goml +++ b/tests/rustdoc-gui/source-code-page.goml @@ -40,24 +40,24 @@ define-function: ( call-function: ("check-colors", { "theme": "ayu", - "color": "rgb(92, 103, 115)", - "background_color": "rgba(0, 0, 0, 0)", - "highlight_color": "rgb(112, 128, 144)", + "color": "#5c6773", + "background_color": "transparent", + "highlight_color": "#708090", "highlight_background_color": "rgba(255, 236, 164, 0.06)", }) call-function: ("check-colors", { "theme": "dark", - "color": "rgb(59, 145, 226)", - "background_color": "rgba(0, 0, 0, 0)", - "highlight_color": "rgb(59, 145, 226)", - "highlight_background_color": "rgb(10, 4, 47)", + "color": "#3b91e2", + "background_color": "transparent", + "highlight_color": "#3b91e2", + "highlight_background_color": "#0a042f", }) call-function: ("check-colors", { "theme": "light", - "color": "rgb(198, 126, 45)", - "background_color": "rgba(0, 0, 0, 0)", - "highlight_color": "rgb(198, 126, 45)", - "highlight_background_color": "rgb(253, 255, 211)", + "color": "#c67e2d", + "background_color": "transparent", + "highlight_color": "#c67e2d", + "highlight_background_color": "#fdffd3", }) // This is to ensure that the content is correctly align with the line numbers. @@ -117,9 +117,8 @@ assert-property: ("#source-sidebar details:first-of-type", {"open": "true"}) // Check the sidebar directory entries have a marker and spacing (desktop). store-property: ( - link_height, "#source-sidebar > details:first-of-type.dir-entry[open] > .files > a", - "offsetHeight" + {"offsetHeight": link_height}, ) define-function: ( "check-sidebar-dir-entry", @@ -147,16 +146,10 @@ define-function: ( ) } ) -store-property: ( - source_sidebar_title_height, - "#source-sidebar > .title", - "offsetHeight" -) -store-property: ( - source_sidebar_title_y, - "#source-sidebar > .title", - "offsetTop" -) +store-property: ("#source-sidebar > .title", { + "offsetHeight": source_sidebar_title_height, + "offsetTop": source_sidebar_title_y, +}) call-function: ("check-sidebar-dir-entry", { "x": 0, // border + margin = 6 @@ -182,16 +175,10 @@ assert-property: ("#main-content", {"offsetTop": 76}) // 21 = 76 - 34 - 21 // Check the sidebar directory entries have a marker and spacing (tablet). -store-property: ( - source_sidebar_title_height, - "#source-sidebar > .title", - "offsetHeight" -) -store-property: ( - source_sidebar_title_y, - "#source-sidebar > .title", - "offsetTop" -) +store-property: ("#source-sidebar > .title", { + "offsetHeight": source_sidebar_title_height, + "offsetTop": source_sidebar_title_y, +}) call-function: ("check-sidebar-dir-entry", { "x": 0, "y": |source_sidebar_title_y| + |source_sidebar_title_height| + 6, @@ -202,16 +189,10 @@ set-window-size: (450, 700) assert-css: ("nav.sub", {"flex-direction": "column"}) // Check the sidebar directory entries have a marker and spacing (phone). -store-property: ( - source_sidebar_title_height, - "#source-sidebar > .title", - "offsetHeight" -) -store-property: ( - source_sidebar_title_y, - "#source-sidebar > .title", - "offsetTop" -) +store-property: ("#source-sidebar > .title", { + "offsetHeight": source_sidebar_title_height, + "offsetTop": source_sidebar_title_y, +}) call-function: ("check-sidebar-dir-entry", { "x": 0, "y": |source_sidebar_title_y| + |source_sidebar_title_height| + 6, @@ -219,5 +200,5 @@ call-function: ("check-sidebar-dir-entry", { // Now we check that the logo has a bottom margin so it's not stuck to the search input. assert-css: (".sub-logo-container > img", {"margin-bottom": "8px"}) -store-property: (logo_height, ".sub-logo-container", "clientHeight") +store-property: (".sub-logo-container", {"clientHeight": logo_height}) assert-position: (".search-form", {"y": |logo_height| + 8}) diff --git a/tests/rustdoc-gui/src-font-size.goml b/tests/rustdoc-gui/src-font-size.goml index 790aeba52..ff30bcdf2 100644 --- a/tests/rustdoc-gui/src-font-size.goml +++ b/tests/rustdoc-gui/src-font-size.goml @@ -11,6 +11,6 @@ assert-css: (".impl-items .srclink", {"font-size": "16px", "font-weight": 400}, assert-css: (".impl-items .code-header", {"font-size": "16px", "font-weight": 600}, ALL) // Check that we can click on source link -store-document-property: (url, "URL") +store-document-property: {"URL": url} click: ".impl-items .srclink" assert-document-property-false: {"URL": |url|} diff --git a/tests/rustdoc-gui/src/extend_css/lib.rs b/tests/rustdoc-gui/src/extend_css/lib.rs index 3a3babf89..2308c0932 100644 --- a/tests/rustdoc-gui/src/extend_css/lib.rs +++ b/tests/rustdoc-gui/src/extend_css/lib.rs @@ -1 +1,2 @@ +// compile-flags: --extend-css extra.css //! <div class="extend">text in red</div> diff --git a/tests/rustdoc-gui/src/link_to_definition/lib.rs b/tests/rustdoc-gui/src/link_to_definition/lib.rs index 419a9ccee..6fed79aed 100644 --- a/tests/rustdoc-gui/src/link_to_definition/lib.rs +++ b/tests/rustdoc-gui/src/link_to_definition/lib.rs @@ -1,3 +1,4 @@ +// compile-flags: -Zunstable-options --generate-link-to-definition pub fn sub_fn() { barbar(); } diff --git a/tests/rustdoc-gui/src/scrape_examples/src/lib.rs b/tests/rustdoc-gui/src/scrape_examples/src/lib.rs index 88b03cf26..6666587ad 100644 --- a/tests/rustdoc-gui/src/scrape_examples/src/lib.rs +++ b/tests/rustdoc-gui/src/scrape_examples/src/lib.rs @@ -1,3 +1,4 @@ +// run-flags:-Zrustdoc-scrape-examples /// # Examples /// /// ``` diff --git a/tests/rustdoc-gui/stab-badge.goml b/tests/rustdoc-gui/stab-badge.goml index e23404188..bb3d2aaa3 100644 --- a/tests/rustdoc-gui/stab-badge.goml +++ b/tests/rustdoc-gui/stab-badge.goml @@ -26,16 +26,16 @@ define-function: ( call-function: ("check-badge", { "theme": "ayu", - "color": "rgb(197, 197, 197)", - "background": "rgb(49, 69, 89)", + "color": "#c5c5c5", + "background": "#314559", }) call-function: ("check-badge", { "theme": "dark", - "color": "rgb(221, 221, 221)", - "background": "rgb(49, 69, 89)", + "color": "#ddd", + "background": "#314559", }) call-function: ("check-badge", { "theme": "light", - "color": "rgb(0, 0, 0)", - "background": "rgb(255, 245, 214)", + "color": "black", + "background": "#fff5d6", }) diff --git a/tests/rustdoc-gui/struct-fields.goml b/tests/rustdoc-gui/struct-fields.goml index da0467de1..3c87a4cd6 100644 --- a/tests/rustdoc-gui/struct-fields.goml +++ b/tests/rustdoc-gui/struct-fields.goml @@ -1,5 +1,5 @@ // This test ensures that each field is on its own line (In other words, they have display: block). go-to: "file://" + |DOC_PATH| + "/test_docs/struct.StructWithPublicUndocumentedFields.html" -store-property: (first_top, "//*[@id='structfield.first']", "offsetTop") +store-property: ("//*[@id='structfield.first']", {"offsetTop": first_top}) assert-property-false: ("//*[@id='structfield.second']", { "offsetTop": |first_top| }) diff --git a/tests/rustdoc-gui/type-declation-overflow.goml b/tests/rustdoc-gui/type-declation-overflow.goml index e8e42e400..f212781e9 100644 --- a/tests/rustdoc-gui/type-declation-overflow.goml +++ b/tests/rustdoc-gui/type-declation-overflow.goml @@ -39,7 +39,7 @@ assert-property: ("pre.item-decl", {"scrollWidth": "950"}) set-window-size: (600, 600) go-to: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html" // It shouldn't have an overflow in the topbar either. -store-property: (scrollWidth, ".mobile-topbar h2", "scrollWidth") +store-property: (".mobile-topbar h2", {"scrollWidth": scrollWidth}) assert-property: (".mobile-topbar h2", {"clientWidth": |scrollWidth|}) assert-css: (".mobile-topbar h2", {"overflow-x": "hidden"}) |