diff options
Diffstat (limited to 'tests/rustdoc-gui')
| -rw-r--r-- | tests/rustdoc-gui/anchors.goml | 22 | ||||
| -rw-r--r-- | tests/rustdoc-gui/basic-code.goml | 2 | ||||
| -rw-r--r-- | tests/rustdoc-gui/code-sidebar-toggle.goml | 4 | ||||
| -rw-r--r-- | tests/rustdoc-gui/headings.goml | 20 | ||||
| -rw-r--r-- | tests/rustdoc-gui/jump-to-def-background.goml | 4 | ||||
| -rw-r--r-- | tests/rustdoc-gui/sidebar-source-code-display.goml | 40 | ||||
| -rw-r--r-- | tests/rustdoc-gui/sidebar-source-code.goml | 14 | ||||
| -rw-r--r-- | tests/rustdoc-gui/source-code-page.goml | 36 | ||||
| -rw-r--r-- | tests/rustdoc-gui/src-font-size.goml | 6 |
9 files changed, 74 insertions, 74 deletions
diff --git a/tests/rustdoc-gui/anchors.goml b/tests/rustdoc-gui/anchors.goml index e9b77296917..30b83f0da38 100644 --- a/tests/rustdoc-gui/anchors.goml +++ b/tests/rustdoc-gui/anchors.goml @@ -17,34 +17,34 @@ define-function: ( assert-css: (".main-heading h1 a:nth-of-type(1)", {"color": |main_heading_color|}) assert-css: (".main-heading a:nth-of-type(2)", {"color": |main_heading_type_color|}) assert-css: ( - ".rightside .srclink", + ".rightside a.src", {"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|}, ALL, ) compare-elements-css: ( - ".rightside .srclink", - ".rightside.srclink", + ".rightside a.src", + "a.rightside.src", ["color", "text-decoration"], ) compare-elements-css: ( - ".main-heading .srclink", - ".rightside.srclink", + ".main-heading a.src", + "a.rightside.src", ["color", "text-decoration"], ) - move-cursor-to: ".main-heading .srclink" + move-cursor-to: ".main-heading a.src" assert-css: ( - ".main-heading .srclink", + ".main-heading a.src", {"color": |src_link_color|, "text-decoration": "underline solid " + |src_link_color|}, ) - move-cursor-to: ".impl-items .rightside .srclink" + move-cursor-to: ".impl-items .rightside a.src" assert-css: ( - ".impl-items .rightside .srclink", + ".impl-items .rightside a.src", {"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|}, ) - move-cursor-to: ".impl-items .rightside.srclink" + move-cursor-to: ".impl-items a.rightside.src" assert-css: ( - ".impl-items .rightside.srclink", + ".impl-items a.rightside.src", {"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|}, ) diff --git a/tests/rustdoc-gui/basic-code.goml b/tests/rustdoc-gui/basic-code.goml index e372f711974..22ac5316184 100644 --- a/tests/rustdoc-gui/basic-code.goml +++ b/tests/rustdoc-gui/basic-code.goml @@ -1,6 +1,6 @@ // Small test to ensure the "src-line-numbers" element is only present once on // the page. go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" -click: ".srclink" +click: "a.src" wait-for: ".src-line-numbers" assert-count: (".src-line-numbers", 1) diff --git a/tests/rustdoc-gui/code-sidebar-toggle.goml b/tests/rustdoc-gui/code-sidebar-toggle.goml index 28c3712f307..d1efa45dc1d 100644 --- a/tests/rustdoc-gui/code-sidebar-toggle.goml +++ b/tests/rustdoc-gui/code-sidebar-toggle.goml @@ -1,7 +1,7 @@ // This test checks that the source code pages sidebar toggle is working as expected. go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" -click: ".srclink" +click: "a.src" wait-for: "#src-sidebar-toggle" click: "#src-sidebar-toggle" expect-failure: true -assert-css: ("#source-sidebar", { "left": "-300px" }) +assert-css: ("#src-sidebar", { "left": "-300px" }) diff --git a/tests/rustdoc-gui/headings.goml b/tests/rustdoc-gui/headings.goml index 089e2203a04..102b699b1dd 100644 --- a/tests/rustdoc-gui/headings.goml +++ b/tests/rustdoc-gui/headings.goml @@ -194,27 +194,27 @@ call-function: ( "check-colors", { "theme": "ayu", - "heading_color": "rgb(255, 255, 255)", - "small_heading_color": "rgb(197, 197, 197)", - "heading_border_color": "rgb(92, 103, 115)", + "heading_color": "#fff", + "small_heading_color": "#c5c5c5", + "heading_border_color": "#5c6773", }, ) call-function: ( "check-colors", { "theme": "dark", - "heading_color": "rgb(221, 221, 221)", - "small_heading_color": "rgb(221, 221, 221)", - "heading_border_color": "rgb(210, 210, 210)", + "heading_color": "#ddd", + "small_heading_color": "#ddd", + "heading_border_color": "#d2d2d2", }, ) call-function: ( "check-colors", { "theme": "light", - "heading_color": "rgb(0, 0, 0)", - "small_heading_color": "rgb(0, 0, 0)", - "heading_border_color": "rgb(221, 221, 221)", + "heading_color": "black", + "small_heading_color": "black", + "heading_border_color": "#ddd", }, ) @@ -224,7 +224,7 @@ define-function: ( block { set-local-storage: {"rustdoc-theme": |theme|} reload: - assert-css: (".since", {"color": "rgb(128, 128, 128)"}, ALL) + assert-css: (".since", {"color": "#808080"}, ALL) }, ) diff --git a/tests/rustdoc-gui/jump-to-def-background.goml b/tests/rustdoc-gui/jump-to-def-background.goml index 6adc36b0edb..fa7ed3586dd 100644 --- a/tests/rustdoc-gui/jump-to-def-background.goml +++ b/tests/rustdoc-gui/jump-to-def-background.goml @@ -1,4 +1,4 @@ -// We check the background color on the jump to definition links in the source code page. +// We check the background color on the jump to definition links in the src code page. go-to: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html" define-function: ( @@ -10,7 +10,7 @@ define-function: ( // We reload the page so the local storage settings are being used. reload: assert-css: ( - "body.source .example-wrap pre.rust a", + "body.src .example-wrap pre.rust a", {"background-color": |background_color|}, ALL, ) diff --git a/tests/rustdoc-gui/sidebar-source-code-display.goml b/tests/rustdoc-gui/sidebar-source-code-display.goml index 0c680bcc9fb..33210c9fdc9 100644 --- a/tests/rustdoc-gui/sidebar-source-code-display.goml +++ b/tests/rustdoc-gui/sidebar-source-code-display.goml @@ -40,7 +40,7 @@ define-function: ( reload: wait-for-css: ("#src-sidebar-toggle", {"visibility": "visible"}) assert-css: ( - "#source-sidebar details[open] > .files a.selected", + "#src-sidebar details[open] > .files a.selected", {"color": |color_hover|, "background-color": |background|}, ) @@ -62,58 +62,58 @@ define-function: ( // Without hover or focus. assert-css: ( - "#source-sidebar details[open] > .files a:not(.selected)", + "#src-sidebar details[open] > .files a:not(.selected)", {"color": |color|, "background-color": |background_toggle|}, ) // With focus. - focus: "#source-sidebar details[open] > .files a:not(.selected)" + focus: "#src-sidebar details[open] > .files a:not(.selected)" wait-for-css: ( - "#source-sidebar details[open] > .files a:not(.selected):focus", + "#src-sidebar details[open] > .files a:not(.selected):focus", {"color": |color_hover|, "background-color": |background_hover|}, ) focus: ".search-input" // With hover. - move-cursor-to: "#source-sidebar details[open] > .files a:not(.selected)" + move-cursor-to: "#src-sidebar details[open] > .files a:not(.selected)" assert-css: ( - "#source-sidebar details[open] > .files a:not(.selected):hover", + "#src-sidebar details[open] > .files a:not(.selected):hover", {"color": |color_hover|, "background-color": |background_hover|}, ) // Without hover or focus. assert-css: ( - "#source-sidebar .dir-entry summary", + "#src-sidebar .dir-entry summary", {"color": |color|, "background-color": |background_toggle|}, ) // With focus. - focus: "#source-sidebar .dir-entry summary" + focus: "#src-sidebar .dir-entry summary" wait-for-css: ( - "#source-sidebar .dir-entry summary:focus", + "#src-sidebar .dir-entry summary:focus", {"color": |color_hover|, "background-color": |background_hover|}, ) focus: ".search-input" // With hover. - move-cursor-to: "#source-sidebar .dir-entry summary" + move-cursor-to: "#src-sidebar .dir-entry summary" assert-css: ( - "#source-sidebar .dir-entry summary:hover", + "#src-sidebar .dir-entry summary:hover", {"color": |color_hover|, "background-color": |background_hover|}, ) // Without hover or focus. assert-css: ( - "#source-sidebar details[open] > .folders > details > summary", + "#src-sidebar details[open] > .folders > details > summary", {"color": |color|, "background-color": |background_toggle|}, ) // With focus. - focus: "#source-sidebar details[open] > .folders > details > summary" + focus: "#src-sidebar details[open] > .folders > details > summary" wait-for-css: ( - "#source-sidebar details[open] > .folders > details > summary:focus", + "#src-sidebar details[open] > .folders > details > summary:focus", {"color": |color_hover|, "background-color": |background_hover|}, ) focus: ".search-input" // With hover. - move-cursor-to: "#source-sidebar details[open] > .folders > details > summary" + move-cursor-to: "#src-sidebar details[open] > .folders > details > summary" assert-css: ( - "#source-sidebar details[open] > .folders > details > summary:hover", + "#src-sidebar details[open] > .folders > details > summary:hover", {"color": |color_hover|, "background-color": |background_hover|}, ) }, @@ -190,16 +190,16 @@ assert-window-property: {"pageYOffset": "2542"} // make it the current selection. set-window-size: (500, 700) click: "#src-sidebar-toggle" -wait-for-css: ("#source-sidebar", {"visibility": "visible"}) +wait-for-css: ("#src-sidebar", {"visibility": "visible"}) assert-local-storage: {"rustdoc-source-sidebar-show": "true"} click: ".sidebar a.selected" go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" -wait-for-css: ("#source-sidebar", {"visibility": "hidden"}) +wait-for-css: ("#src-sidebar", {"visibility": "hidden"}) assert-local-storage: {"rustdoc-source-sidebar-show": "false"} // Resize back to desktop size, to check that the sidebar doesn't spontaneously open. set-window-size: (1000, 1000) -wait-for-css: ("#source-sidebar", {"visibility": "hidden"}) +wait-for-css: ("#src-sidebar", {"visibility": "hidden"}) assert-local-storage: {"rustdoc-source-sidebar-show": "false"} click: "#src-sidebar-toggle" -wait-for-css: ("#source-sidebar", {"visibility": "visible"}) +wait-for-css: ("#src-sidebar", {"visibility": "visible"}) assert-local-storage: {"rustdoc-source-sidebar-show": "true"} diff --git a/tests/rustdoc-gui/sidebar-source-code.goml b/tests/rustdoc-gui/sidebar-source-code.goml index 2cb88817884..69c589741cb 100644 --- a/tests/rustdoc-gui/sidebar-source-code.goml +++ b/tests/rustdoc-gui/sidebar-source-code.goml @@ -14,7 +14,7 @@ define-function: ( } reload: // Checking results colors. - assert-css: (".source .sidebar", { + assert-css: (".src .sidebar", { "color": |color|, "background-color": |background_color| }, ALL) @@ -53,8 +53,8 @@ assert-css: ("nav.sidebar", {"width": "50px"}) // We now click on the button to expand the sidebar. click: (10, 10) // We wait for the sidebar to be expanded. -wait-for-css: (".source-sidebar-expanded nav.sidebar", {"width": "300px"}) -assert-css: (".source-sidebar-expanded nav.sidebar a", {"font-size": "14px"}) +wait-for-css: (".src-sidebar-expanded nav.sidebar", {"width": "300px"}) +assert-css: (".src-sidebar-expanded nav.sidebar a", {"font-size": "14px"}) // We collapse the sidebar. click: (10, 10) // We ensure that the class has been removed. @@ -66,24 +66,24 @@ go-to: "file://" + |DOC_PATH| + "/src/lib2/another_folder/sub_mod/mod.rs.html" // First we expand the sidebar again. click: (10, 10) // We wait for the sidebar to be expanded. -wait-for-css: (".source-sidebar-expanded nav.sidebar", {"width": "300px"}) +wait-for-css: (".src-sidebar-expanded nav.sidebar", {"width": "300px"}) assert: "//*[@class='dir-entry' and @open]/*[text()='lib2']" assert: "//*[@class='dir-entry' and @open]/*[text()='another_folder']" assert: "//*[@class='dir-entry' and @open]/*[text()='sub_mod']" // Only "another_folder" should be "open" in "lib2". assert: "//*[@class='dir-entry' and not(@open)]/*[text()='another_mod']" // All other trees should be collapsed. -assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 9) +assert-count: ("//*[@id='src-sidebar']/details[not(text()='lib2') and not(@open)]", 9) // We now switch to mobile mode. set-window-size: (600, 600) -wait-for-css: (".source-sidebar-expanded nav.sidebar", {"left": "0px"}) +wait-for-css: (".src-sidebar-expanded nav.sidebar", {"left": "0px"}) // We collapse the sidebar. click: (10, 10) // We check that the sidebar has been moved off-screen. assert-css: ("nav.sidebar", {"left": "-1000px"}) // We ensure that the class has been removed. -assert-false: ".source-sidebar-expanded" +assert-false: ".src-sidebar-expanded" assert: "nav.sidebar" // Check that the topbar is not visible diff --git a/tests/rustdoc-gui/source-code-page.goml b/tests/rustdoc-gui/source-code-page.goml index f8f73398d9b..f19e3ce80e1 100644 --- a/tests/rustdoc-gui/source-code-page.goml +++ b/tests/rustdoc-gui/source-code-page.goml @@ -98,26 +98,26 @@ assert-document-property: ({"URL": "/lib.rs.html"}, ENDS_WITH) // First we "open" it. click: "#src-sidebar-toggle" -assert: ".source-sidebar-expanded" +assert: ".src-sidebar-expanded" // We check that the first entry of the sidebar is collapsed -assert-property: ("#source-sidebar details:first-of-type", {"open": "false"}) -assert-text: ("#source-sidebar details:first-of-type > summary", "extend_css") +assert-property: ("#src-sidebar details:first-of-type", {"open": "false"}) +assert-text: ("#src-sidebar details:first-of-type > summary", "extend_css") // We now click on it. -click: "#source-sidebar details:first-of-type > summary" -assert-property: ("#source-sidebar details:first-of-type", {"open": "true"}) +click: "#src-sidebar details:first-of-type > summary" +assert-property: ("#src-sidebar details:first-of-type", {"open": "true"}) // And now we collapse it again. -click: "#source-sidebar details:first-of-type > summary" -assert-property: ("#source-sidebar details:first-of-type", {"open": "false"}) +click: "#src-sidebar details:first-of-type > summary" +assert-property: ("#src-sidebar details:first-of-type", {"open": "false"}) // And open it again, since it'll be the reference we use to check positions. -click: "#source-sidebar details:first-of-type > summary" -assert-property: ("#source-sidebar details:first-of-type", {"open": "true"}) +click: "#src-sidebar details:first-of-type > summary" +assert-property: ("#src-sidebar details:first-of-type", {"open": "true"}) // Check the sidebar directory entries have a marker and spacing (desktop). store-property: ( - "#source-sidebar > details:first-of-type.dir-entry[open] > .files > a", + "#src-sidebar > details:first-of-type.dir-entry[open] > .files > a", {"offsetHeight": link_height}, ) define-function: ( @@ -125,28 +125,28 @@ define-function: ( (x, y), block { assert: "details:first-of-type.dir-entry[open] > summary::marker" - assert-css: ("#source-sidebar > details:first-of-type.dir-entry", {"padding-left": "4px"}) + assert-css: ("#src-sidebar > details:first-of-type.dir-entry", {"padding-left": "4px"}) // This check ensures that the summary is only one line. assert-property: ( - "#source-sidebar > details:first-of-type.dir-entry[open] > summary", + "#src-sidebar > details:first-of-type.dir-entry[open] > summary", {"offsetHeight": |link_height|} ) assert-position: ( - "#source-sidebar > details:first-of-type.dir-entry[open] > summary", + "#src-sidebar > details:first-of-type.dir-entry[open] > summary", {"x": |x|, "y": |y|} ) assert-property: ( - "#source-sidebar > details:first-of-type.dir-entry[open] > .files > a", + "#src-sidebar > details:first-of-type.dir-entry[open] > .files > a", {"offsetHeight": |link_height|} ) assert-position: ( - "#source-sidebar > details:first-of-type.dir-entry[open] > .files > a", + "#src-sidebar > details:first-of-type.dir-entry[open] > .files > a", // left margin {"x": |x| + 27, "y": |y| + |link_height|} ) } ) -store-property: ("#source-sidebar > .title", { +store-property: ("#src-sidebar > .title", { "offsetHeight": source_sidebar_title_height, "offsetTop": source_sidebar_title_y, }) @@ -175,7 +175,7 @@ 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", { +store-property: ("#src-sidebar > .title", { "offsetHeight": source_sidebar_title_height, "offsetTop": source_sidebar_title_y, }) @@ -189,7 +189,7 @@ 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", { +store-property: ("#src-sidebar > .title", { "offsetHeight": source_sidebar_title_height, "offsetTop": source_sidebar_title_y, }) diff --git a/tests/rustdoc-gui/src-font-size.goml b/tests/rustdoc-gui/src-font-size.goml index ff30bcdf2a2..f23387d73d3 100644 --- a/tests/rustdoc-gui/src-font-size.goml +++ b/tests/rustdoc-gui/src-font-size.goml @@ -4,13 +4,13 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" show-text: true // Check the impl headers. -assert-css: (".impl .srclink", {"font-size": "16px", "font-weight": 400}, ALL) +assert-css: (".impl a.src", {"font-size": "16px", "font-weight": 400}, ALL) assert-css: (".impl .code-header", {"font-size": "18px", "font-weight": 600}, ALL) // Check the impl items. -assert-css: (".impl-items .srclink", {"font-size": "16px", "font-weight": 400}, ALL) +assert-css: (".impl-items a.src", {"font-size": "16px", "font-weight": 400}, ALL) 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} -click: ".impl-items .srclink" +click: ".impl-items a.src" assert-document-property-false: {"URL": |url|} |
