From 010fa00b80474648268af58dd2edecbf454a9e55 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 11 Apr 2023 19:11:34 +0200 Subject: [PATCH] Update rustdoc GUI tests to new browser-ui-test version --- tests/rustdoc-gui/anchor-navigable.goml | 2 +- tests/rustdoc-gui/anchors.goml | 8 ++--- tests/rustdoc-gui/basic-code.goml | 2 +- .../rustdoc-gui/check-code-blocks-margin.goml | 2 +- tests/rustdoc-gui/check-stab-in-docblock.goml | 4 +-- .../rustdoc-gui/check_info_sign_position.goml | 4 +-- tests/rustdoc-gui/code-blocks-overflow.goml | 4 +-- tests/rustdoc-gui/code-color.goml | 4 +-- tests/rustdoc-gui/code-sidebar-toggle.goml | 4 +-- tests/rustdoc-gui/code-tags.goml | 12 ++++---- tests/rustdoc-gui/codeblock-sub.goml | 2 +- tests/rustdoc-gui/codeblock-tooltip.goml | 4 +-- tests/rustdoc-gui/cursor.goml | 6 ++-- tests/rustdoc-gui/default-settings.goml | 2 +- .../rustdoc-gui/docblock-big-code-mobile.goml | 4 +-- .../docblock-code-block-line-number.goml | 4 +-- tests/rustdoc-gui/docblock-details.goml | 4 +-- .../rustdoc-gui/docblock-table-overflow.goml | 4 +-- tests/rustdoc-gui/docblock-table.goml | 4 +-- .../rustdoc-gui/duplicate-macro-reexport.goml | 2 +- tests/rustdoc-gui/enum-variants.goml | 2 +- tests/rustdoc-gui/escape-key.goml | 2 +- tests/rustdoc-gui/font-weight.goml | 8 ++--- tests/rustdoc-gui/go-to-collapsed-elem.goml | 14 ++++----- tests/rustdoc-gui/hash-item-expansion.goml | 2 +- tests/rustdoc-gui/headers-color.goml | 12 ++++---- tests/rustdoc-gui/headings.goml | 16 +++++----- tests/rustdoc-gui/help-page.goml | 16 +++++----- tests/rustdoc-gui/highlight-colors.goml | 4 +-- .../huge-collection-of-constants.goml | 2 +- tests/rustdoc-gui/huge-logo.goml | 12 ++++---- tests/rustdoc-gui/impl-default-expansion.goml | 2 +- tests/rustdoc-gui/impl-doc.goml | 2 +- tests/rustdoc-gui/implementors.goml | 10 +++---- tests/rustdoc-gui/item-decl-colors.goml | 6 ++-- tests/rustdoc-gui/item-info-alignment.goml | 6 ++-- tests/rustdoc-gui/item-info-overflow.goml | 6 ++-- tests/rustdoc-gui/item-info.goml | 6 ++-- tests/rustdoc-gui/item-summary-table.goml | 2 +- tests/rustdoc-gui/javascript-disabled.goml | 2 +- tests/rustdoc-gui/jump-to-def-background.goml | 4 +-- tests/rustdoc-gui/label-next-to-symbol.goml | 6 ++-- tests/rustdoc-gui/links-color.goml | 4 +-- tests/rustdoc-gui/list_code_block.goml | 4 +-- tests/rustdoc-gui/method-margins.goml | 2 +- tests/rustdoc-gui/mobile.goml | 12 ++++---- tests/rustdoc-gui/module-items-font.goml | 2 +- tests/rustdoc-gui/no-docblock.goml | 4 +-- tests/rustdoc-gui/notable-trait.goml | 18 +++++------ .../overflow-tooltip-information.goml | 2 +- tests/rustdoc-gui/pocket-menu.goml | 10 +++---- tests/rustdoc-gui/run-on-hover.goml | 4 +-- tests/rustdoc-gui/rust-logo.goml | 14 ++++----- .../scrape-examples-button-focus.goml | 2 +- tests/rustdoc-gui/scrape-examples-color.goml | 8 ++--- tests/rustdoc-gui/scrape-examples-fonts.goml | 2 +- tests/rustdoc-gui/scrape-examples-layout.goml | 4 +-- tests/rustdoc-gui/scrape-examples-toggle.goml | 4 +-- tests/rustdoc-gui/search-error.goml | 4 +-- tests/rustdoc-gui/search-filter.goml | 8 ++--- tests/rustdoc-gui/search-form-elements.goml | 8 ++--- tests/rustdoc-gui/search-input-mobile.goml | 6 ++-- tests/rustdoc-gui/search-keyboard.goml | 2 +- tests/rustdoc-gui/search-no-result.goml | 4 +-- tests/rustdoc-gui/search-reexport.goml | 4 +-- tests/rustdoc-gui/search-result-color.goml | 12 ++++---- .../search-result-description.goml | 2 +- tests/rustdoc-gui/search-result-display.goml | 12 ++++---- .../search-result-go-to-first.goml | 6 ++-- tests/rustdoc-gui/search-result-keyword.goml | 2 +- .../search-tab-change-title-fn-sig.goml | 10 +++---- tests/rustdoc-gui/search-tab.goml | 4 +-- ...setting-auto-hide-content-large-items.goml | 2 +- .../setting-auto-hide-item-methods-docs.goml | 2 +- ...tting-auto-hide-trait-implementations.goml | 2 +- .../setting-go-to-only-result.goml | 10 +++---- tests/rustdoc-gui/settings.goml | 10 +++---- tests/rustdoc-gui/shortcuts.goml | 2 +- tests/rustdoc-gui/sidebar-links-color.goml | 4 +-- tests/rustdoc-gui/sidebar-macro-reexport.goml | 2 +- tests/rustdoc-gui/sidebar-mobile-scroll.goml | 6 ++-- tests/rustdoc-gui/sidebar-mobile.goml | 6 ++-- .../sidebar-source-code-display.goml | 18 +++++------ tests/rustdoc-gui/sidebar-source-code.goml | 10 +++---- tests/rustdoc-gui/sidebar.goml | 22 +++++++------- tests/rustdoc-gui/source-anchor-scroll.goml | 4 +-- .../source-code-page-code-scroll.goml | 4 +-- tests/rustdoc-gui/source-code-page.goml | 12 ++++---- tests/rustdoc-gui/src-font-size.goml | 2 +- tests/rustdoc-gui/stab-badge.goml | 8 ++--- tests/rustdoc-gui/struct-fields.goml | 2 +- tests/rustdoc-gui/target.goml | 4 +-- tests/rustdoc-gui/theme-change.goml | 8 ++--- tests/rustdoc-gui/theme-defaults.goml | 6 ++-- tests/rustdoc-gui/theme-in-history.goml | 6 ++-- tests/rustdoc-gui/toggle-click-deadspace.goml | 2 +- tests/rustdoc-gui/toggle-docs-mobile.goml | 6 ++-- tests/rustdoc-gui/toggle-docs.goml | 6 ++-- tests/rustdoc-gui/toggle-implementors.goml | 2 +- .../toggled-open-implementations.goml | 2 +- .../rustdoc-gui/trait-sidebar-item-order.goml | 2 +- .../rustdoc-gui/type-declation-overflow.goml | 30 +++++++++---------- tests/rustdoc-gui/unsafe-fn.goml | 4 +-- tests/rustdoc-gui/where-whitespace.goml | 6 ++-- 104 files changed, 308 insertions(+), 308 deletions(-) diff --git a/tests/rustdoc-gui/anchor-navigable.goml b/tests/rustdoc-gui/anchor-navigable.goml index 9d5c55a1e1d..61d7c89d434 100644 --- a/tests/rustdoc-gui/anchor-navigable.goml +++ b/tests/rustdoc-gui/anchor-navigable.goml @@ -4,7 +4,7 @@ // anchor and the `impl Foo`. If there were a gap, this would cause an annoying // problem: you hover `impl Foo` to see the anchor, then when you move your // mouse to the left, the anchor disappears before you reach it. -goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" // We check that ".item-info" is bigger than its content. move-cursor-to: ".impl" assert-property: (".impl > a.anchor", {"offsetWidth": "8"}) diff --git a/tests/rustdoc-gui/anchors.goml b/tests/rustdoc-gui/anchors.goml index 85cb7227420..0904aa90e1b 100644 --- a/tests/rustdoc-gui/anchors.goml +++ b/tests/rustdoc-gui/anchors.goml @@ -4,12 +4,12 @@ define-function: ( "check-colors", (theme, main_color, title_color, main_heading_color, main_heading_type_color, src_link_color, sidebar_link_color), block { - goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html" + go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html" // This is needed to ensure that the text color is computed. show-text: true // Setting the theme. - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} // We reload the page so the local storage settings are being used. reload: @@ -48,9 +48,9 @@ define-function: ( {"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|}, ) - goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" + go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" // Since we changed page, we need to set the theme again. - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} // We reload the page so the local storage settings are being used. reload: diff --git a/tests/rustdoc-gui/basic-code.goml b/tests/rustdoc-gui/basic-code.goml index 971c2f9480e..e372f711974 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. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" click: ".srclink" wait-for: ".src-line-numbers" assert-count: (".src-line-numbers", 1) diff --git a/tests/rustdoc-gui/check-code-blocks-margin.goml b/tests/rustdoc-gui/check-code-blocks-margin.goml index c2cec00204d..8c2cbc4d90e 100644 --- a/tests/rustdoc-gui/check-code-blocks-margin.goml +++ b/tests/rustdoc-gui/check-code-blocks-margin.goml @@ -1,5 +1,5 @@ // This test ensures that the docblock elements have the appropriate left margin. -goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" // The top docblock elements shouldn't have left margin... assert-css: ("#main-content .item-decl", {"margin-left": "0px"}) // ... but all the others should! diff --git a/tests/rustdoc-gui/check-stab-in-docblock.goml b/tests/rustdoc-gui/check-stab-in-docblock.goml index 266fa999728..2f62636211b 100644 --- a/tests/rustdoc-gui/check-stab-in-docblock.goml +++ b/tests/rustdoc-gui/check-stab-in-docblock.goml @@ -1,9 +1,9 @@ // This test checks that using `.stab` attributes in `.docblock` elements doesn't // create scrollable paragraphs. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" // Needs the text to be display to check for scrollable content. show-text: true -size: (786, 600) +set-window-size: (786, 600) // Confirms that there 3 paragraphs. assert-count: (".top-doc .docblock p", 3) // Checking that there is no scrollable content. diff --git a/tests/rustdoc-gui/check_info_sign_position.goml b/tests/rustdoc-gui/check_info_sign_position.goml index f36e73fc5e9..c9a4ea94cfe 100644 --- a/tests/rustdoc-gui/check_info_sign_position.goml +++ b/tests/rustdoc-gui/check_info_sign_position.goml @@ -1,7 +1,7 @@ // This test checks the position of the information on the code blocks (like // `compile_fail` or `ignore`). -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" -goto: "./fn.check_list_code_block.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "./fn.check_list_code_block.html" // If the codeblock is the first element of the docblock, the information tooltip must have // have some top margin to avoid going over the toggle (the "[+]"). assert-css: (".docblock > .example-wrap.compile_fail .tooltip", { "margin-top": "16px" }) diff --git a/tests/rustdoc-gui/code-blocks-overflow.goml b/tests/rustdoc-gui/code-blocks-overflow.goml index fbf0e890bdc..a23136f4b76 100644 --- a/tests/rustdoc-gui/code-blocks-overflow.goml +++ b/tests/rustdoc-gui/code-blocks-overflow.goml @@ -1,6 +1,6 @@ // This test ensures that codeblocks content don't overflow. -goto: "file://" + |DOC_PATH| + "/lib2/sub_mod/struct.Foo.html" -size: (1080, 600) +go-to: "file://" + |DOC_PATH| + "/lib2/sub_mod/struct.Foo.html" +set-window-size: (1080, 600) // There should be two codeblocks: a rust one and a non-rust one. assert-count: (".docblock > .example-wrap", 2) assert: ".docblock > .example-wrap > .language-txt" diff --git a/tests/rustdoc-gui/code-color.goml b/tests/rustdoc-gui/code-color.goml index cb550a4573a..833fa05db42 100644 --- a/tests/rustdoc-gui/code-color.goml +++ b/tests/rustdoc-gui/code-color.goml @@ -2,7 +2,7 @@ // check that the rule isn't applied on other "" elements. // // While we're at it, we also check it for the other themes. -goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" // If the text isn't displayed, the browser doesn't compute color style correctly... show-text: true @@ -11,7 +11,7 @@ define-function: ( (theme, doc_code_color, doc_inline_code_color), block { // Set the theme. - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} // We reload the page so the local storage settings are being used. reload: assert-css: (".docblock pre > code", {"color": |doc_code_color|}, ALL) diff --git a/tests/rustdoc-gui/code-sidebar-toggle.goml b/tests/rustdoc-gui/code-sidebar-toggle.goml index df665bd46c0..28c3712f307 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. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" click: ".srclink" wait-for: "#src-sidebar-toggle" click: "#src-sidebar-toggle" -fail: true +expect-failure: true assert-css: ("#source-sidebar", { "left": "-300px" }) diff --git a/tests/rustdoc-gui/code-tags.goml b/tests/rustdoc-gui/code-tags.goml index ca337cbc323..3405d3295e6 100644 --- a/tests/rustdoc-gui/code-tags.goml +++ b/tests/rustdoc-gui/code-tags.goml @@ -3,22 +3,22 @@ // We need to disable this check because `implementors/test_docs/trait.AnotherOne.js` // doesn't exist. fail-on-request-error: false -goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" -size: (1080, 600) +go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" +set-window-size: (1080, 600) // There should be four doc codeblocks. // Check that their content is inside

 assert-count: (".example-wrap pre > code", 4)
 // Check that function signature is inside 

 assert: "pre.rust.item-decl > code"
 
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
 assert: "pre.rust.item-decl > code"
 
-goto: "file://" + |DOC_PATH| + "/test_docs/enum.AnEnum.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/enum.AnEnum.html"
 assert: "pre.rust.item-decl > code"
 
-goto: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
 assert: "pre.rust.item-decl > code"
 
-goto: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html"
 assert: "pre.rust.item-decl > code"
diff --git a/tests/rustdoc-gui/codeblock-sub.goml b/tests/rustdoc-gui/codeblock-sub.goml
index cbd314d2791..03575cc6aaa 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  do not have a line height of 0.
-goto: "file://" + |DOC_PATH| + "/test_docs/codeblock_sub/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/codeblock_sub/index.html"
 
 store-property: (codeblock_sub_1, "#codeblock-sub-1", "offsetHeight")
 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 36b67073a03..2ed0579d314 100644
--- a/tests/rustdoc-gui/codeblock-tooltip.goml
+++ b/tests/rustdoc-gui/codeblock-tooltip.goml
@@ -1,5 +1,5 @@
 // Checking the colors of the codeblocks tooltips.
-goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
 show-text: true
 
 define-function: (
@@ -7,7 +7,7 @@ define-function: (
     (theme, background, color, border),
     block {
         // Setting the theme.
-        local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+        set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
         reload:
 
         // compile_fail block
diff --git a/tests/rustdoc-gui/cursor.goml b/tests/rustdoc-gui/cursor.goml
index 59b1397970b..f318b05ceda 100644
--- a/tests/rustdoc-gui/cursor.goml
+++ b/tests/rustdoc-gui/cursor.goml
@@ -1,5 +1,5 @@
 // This test ensures that several clickable items actually have the pointer cursor.
-goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
 
 // the `[+]/[-]` button
 assert-css: ("#toggle-all-docs", {"cursor": "pointer"})
@@ -16,9 +16,9 @@ wait-for: "#search-tabs"
 assert-css: ("#search-tabs > button", {"cursor": "pointer"})
 
 // mobile sidebar toggle button
-size: (500, 700)
+set-window-size: (500, 700)
 assert-css: (".sidebar-menu-toggle", {"cursor": "pointer"})
 
 // the sidebar toggle button on the source code pages
-goto: "file://" + |DOC_PATH| + "/src/lib2/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/lib2/lib.rs.html"
 assert-css: ("#src-sidebar-toggle > button", {"cursor": "pointer"})
diff --git a/tests/rustdoc-gui/default-settings.goml b/tests/rustdoc-gui/default-settings.goml
index ab27b001eb6..3466f3693f9 100644
--- a/tests/rustdoc-gui/default-settings.goml
+++ b/tests/rustdoc-gui/default-settings.goml
@@ -2,7 +2,7 @@
 //
 // The "settings" crate uses "ayu" as default setting, which is what we will
 // check.
-goto: "file://" + |DOC_PATH| + "/settings/index.html"
+go-to: "file://" + |DOC_PATH| + "/settings/index.html"
 // Wait a bit to be sure the default theme is applied.
 // If the theme isn't applied, the command will time out.
 wait-for-css: ("body", {"background-color": "rgb(15, 20, 25)"})
diff --git a/tests/rustdoc-gui/docblock-big-code-mobile.goml b/tests/rustdoc-gui/docblock-big-code-mobile.goml
index 3ce921c2c91..6fc6834768e 100644
--- a/tests/rustdoc-gui/docblock-big-code-mobile.goml
+++ b/tests/rustdoc-gui/docblock-big-code-mobile.goml
@@ -1,7 +1,7 @@
 // If we have a long ``, we need to ensure that it'll be fully displayed on mobile, meaning
 // that it'll be on two lines.
 emulate: "iPhone 8" // it has the following size: (375, 667)
-goto: "file://" + |DOC_PATH| + "/test_docs/long_code_block/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/long_code_block/index.html"
 // We now check that the block is on two lines:
 show-text: true // We need to enable text draw to be able to have the "real" size
 // Little explanations for this test: if the text wasn't displayed on two lines, it would take
@@ -9,5 +9,5 @@ show-text: true // We need to enable text draw to be able to have the "real" siz
 assert-property: (".docblock p > code", {"offsetHeight": "44"})
 
 // Same check, but where the long code block is also a link
-goto: "file://" + |DOC_PATH| + "/test_docs/long_code_block_link/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/long_code_block_link/index.html"
 assert-property: (".docblock p > a > code", {"offsetHeight": "44"})
diff --git a/tests/rustdoc-gui/docblock-code-block-line-number.goml b/tests/rustdoc-gui/docblock-code-block-line-number.goml
index 69bcf5339ef..4c36394a30c 100644
--- a/tests/rustdoc-gui/docblock-code-block-line-number.goml
+++ b/tests/rustdoc-gui/docblock-code-block-line-number.goml
@@ -1,5 +1,5 @@
 // Checks that the setting "line numbers" is working as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
 
 // Otherwise, we can't check text color
 show-text: true
@@ -13,7 +13,7 @@ define-function: (
     (theme, color),
     block {
         // We now set the setting to show the line numbers on code examples.
-        local-storage: {
+        set-local-storage: {
             "rustdoc-theme": |theme|,
             "rustdoc-use-system-theme": "false",
             "rustdoc-line-numbers": "true"
diff --git a/tests/rustdoc-gui/docblock-details.goml b/tests/rustdoc-gui/docblock-details.goml
index 9ae571efbb5..58ff17619f6 100644
--- a/tests/rustdoc-gui/docblock-details.goml
+++ b/tests/rustdoc-gui/docblock-details.goml
@@ -1,7 +1,7 @@
 // This ensures that the `
`/`` elements are displayed as expected. -goto: "file://" + |DOC_PATH| + "/test_docs/details/struct.Details.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/details/struct.Details.html" show-text: true -local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"} +set-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"} reload: // We first check that the headers in the `.top-doc` doc block still have their diff --git a/tests/rustdoc-gui/docblock-table-overflow.goml b/tests/rustdoc-gui/docblock-table-overflow.goml index d8670089ad8..1ca919d1eab 100644 --- a/tests/rustdoc-gui/docblock-table-overflow.goml +++ b/tests/rustdoc-gui/docblock-table-overflow.goml @@ -1,7 +1,7 @@ // This test ensures that the type declaration content overflow is handled inside the
 directly.
-goto: "file://" + |DOC_PATH| + "/lib2/long_table/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/long_table/struct.Foo.html"
 // We set a fixed size so there is no chance of "random" resize.
-size: (1100, 800)
+set-window-size: (1100, 800)
 // Logically, the ".docblock" and the "

" should have the same scroll width. compare-elements-property: (".top-doc .docblock", ".top-doc .docblock > p", ["scrollWidth"]) assert-property: (".top-doc .docblock", {"scrollWidth": "816"}) diff --git a/tests/rustdoc-gui/docblock-table.goml b/tests/rustdoc-gui/docblock-table.goml index 3dcb8abd415..011451ef4f3 100644 --- a/tests/rustdoc-gui/docblock-table.goml +++ b/tests/rustdoc-gui/docblock-table.goml @@ -1,5 +1,5 @@ // This test checks the appearance of the tables in the doc comments. -goto: "file://" + |DOC_PATH| + "/test_docs/doc_block_table/struct.DocBlockTable.html#method.func" +go-to: "file://" + |DOC_PATH| + "/test_docs/doc_block_table/struct.DocBlockTable.html#method.func" compare-elements-css: (".impl-items .docblock table th", ".top-doc .docblock table th", ["border"]) compare-elements-css: (".impl-items .docblock table td", ".top-doc .docblock table td", ["border"]) @@ -8,7 +8,7 @@ define-function: ( "check-colors", (theme, border_color, zebra_stripe_color), block { - local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|} + set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|} reload: assert-css: (".top-doc .docblock table tbody tr:nth-child(1)", { "background-color": "rgba(0, 0, 0, 0)", diff --git a/tests/rustdoc-gui/duplicate-macro-reexport.goml b/tests/rustdoc-gui/duplicate-macro-reexport.goml index 496203c128e..7d01c88f31b 100644 --- a/tests/rustdoc-gui/duplicate-macro-reexport.goml +++ b/tests/rustdoc-gui/duplicate-macro-reexport.goml @@ -1,5 +1,5 @@ // This test ensures that there is no macro duplicates in the sidebar. -goto: "file://" + |DOC_PATH| + "/test_docs/macro.a.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/macro.a.html" // Waiting for the elements in the sidebar to be rendered. wait-for: ".sidebar-elems .macro" // Check there is only one macro named "a" listed in the sidebar. diff --git a/tests/rustdoc-gui/enum-variants.goml b/tests/rustdoc-gui/enum-variants.goml index 8dfc49285f2..a1f60986ac3 100644 --- a/tests/rustdoc-gui/enum-variants.goml +++ b/tests/rustdoc-gui/enum-variants.goml @@ -1,5 +1,5 @@ // Verifies that there is non-zero margin on variants and their docblocks. -goto: "file://" + |DOC_PATH| + "/test_docs/enum.WhoLetTheDogOut.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/enum.WhoLetTheDogOut.html" assert-css: (".variants > .variant", {"margin": "0px 0px 12px"}) assert-css: (".variants > .docblock", {"margin": "0px 0px 32px 24px"}) diff --git a/tests/rustdoc-gui/escape-key.goml b/tests/rustdoc-gui/escape-key.goml index 5d80d24969d..3ea20fd118e 100644 --- a/tests/rustdoc-gui/escape-key.goml +++ b/tests/rustdoc-gui/escape-key.goml @@ -1,6 +1,6 @@ // This test ensures that the "Escape" shortcut is handled correctly based on the // current content displayed. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" // First, we check that the search results are hidden when the Escape key is pressed. write: (".search-input", "test") // To be SURE that the search will be run. diff --git a/tests/rustdoc-gui/font-weight.goml b/tests/rustdoc-gui/font-weight.goml index aad334d2bd2..6fad128dab8 100644 --- a/tests/rustdoc-gui/font-weight.goml +++ b/tests/rustdoc-gui/font-weight.goml @@ -1,5 +1,5 @@ // This test checks that the font weight is correctly applied. -goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html" +go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html" assert-css: ("//*[@class='rust item-decl']//a[text()='Alias']", {"font-weight": "400"}) assert-css: ( "//*[@class='structfield small-section-header']//a[text()='Alias']", @@ -9,13 +9,13 @@ assert-css: ("#method\.a_method > .code-header", {"font-weight": "600"}) assert-css: ("#associatedtype\.X > .code-header", {"font-weight": "600"}) assert-css: ("#associatedconstant\.Y > .code-header", {"font-weight": "600"}) -goto: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html" assert-css: (".top-doc .docblock p", {"font-weight": "400"}, ALL) -goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" assert-css: (".impl-items .method > .code-header", {"font-weight": "600"}, ALL) -goto: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html" +go-to: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html" // This is a complex selector, so here's how it works: // diff --git a/tests/rustdoc-gui/go-to-collapsed-elem.goml b/tests/rustdoc-gui/go-to-collapsed-elem.goml index ec423125236..80e9791775e 100644 --- a/tests/rustdoc-gui/go-to-collapsed-elem.goml +++ b/tests/rustdoc-gui/go-to-collapsed-elem.goml @@ -1,10 +1,10 @@ // This test ensures that when clicking on a link which leads to an item inside a collapsed element, // the collapsed element will be expanded. -goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" // We check that the implementors block is expanded. assert-property: ("#implementations-list .implementors-toggle", {"open": "true"}) // We now collapse the implementors block. -property: ("#implementations-list .implementors-toggle", {"open": "false"}) +set-property: ("#implementations-list .implementors-toggle", {"open": "false"}) // And now we click on the link to the method to ensure it'll expand the implementors block. click: "//*[@class='sidebar']//a[@href='#method.must_use']" assert-property: ("#implementations-list .implementors-toggle", {"open": "true"}) @@ -12,9 +12,9 @@ assert-property: ("#implementations-list .implementors-toggle", {"open": "true"} define-function: ("collapsed-from-search", (), block { // Now we do the same through search result. // First we reload the page without the anchor in the URL. - goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" + go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" // Then we collapse the section again... - property: ("#implementations-list .implementors-toggle", {"open": "false"}) + set-property: ("#implementations-list .implementors-toggle", {"open": "false"}) // Then we run the search. write: (".search-input", "foo::must_use") wait-for: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']" @@ -25,12 +25,12 @@ define-function: ("collapsed-from-search", (), block { call-function: ("collapsed-from-search", {}) // Now running the same check but with mobile. -size: (600, 600) -goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" +set-window-size: (600, 600) +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" // We check that the implementors block is expanded. assert-property: ("#implementations-list .implementors-toggle", {"open": "true"}) // We now collapse the implementors block. -property: ("#implementations-list .implementors-toggle", {"open": "false"}) +set-property: ("#implementations-list .implementors-toggle", {"open": "false"}) // First we expand the mobile menu. click: ".sidebar-menu-toggle" // Then we click on the link to the method to ensure it'll expand the implementors block. diff --git a/tests/rustdoc-gui/hash-item-expansion.goml b/tests/rustdoc-gui/hash-item-expansion.goml index 3cf94f624fe..a7a5c3cb483 100644 --- a/tests/rustdoc-gui/hash-item-expansion.goml +++ b/tests/rustdoc-gui/hash-item-expansion.goml @@ -1,5 +1,5 @@ // This test ensures that the element corresponding to the hash is displayed. -goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.borrow" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.borrow" // In the blanket implementations list, "Borrow" is the second one, hence the ":nth(2)". assert-attribute: ("#blanket-implementations-list > details:nth-child(2)", {"open": ""}) // We first check that the impl block is open by default. diff --git a/tests/rustdoc-gui/headers-color.goml b/tests/rustdoc-gui/headers-color.goml index 92cf050a514..7d83833a8bd 100644 --- a/tests/rustdoc-gui/headers-color.goml +++ b/tests/rustdoc-gui/headers-color.goml @@ -4,10 +4,10 @@ define-function: ( "check-colors", (theme, color, code_header_color, focus_background_color, headings_color), block { - goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" + go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" // This is needed so that the text color is computed. show-text: true - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} reload: assert-css: ( ".impl", @@ -19,20 +19,20 @@ define-function: ( {"color": |code_header_color|, "background-color": "rgba(0, 0, 0, 0)"}, ALL, ) - goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#impl-Foo" + go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#impl-Foo" assert-css: ( "#impl-Foo", {"color": |color|, "background-color": |focus_background_color|}, ) - goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.must_use" + go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.must_use" assert-css: ( "#method\.must_use", {"color": |color|, "background-color": |focus_background_color|}, ALL, ) - goto: "file://" + |DOC_PATH| + "/test_docs/index.html" + go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" assert-css: (".small-section-header a", {"color": |color|}, ALL) - goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" + go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" // We select headings (h2, h3, h...). assert-css: (".docblock > :not(p) > a", {"color": |headings_color|}, ALL) }, diff --git a/tests/rustdoc-gui/headings.goml b/tests/rustdoc-gui/headings.goml index e4ba5f1246d..089e2203a04 100644 --- a/tests/rustdoc-gui/headings.goml +++ b/tests/rustdoc-gui/headings.goml @@ -11,7 +11,7 @@ // 18px 1.125em // 16px 1rem // 14px 0.875rem -goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" assert-css: (".main-heading h1", {"font-size": "24px"}) @@ -50,7 +50,7 @@ assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"font-size": "14px"}) assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"border-bottom-width": "0px"}) assert-css: ("h6#sub-sub-heading-for-struct-impl-item-doc", {"font-size": "14px"}) -goto: "file://" + |DOC_PATH| + "/test_docs/enum.HeavilyDocumentedEnum.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/enum.HeavilyDocumentedEnum.html" assert-css: (".main-heading h1", {"font-size": "24px"}) @@ -109,7 +109,7 @@ assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"border-bottom-width" assert-text: ("//ul[@class='block mod']/preceding-sibling::h3", "Modules") assert-css: ("//ul[@class='block mod']/preceding-sibling::h3", {"border-bottom-width": "0px"}, ALL) -goto: "file://" + |DOC_PATH| + "/test_docs/union.HeavilyDocumentedUnion.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/union.HeavilyDocumentedUnion.html" assert-css: (".main-heading h1", {"font-size": "24px"}) @@ -141,7 +141,7 @@ assert-css: ("h5#title-for-union-impl-item-doc", {"border-bottom-width": "0px"}) assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"font-size": "14px"}) assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"border-bottom-width": "0px"}) -goto: "file://" + |DOC_PATH| + "/test_docs/macro.heavily_documented_macro.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/macro.heavily_documented_macro.html" assert-css: (".main-heading h1", {"font-size": "24px"}) @@ -152,13 +152,13 @@ assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"}) // Needed to check colors show-text: true -goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" define-function: ( "check-colors", (theme, heading_color, small_heading_color, heading_border_color), block { - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} reload: assert-css: ( ".top-doc .docblock h2", @@ -222,13 +222,13 @@ define-function: ( "check-since-color", (theme), block { - local-storage: {"rustdoc-theme": |theme|} + set-local-storage: {"rustdoc-theme": |theme|} reload: assert-css: (".since", {"color": "rgb(128, 128, 128)"}, ALL) }, ) -goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html" +go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html" call-function: ("check-since-color", ("ayu")) call-function: ("check-since-color", ("dark")) call-function: ("check-since-color", ("light")) diff --git a/tests/rustdoc-gui/help-page.goml b/tests/rustdoc-gui/help-page.goml index 6e2321a6963..1a1c1b28f61 100644 --- a/tests/rustdoc-gui/help-page.goml +++ b/tests/rustdoc-gui/help-page.goml @@ -1,6 +1,6 @@ // This test ensures that opening the help page in its own tab works. -goto: "file://" + |DOC_PATH| + "/help.html" -size: (1000, 1000) // Try desktop size first. +go-to: "file://" + |DOC_PATH| + "/help.html" +set-window-size: (1000, 1000) // Try desktop size first. wait-for: "#help" assert-css: ("#help", {"display": "block"}) assert-css: ("#help dd", {"font-size": "16px"}) @@ -8,7 +8,7 @@ click: "#help-button > a" assert-css: ("#help", {"display": "block"}) compare-elements-property: (".sub", "#help", ["offsetWidth"]) compare-elements-position: (".sub", "#help", ("x")) -size: (500, 1000) // Try mobile next. +set-window-size: (500, 1000) // Try mobile next. assert-css: ("#help", {"display": "block"}) compare-elements-property: (".sub", "#help", ["offsetWidth"]) compare-elements-position: (".sub", "#help", ("x")) @@ -20,7 +20,7 @@ define-function: ( (theme, color, background, box_shadow), block { // Setting the theme. - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} // We reload the page so the local storage settings are being used. reload: assert-css: ("#help kbd", { @@ -51,8 +51,8 @@ call-function: ("check-colors", { }) // This test ensures that opening the help popover without switching pages works. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" -size: (1000, 1000) // Only supported on desktop. +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" +set-window-size: (1000, 1000) // Only supported on desktop. assert-false: "#help" click: "#help-button > a" assert-css: ("#help", {"display": "block"}) @@ -63,8 +63,8 @@ compare-elements-property-false: (".sub", "#help", ["offsetWidth"]) compare-elements-position-false: (".sub", "#help", ("x")) // This test ensures that the "the rustdoc book" anchor link within the help popover works. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" -size: (1000, 1000) // Popover only appears when the screen width is >700px. +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" +set-window-size: (1000, 1000) // Popover only appears when the screen width is >700px. assert-false: "#help" click: "#help-button > a" click: ".popover a[href='https://doc.rust-lang.org/rustdoc/']" diff --git a/tests/rustdoc-gui/highlight-colors.goml b/tests/rustdoc-gui/highlight-colors.goml index b182150a577..4f5e1c110f2 100644 --- a/tests/rustdoc-gui/highlight-colors.goml +++ b/tests/rustdoc-gui/highlight-colors.goml @@ -1,5 +1,5 @@ // This test checks the highlight colors in the source code pages. -goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" +go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" show-text: true define-function: ( @@ -22,7 +22,7 @@ define-function: ( doc_comment, ), block { - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} reload: assert-css: ("pre.rust .kw", {"color": |kw|}, ALL) assert-css: ("pre.rust .kw-2", {"color": |kw2|}, ALL) diff --git a/tests/rustdoc-gui/huge-collection-of-constants.goml b/tests/rustdoc-gui/huge-collection-of-constants.goml index 636382a9169..387aca6f66c 100644 --- a/tests/rustdoc-gui/huge-collection-of-constants.goml +++ b/tests/rustdoc-gui/huge-collection-of-constants.goml @@ -1,6 +1,6 @@ // Make sure that the last two entries are more than 12 pixels apart and not stacked on each other. -goto: "file://" + |DOC_PATH| + "/test_docs/huge_amount_of_consts/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/huge_amount_of_consts/index.html" compare-elements-position-near-false: ( "//ul[@class='item-table']/li[last()-1]", diff --git a/tests/rustdoc-gui/huge-logo.goml b/tests/rustdoc-gui/huge-logo.goml index 69459bd3e23..6d3eb66068c 100644 --- a/tests/rustdoc-gui/huge-logo.goml +++ b/tests/rustdoc-gui/huge-logo.goml @@ -1,23 +1,23 @@ // huge_logo crate has a custom 712x860 logo // test to ensure the maximum size in the layout works correctly -goto: "file://" + |DOC_PATH| + "/huge_logo/index.html" +go-to: "file://" + |DOC_PATH| + "/huge_logo/index.html" -size: (1280, 1024) +set-window-size: (1280, 1024) // offsetWidth = width of sidebar assert-property: (".sidebar .logo-container", {"offsetWidth": "200", "offsetHeight": 100}) assert-property: (".sidebar .logo-container img", {"offsetWidth": "100", "offsetHeight": 100}) -size: (400, 600) +set-window-size: (400, 600) // offset = size + margin assert-property: (".mobile-topbar .logo-container", {"offsetWidth": "55", "offsetHeight": 45}) assert-property: (".mobile-topbar .logo-container img", {"offsetWidth": "35", "offsetHeight": 35}) -goto: "file://" + |DOC_PATH| + "/src/huge_logo/lib.rs.html" +go-to: "file://" + |DOC_PATH| + "/src/huge_logo/lib.rs.html" -size: (1280, 1024) +set-window-size: (1280, 1024) assert-property: (".sub-logo-container", {"offsetWidth": "60", "offsetHeight": 60}) -size: (400, 600) +set-window-size: (400, 600) // 43 because 35px + 8px of margin assert-css: (".sub-logo-container > img", {"margin-bottom": "8px"}) assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 43}) diff --git a/tests/rustdoc-gui/impl-default-expansion.goml b/tests/rustdoc-gui/impl-default-expansion.goml index c3f9240cc93..45bd7beb6e6 100644 --- a/tests/rustdoc-gui/impl-default-expansion.goml +++ b/tests/rustdoc-gui/impl-default-expansion.goml @@ -1,3 +1,3 @@ // This test ensures that the impl blocks are open by default. -goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" assert-attribute: ("#implementations-list details.implementors-toggle", {"open": ""}) diff --git a/tests/rustdoc-gui/impl-doc.goml b/tests/rustdoc-gui/impl-doc.goml index 6caffb9c39f..4ec46de404f 100644 --- a/tests/rustdoc-gui/impl-doc.goml +++ b/tests/rustdoc-gui/impl-doc.goml @@ -1,5 +1,5 @@ // A docblock on an impl must have a margin to separate it from the contents. -goto: "file://" + |DOC_PATH| + "/test_docs/struct.TypeWithImplDoc.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.TypeWithImplDoc.html" // The text is about 24px tall, so if there's a margin, then their position will be >24px apart compare-elements-position-near-false: ( diff --git a/tests/rustdoc-gui/implementors.goml b/tests/rustdoc-gui/implementors.goml index 997c0ed8f01..b39b95c1a9b 100644 --- a/tests/rustdoc-gui/implementors.goml +++ b/tests/rustdoc-gui/implementors.goml @@ -1,6 +1,6 @@ // The goal of this test is to check that the external trait implementors, generated with JS, // have the same display than the "local" ones. -goto: "file://" + |DOC_PATH| + "/implementors/trait.Whatever.html" +go-to: "file://" + |DOC_PATH| + "/implementors/trait.Whatever.html" assert: "#implementors-list" // There are supposed to be two implementors listed. assert-count: ("#implementors-list .impl", 2) @@ -15,7 +15,7 @@ assert-attribute: ("#implementors-list .impl:nth-child(2)", {"id": "impl-Whateve assert-attribute: ("#implementors-list .impl:nth-child(2) > a.anchor", {"href": "#impl-Whatever-1"}) assert: "#implementors-list .impl:nth-child(2) > .code-header" -goto: "file://" + |DOC_PATH| + "/test_docs/struct.HasEmptyTraits.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HasEmptyTraits.html" compare-elements-position-near-false: ( "#impl-EmptyTrait1-for-HasEmptyTraits", "#impl-EmptyTrait2-for-HasEmptyTraits", @@ -29,13 +29,13 @@ compare-elements-position-near: ( // Now check that re-exports work correctly. // There should be exactly one impl shown on both of these pages. -goto: "file://" + |DOC_PATH| + "/lib2/trait.TraitToReexport.html" +go-to: "file://" + |DOC_PATH| + "/lib2/trait.TraitToReexport.html" assert-count: ("#implementors-list .impl", 1) -goto: "file://" + |DOC_PATH| + "/implementors/trait.TraitToReexport.html" +go-to: "file://" + |DOC_PATH| + "/implementors/trait.TraitToReexport.html" assert-count: ("#implementors-list .impl", 1) // Now check that the link is properly rewritten for a crate called `http`. // An older version of rustdoc had a buggy check for absolute links. -goto: "file://" + |DOC_PATH| + "/http/trait.HttpTrait.html" +go-to: "file://" + |DOC_PATH| + "/http/trait.HttpTrait.html" assert-count: ("#implementors-list .impl", 1) assert-attribute: ("#implementors-list .impl a.trait", {"href": "../http/trait.HttpTrait.html"}) diff --git a/tests/rustdoc-gui/item-decl-colors.goml b/tests/rustdoc-gui/item-decl-colors.goml index c58e3eb7c23..5732dd8eea2 100644 --- a/tests/rustdoc-gui/item-decl-colors.goml +++ b/tests/rustdoc-gui/item-decl-colors.goml @@ -18,9 +18,9 @@ define-function: ( assoc_type_color, ), block { - goto: "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html" + go-to: "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html" show-text: true - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} reload: assert-css: (".item-decl .code-attribute", {"color": |attr_color|}, ALL) assert-css: (".item-decl .trait", {"color": |trait_color|}, ALL) @@ -29,7 +29,7 @@ define-function: ( assert-css: (".item-decl .enum", {"color": |enum_color|}, ALL) assert-css: (".item-decl .primitive", {"color": |primitive_color|}, ALL) - goto: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithoutGenerics.html" + go-to: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithoutGenerics.html" assert-css: (".item-decl .constant", {"color": |constant_color|}, ALL) assert-css: (".item-decl .fn", {"color": |fn_color|}, ALL) assert-css: (".item-decl .associatedtype", {"color": |assoc_type_color|}, ALL) diff --git a/tests/rustdoc-gui/item-info-alignment.goml b/tests/rustdoc-gui/item-info-alignment.goml index 94b52f0056b..6fc365d1f19 100644 --- a/tests/rustdoc-gui/item-info-alignment.goml +++ b/tests/rustdoc-gui/item-info-alignment.goml @@ -1,10 +1,10 @@ // This test ensures that the "item-info" looks about the same // whether or not it's inside a toggle. -goto: "file://" + |DOC_PATH| + "/lib2/struct.ItemInfoAlignmentTest.html" +go-to: "file://" + |DOC_PATH| + "/lib2/struct.ItemInfoAlignmentTest.html" // First, we try it in "desktop" mode. -size: (1200, 870) +set-window-size: (1200, 870) compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x")) // Next, we try it in "mobile" mode (max-width: 700px). -size: (650, 650) +set-window-size: (650, 650) compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x")) diff --git a/tests/rustdoc-gui/item-info-overflow.goml b/tests/rustdoc-gui/item-info-overflow.goml index 8ea14621cbf..23c53c03762 100644 --- a/tests/rustdoc-gui/item-info-overflow.goml +++ b/tests/rustdoc-gui/item-info-overflow.goml @@ -1,7 +1,7 @@ // This test ensures that the "item-info" elements don't overflow. -goto: "file://" + |DOC_PATH| + "/lib2/struct.LongItemInfo.html" +go-to: "file://" + |DOC_PATH| + "/lib2/struct.LongItemInfo.html" // We set a fixed size so there is no chance of "random" resize. -size: (1200, 870) +set-window-size: (1200, 870) // Logically, the "item-decl" and the "item-info" should have the same scroll width. compare-elements-property: (".item-decl", ".item-info", ["scrollWidth"]) assert-property: (".item-info", {"scrollWidth": "940"}) @@ -13,7 +13,7 @@ assert-text: ( ) // Checking the "item-info" on an impl block as well: -goto: "file://" + |DOC_PATH| + "/lib2/struct.LongItemInfo2.html" +go-to: "file://" + |DOC_PATH| + "/lib2/struct.LongItemInfo2.html" compare-elements-property: ( "#impl-SimpleTrait-for-LongItemInfo2 .item-info", "#impl-SimpleTrait-for-LongItemInfo2 + .docblock", diff --git a/tests/rustdoc-gui/item-info.goml b/tests/rustdoc-gui/item-info.goml index 6780dfca68a..60fd7c4e198 100644 --- a/tests/rustdoc-gui/item-info.goml +++ b/tests/rustdoc-gui/item-info.goml @@ -1,15 +1,15 @@ // This test ensures a few things for item info elements. -goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html" +go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html" // Ensuring that the item information don't take 100% of the width if unnecessary. // We set a fixed size so there is no chance of "random" resize. -size: (1100, 800) +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-position: (".item-info .stab", {"x": 245}) // Now we ensure that they're not rendered on the same line. -goto: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html" +go-to: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html" // We first ensure that there are two item info on the trait. assert-count: ("#main-content > .item-info .stab", 2) // They should not have the same `y` position! diff --git a/tests/rustdoc-gui/item-summary-table.goml b/tests/rustdoc-gui/item-summary-table.goml index 7a219bd54c3..89306030329 100644 --- a/tests/rustdoc-gui/item-summary-table.goml +++ b/tests/rustdoc-gui/item-summary-table.goml @@ -1,5 +1,5 @@ // This test ensures that elements aren't display in items summary. -goto: "file://" + |DOC_PATH| + "/lib2/summary_table/index.html" +go-to: "file://" + |DOC_PATH| + "/lib2/summary_table/index.html" // We check that we picked the right item first. assert-text: (".item-table .item-name", "Foo") // Then we check that its summary is empty. diff --git a/tests/rustdoc-gui/javascript-disabled.goml b/tests/rustdoc-gui/javascript-disabled.goml index edf179d0d5e..a0872d553af 100644 --- a/tests/rustdoc-gui/javascript-disabled.goml +++ b/tests/rustdoc-gui/javascript-disabled.goml @@ -2,5 +2,5 @@ // can't be used without JS. javascript: false -goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" assert-css: (".sub", {"display": "none"}) diff --git a/tests/rustdoc-gui/jump-to-def-background.goml b/tests/rustdoc-gui/jump-to-def-background.goml index 8ee3ccf4a21..3a7d48284d7 100644 --- a/tests/rustdoc-gui/jump-to-def-background.goml +++ b/tests/rustdoc-gui/jump-to-def-background.goml @@ -1,12 +1,12 @@ // We check the background color on the jump to definition links in the source code page. -goto: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html" +go-to: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html" define-function: ( "check-background-color", (theme, background_color), block { // Set the theme. - local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" } + set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" } // We reload the page so the local storage settings are being used. reload: assert-css: ( diff --git a/tests/rustdoc-gui/label-next-to-symbol.goml b/tests/rustdoc-gui/label-next-to-symbol.goml index 412e475dcc9..6c6380256bd 100644 --- a/tests/rustdoc-gui/label-next-to-symbol.goml +++ b/tests/rustdoc-gui/label-next-to-symbol.goml @@ -1,9 +1,9 @@ // These tests verify that labels like "UNIX" and "Deprecated" stay on the same line as their symbol. // It also verifies the staggered layout on mobile. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" // Desktop view -size: (1080, 600) +set-window-size: (1080, 600) assert: (".stab.deprecated") assert: (".stab.portability") @@ -39,7 +39,7 @@ compare-elements-position: ( // Mobile view -size: (600, 600) +set-window-size: (600, 600) // staggered layout with 2em spacing assert-css: (".desc.docblock-short", { "padding-left": "32px" }) compare-elements-position-near: ( diff --git a/tests/rustdoc-gui/links-color.goml b/tests/rustdoc-gui/links-color.goml index 14f7d99351a..2ee4bce1015 100644 --- a/tests/rustdoc-gui/links-color.goml +++ b/tests/rustdoc-gui/links-color.goml @@ -1,5 +1,5 @@ // This test checks links colors. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" // This is needed so that the text color is computed. show-text: true @@ -9,7 +9,7 @@ define-function: ( (theme, mod, macro, struct, enum, trait, fn, type, union, keyword, sidebar, sidebar_current, sidebar_current_background), block { - local-storage: { + set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", } diff --git a/tests/rustdoc-gui/list_code_block.goml b/tests/rustdoc-gui/list_code_block.goml index 4c477d70c89..25ddea319c8 100644 --- a/tests/rustdoc-gui/list_code_block.goml +++ b/tests/rustdoc-gui/list_code_block.goml @@ -1,4 +1,4 @@ // This test checks that code blocks in list are supported. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" -goto: "./fn.check_list_code_block.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "./fn.check_list_code_block.html" assert: ("pre.rust.item-decl") diff --git a/tests/rustdoc-gui/method-margins.goml b/tests/rustdoc-gui/method-margins.goml index 720268a9e7e..ac3caeb237f 100644 --- a/tests/rustdoc-gui/method-margins.goml +++ b/tests/rustdoc-gui/method-margins.goml @@ -1,5 +1,5 @@ // This test ensures that the margins on methods are coherent inside an impl block. -goto: "file://" + |DOC_PATH| + "/test_docs/trait_members/struct.HasTrait.html#impl-TraitMembers-for-HasTrait" +go-to: "file://" + |DOC_PATH| + "/test_docs/trait_members/struct.HasTrait.html#impl-TraitMembers-for-HasTrait" assert-count: ("#trait-implementations-list > .toggle", 1) diff --git a/tests/rustdoc-gui/mobile.goml b/tests/rustdoc-gui/mobile.goml index 8c8516ebff8..e576385cd53 100644 --- a/tests/rustdoc-gui/mobile.goml +++ b/tests/rustdoc-gui/mobile.goml @@ -1,8 +1,8 @@ // Test various properties of the mobile UI -goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html" -size: (400, 600) +go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html" +set-window-size: (400, 600) -font-size: 18 +set-font-size: 18 wait-for: 100 // wait a bit for the resize and the font-size change to be fully taken into account. // The out-of-band info (source, stable version, collapse) should be below the @@ -18,14 +18,14 @@ assert-property: (".mobile-topbar h2", {"offsetHeight": 33}) // is therefore not part of the DOM. assert-css: (".content .out-of-band .since::before", { "content": "\"Since \"" }) -size: (1000, 1000) +set-window-size: (1000, 1000) wait-for: 100 // wait a bit for the resize to be fully taken into account. assert-css-false: (".content .out-of-band .since::before", { "content": "\"Since \"" }) // On the settings page, the theme buttons should not line-wrap. Instead, they should // all be placed as a group on a line below the setting name "Theme." -goto: "file://" + |DOC_PATH| + "/settings.html" -size: (400, 600) +go-to: "file://" + |DOC_PATH| + "/settings.html" +set-window-size: (400, 600) // Ignored for now https://github.com/rust-lang/rust/issues/93784. // compare-elements-position-near-false: ( // "#preferred-light-theme .setting-radio-name", diff --git a/tests/rustdoc-gui/module-items-font.goml b/tests/rustdoc-gui/module-items-font.goml index 23823f8b6c7..54c8131c3b9 100644 --- a/tests/rustdoc-gui/module-items-font.goml +++ b/tests/rustdoc-gui/module-items-font.goml @@ -1,5 +1,5 @@ // This test checks that the correct font is used on module items (in index.html pages). -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" assert-css: ( ".item-table .item-name > a", {"font-family": '"Fira Sans", Arial, NanumBarunGothic, sans-serif'}, diff --git a/tests/rustdoc-gui/no-docblock.goml b/tests/rustdoc-gui/no-docblock.goml index 17a955064d7..1b4638ef067 100644 --- a/tests/rustdoc-gui/no-docblock.goml +++ b/tests/rustdoc-gui/no-docblock.goml @@ -4,10 +4,10 @@ // doesn't exist. fail-on-request-error: false -goto: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithNoDocblocks.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithNoDocblocks.html" // Check that the two methods are more than 24px apart. compare-elements-position-near-false: ("//*[@id='tymethod.first_fn']", "//*[@id='tymethod.second_fn']", {"y": 24}) -goto: "file://" + |DOC_PATH| + "/test_docs/struct.TypeWithNoDocblocks.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.TypeWithNoDocblocks.html" // Check that the two methods are more than 24px apart. compare-elements-position-near-false: ("//*[@id='method.first_fn']", "//*[@id='method.second_fn']", {"y": 24}) diff --git a/tests/rustdoc-gui/notable-trait.goml b/tests/rustdoc-gui/notable-trait.goml index 20728915199..f65da577478 100644 --- a/tests/rustdoc-gui/notable-trait.goml +++ b/tests/rustdoc-gui/notable-trait.goml @@ -1,8 +1,8 @@ // This test checks the position of the `i` for the notable traits. -goto: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html" show-text: true // We start with a wide screen. -size: (1100, 600) +set-window-size: (1100, 600) // Checking they have the same y position. compare-elements-position: ( "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", @@ -44,7 +44,7 @@ move-cursor-to: "//h1" assert-count: ("//*[@class='tooltip popover']", 0) // Now only the `i` should be on the next line. -size: (1055, 600) +set-window-size: (1055, 600) compare-elements-position-false: ( "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']", @@ -52,7 +52,7 @@ compare-elements-position-false: ( ) // Now both the `i` and the struct name should be on the next line. -size: (980, 600) +set-window-size: (980, 600) // Checking they have the same y position. compare-elements-position: ( "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", @@ -76,7 +76,7 @@ assert-position: ( ) // Checking on mobile now. -size: (650, 600) +set-window-size: (650, 600) // Checking they have the same y position. compare-elements-position: ( "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", @@ -124,12 +124,12 @@ define-function: ( "check-colors", (theme, header_color, content_color, type_color, trait_color), block { - goto: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html" + go-to: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html" // This is needed to ensure that the text color is computed. show-text: true // Setting the theme. - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} // We reload the page so the local storage settings are being used. reload: @@ -253,7 +253,7 @@ press-key: "Escape" assert-window-property-false: {"scrollY": |scroll|} // Opening the mobile sidebar should close the popover. -size: (650, 600) +set-window-size: (650, 600) click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']" assert-count: ("//*[@class='tooltip popover']", 1) click: ".sidebar-menu-toggle" @@ -266,7 +266,7 @@ assert-count: ("//*[@class='tooltip popover']", 1) assert-false: "//*[@class='sidebar shown']" // Also check the focus handling for the help button. -size: (1100, 600) +set-window-size: (1100, 600) reload: assert-count: ("//*[@class='tooltip popover']", 0) click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']" diff --git a/tests/rustdoc-gui/overflow-tooltip-information.goml b/tests/rustdoc-gui/overflow-tooltip-information.goml index 09ad6cdd7ac..ab7ffc24ccf 100644 --- a/tests/rustdoc-gui/overflow-tooltip-information.goml +++ b/tests/rustdoc-gui/overflow-tooltip-information.goml @@ -1,7 +1,7 @@ // The goal of this test is to ensure that the tooltip `.information` class doesn't // have overflow and max-width CSS rules set because they create a bug in firefox on // mac. For more information: https://github.com/rust-lang/rust/issues/89185 -goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" assert-css: (".docblock > .example-wrap .tooltip", { "overflow-x": "visible", "max-width": "none" diff --git a/tests/rustdoc-gui/pocket-menu.goml b/tests/rustdoc-gui/pocket-menu.goml index c3649dc7bda..4bdf31ecb19 100644 --- a/tests/rustdoc-gui/pocket-menu.goml +++ b/tests/rustdoc-gui/pocket-menu.goml @@ -1,5 +1,5 @@ // This test ensures that the "pocket menus" are working as expected. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" // First we check that the help menu doesn't exist yet. assert-false: "#help-button .popover" // Then we display the help menu. @@ -32,7 +32,7 @@ assert-css: ("#settings-menu .popover", {"display": "none"}) // We check the borders color now: // Ayu theme -local-storage: { +set-local-storage: { "rustdoc-theme": "ayu", "rustdoc-use-system-theme": "false", } @@ -47,7 +47,7 @@ compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-co compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"]) // Dark theme -local-storage: { +set-local-storage: { "rustdoc-theme": "dark", "rustdoc-use-system-theme": "false", } @@ -62,7 +62,7 @@ compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-co compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"]) // Light theme -local-storage: { +set-local-storage: { "rustdoc-theme": "light", "rustdoc-use-system-theme": "false", } @@ -77,7 +77,7 @@ compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-co compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"]) // Opening the mobile sidebar should close the settings popover. -size: (650, 600) +set-window-size: (650, 600) click: "#settings-menu a" assert-css: ("#settings-menu .popover", {"display": "block"}) click: ".sidebar-menu-toggle" diff --git a/tests/rustdoc-gui/run-on-hover.goml b/tests/rustdoc-gui/run-on-hover.goml index 8dcb62c10aa..b5fc49eacac 100644 --- a/tests/rustdoc-gui/run-on-hover.goml +++ b/tests/rustdoc-gui/run-on-hover.goml @@ -2,14 +2,14 @@ // Playground. That button is hidden until the user hovers over the code block. // This test checks that it is hidden, and that it shows on hover. It also // checks for its color. -goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" show-text: true define-function: ( "check-run-button", (theme, color, background, hover_color, hover_background), block { - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} reload: assert-css: (".test-arrow", {"visibility": "hidden"}) move-cursor-to: ".example-wrap" diff --git a/tests/rustdoc-gui/rust-logo.goml b/tests/rustdoc-gui/rust-logo.goml index 2d15e8b9699..640ed152b0d 100644 --- a/tests/rustdoc-gui/rust-logo.goml +++ b/tests/rustdoc-gui/rust-logo.goml @@ -1,26 +1,26 @@ // This test ensures that the correct style is applied to the rust logo in the sidebar. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" define-function: ( "check-logo", (theme, filter), block { // Going to the doc page. - goto: "file://" + |DOC_PATH| + "/test_docs/index.html" + go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" // Changing theme. - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} reload: assert-css: (".rust-logo", {"filter": |filter|}) // Going to the source code page. - goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" + go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" // Changing theme (since it's local files, the local storage works by folder). - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} reload: assert-css: (".rust-logo", {"filter": |filter|}) // Now we check that the non-rust logos don't have a CSS filter set. - goto: "file://" + |DOC_PATH| + "/huge_logo/index.html" + go-to: "file://" + |DOC_PATH| + "/huge_logo/index.html" // Changing theme on the new page (again...). - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} reload: // Check there is no rust logo assert-false: ".rust-logo" diff --git a/tests/rustdoc-gui/scrape-examples-button-focus.goml b/tests/rustdoc-gui/scrape-examples-button-focus.goml index 16f0ced8c6e..77061ea2a3f 100644 --- a/tests/rustdoc-gui/scrape-examples-button-focus.goml +++ b/tests/rustdoc-gui/scrape-examples-button-focus.goml @@ -1,6 +1,6 @@ // This test ensures that the scraped examples buttons are working as expecting // when 'Enter' key is pressed when they're focused. -goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html" +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") diff --git a/tests/rustdoc-gui/scrape-examples-color.goml b/tests/rustdoc-gui/scrape-examples-color.goml index 67c58826efc..8ddb06fccfc 100644 --- a/tests/rustdoc-gui/scrape-examples-color.goml +++ b/tests/rustdoc-gui/scrape-examples-color.goml @@ -1,5 +1,5 @@ // Check that scrape example code blocks have the expected colors. -goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" +go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" show-text: true define-function: ( @@ -7,7 +7,7 @@ define-function: ( (theme, highlight, highlight_focus, help_border, help_color, help_hover_border, help_hover_color), block { - local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", } + set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", } reload: wait-for: ".more-examples-toggle" assert-css: (".scraped-example .example-wrap .rust span.highlight:not(.focus)", { @@ -60,13 +60,13 @@ call-function: ("check-colors", { }) // Now testing the top and bottom background in case there is only one scraped examples. -goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html" +go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html" define-function: ( "check-background", (theme, background_color_start, background_color_end), block { - local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", } + set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", } reload: assert-css: (".scraped-example:not(.expanded) .code-wrapper::before", { "background-image": "linear-gradient(" + |background_color_start| + ", " + diff --git a/tests/rustdoc-gui/scrape-examples-fonts.goml b/tests/rustdoc-gui/scrape-examples-fonts.goml index 142f337cb74..4c325bace97 100644 --- a/tests/rustdoc-gui/scrape-examples-fonts.goml +++ b/tests/rustdoc-gui/scrape-examples-fonts.goml @@ -1,5 +1,5 @@ // This test ensures that the correct font is used in scraped examples. -goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" +go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" store-value: (font, '"Fira Sans", Arial, NanumBarunGothic, sans-serif') diff --git a/tests/rustdoc-gui/scrape-examples-layout.goml b/tests/rustdoc-gui/scrape-examples-layout.goml index dad727c7757..160056d6d05 100644 --- a/tests/rustdoc-gui/scrape-examples-layout.goml +++ b/tests/rustdoc-gui/scrape-examples-layout.goml @@ -1,5 +1,5 @@ // Check that the line number column has the correct layout. -goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" +go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" // Check that it's not zero. assert-property-false: ( @@ -44,6 +44,6 @@ assert-position: (".scraped-example .code-wrapper", {"y": 253}) assert-position: (".scraped-example .code-wrapper .prev", {"y": 253 + |offset_y|}) // Then with mobile -size: (600, 600) +set-window-size: (600, 600) assert-position: (".scraped-example .code-wrapper", {"y": 308}) assert-position: (".scraped-example .code-wrapper .prev", {"y": 308 + |offset_y|}) diff --git a/tests/rustdoc-gui/scrape-examples-toggle.goml b/tests/rustdoc-gui/scrape-examples-toggle.goml index 2d5df6a5d25..9cec6d2bbe8 100644 --- a/tests/rustdoc-gui/scrape-examples-toggle.goml +++ b/tests/rustdoc-gui/scrape-examples-toggle.goml @@ -1,5 +1,5 @@ // This tests checks that the "scraped examples" toggle is working as expected. -goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" +go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" // Checking the color of the toggle line. show-text: true @@ -7,7 +7,7 @@ define-function: ( "check-color", (theme, toggle_line_color, toggle_line_hover_color), block { - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} reload: // Clicking "More examples..." will open additional examples diff --git a/tests/rustdoc-gui/search-error.goml b/tests/rustdoc-gui/search-error.goml index 2a10a647b53..d21905e90ae 100644 --- a/tests/rustdoc-gui/search-error.goml +++ b/tests/rustdoc-gui/search-error.goml @@ -1,5 +1,5 @@ // Checks that the crate search filtering is handled correctly and changes the results. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=sa'%3Bda'%3Bds" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=sa'%3Bda'%3Bds" show-text: true define-function: ( @@ -7,7 +7,7 @@ define-function: ( (theme, error_background), block { // Setting the theme. - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} // We reload the page so the local storage settings are being used. reload: diff --git a/tests/rustdoc-gui/search-filter.goml b/tests/rustdoc-gui/search-filter.goml index 5bc6e87d6d2..f114c57ff21 100644 --- a/tests/rustdoc-gui/search-filter.goml +++ b/tests/rustdoc-gui/search-filter.goml @@ -1,5 +1,5 @@ // Checks that the crate search filtering is handled correctly and changes the results. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" show-text: true write: (".search-input", "test") // To be SURE that the search will be run. @@ -47,7 +47,7 @@ wait-for: "#search-tabs" assert-property: ("#crate-search", {"value": "all crates"}) // Checking that the URL parameter is taken into account for crate filtering. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=test&filter-crate=lib2" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=test&filter-crate=lib2" wait-for: "#crate-search" assert-property: ("#crate-search", {"value": "lib2"}) assert-false: "#results .externcrate" @@ -57,10 +57,10 @@ assert-text: (".search-results-title", "Results in all crates", STARTS_WITH) // Checking the display of the crate filter. // We start with the light theme. -local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} +set-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} reload: -timeout: 2000 +set-timeout: 2000 wait-for: "#crate-search" assert-css: ("#crate-search", { "border": "1px solid rgb(224, 224, 224)", diff --git a/tests/rustdoc-gui/search-form-elements.goml b/tests/rustdoc-gui/search-form-elements.goml index 542db348c3b..83c6980909c 100644 --- a/tests/rustdoc-gui/search-form-elements.goml +++ b/tests/rustdoc-gui/search-form-elements.goml @@ -1,9 +1,9 @@ // This test ensures that the elements in ".search-form" have the expected display. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" show-text: true // Ayu theme -local-storage: { +set-local-storage: { "rustdoc-theme": "ayu", "rustdoc-use-system-theme": "false", } @@ -89,7 +89,7 @@ assert-css: ( ) // Dark theme -local-storage: { +set-local-storage: { "rustdoc-theme": "dark", "rustdoc-use-system-theme": "false", } @@ -176,7 +176,7 @@ assert-css: ( ) // Light theme -local-storage: { +set-local-storage: { "rustdoc-theme": "light", "rustdoc-use-system-theme": "false", } diff --git a/tests/rustdoc-gui/search-input-mobile.goml b/tests/rustdoc-gui/search-input-mobile.goml index ce0cef77ce4..adcb3658a27 100644 --- a/tests/rustdoc-gui/search-input-mobile.goml +++ b/tests/rustdoc-gui/search-input-mobile.goml @@ -1,11 +1,11 @@ // Test to ensure that you can click on the search input, whatever the width. // The PR which fixed it is: https://github.com/rust-lang/rust/pull/81592 -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" -size: (463, 700) +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" +set-window-size: (463, 700) // We first check that the search input isn't already focused. assert-false: ("input.search-input:focus") click: "input.search-input" reload: -size: (750, 700) +set-window-size: (750, 700) click: "input.search-input" assert: ("input.search-input:focus") diff --git a/tests/rustdoc-gui/search-keyboard.goml b/tests/rustdoc-gui/search-keyboard.goml index ed975664c66..f1d8024616b 100644 --- a/tests/rustdoc-gui/search-keyboard.goml +++ b/tests/rustdoc-gui/search-keyboard.goml @@ -1,6 +1,6 @@ // Checks that the search tab results work correctly with function signature syntax // First, try a search-by-name -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" write: (".search-input", "Foo") // To be SURE that the search will be run. press-key: 'Enter' diff --git a/tests/rustdoc-gui/search-no-result.goml b/tests/rustdoc-gui/search-no-result.goml index b76a44fa992..46d1856b4d6 100644 --- a/tests/rustdoc-gui/search-no-result.goml +++ b/tests/rustdoc-gui/search-no-result.goml @@ -1,5 +1,5 @@ // The goal of this test is to check the color of the "no result" links. -goto: "file://" + |DOC_PATH| + "/lib2/index.html?search=sdkfskjfsdks" +go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=sdkfskjfsdks" show-text: true define-function: ( @@ -7,7 +7,7 @@ define-function: ( (theme, link, link_hover), block { // Changing theme. - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} reload: wait-for: "#results" assert: ".search-failed.active" diff --git a/tests/rustdoc-gui/search-reexport.goml b/tests/rustdoc-gui/search-reexport.goml index dd19f03bd1e..fd817b58990 100644 --- a/tests/rustdoc-gui/search-reexport.goml +++ b/tests/rustdoc-gui/search-reexport.goml @@ -1,7 +1,7 @@ // Checks that the reexports are present in the search index, can have // doc aliases and are highligted when their ID is the hash of the page. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" -local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"} +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" +set-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"} reload: // First we check that the reexport has the correct ID and no background color. assert-text: ("//*[@id='reexport.TheStdReexport']", "pub use ::std as TheStdReexport;") diff --git a/tests/rustdoc-gui/search-result-color.goml b/tests/rustdoc-gui/search-result-color.goml index d6d54ec4bee..da46a90df90 100644 --- a/tests/rustdoc-gui/search-result-color.goml +++ b/tests/rustdoc-gui/search-result-color.goml @@ -31,13 +31,13 @@ define-function: ( }, ) -goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo" // This is needed so that the text color is computed. show-text: true // Ayu theme -local-storage: { +set-local-storage: { "rustdoc-theme": "ayu", "rustdoc-use-system-theme": "false", } @@ -154,7 +154,7 @@ assert-css: ( ) // Dark theme -local-storage: { +set-local-storage: { "rustdoc-theme": "dark", "rustdoc-use-system-theme": "false", } @@ -259,7 +259,7 @@ assert-css: ( ) // Light theme -local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} +set-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} reload: // Waiting for the search results to appear... @@ -361,7 +361,7 @@ assert-css: ( ) // Check the alias. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" // If the text isn't displayed, the browser doesn't compute color style correctly... show-text: true @@ -369,7 +369,7 @@ define-function: ( "check-alias", (theme, alias, grey), block { - local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} reload: write: (".search-input", "thisisanalias") // To be SURE that the search will be run. diff --git a/tests/rustdoc-gui/search-result-description.goml b/tests/rustdoc-gui/search-result-description.goml index 9fa2108045d..745ef31e6cb 100644 --- a/tests/rustdoc-gui/search-result-description.goml +++ b/tests/rustdoc-gui/search-result-description.goml @@ -1,5 +1,5 @@ // This test is to ensure that the codeblocks are correctly rendered in the search results. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=some_more_function" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=some_more_function" // Waiting for the search results to appear... wait-for: "#search-tabs" assert-text: (".search-results .desc code", "format!") diff --git a/tests/rustdoc-gui/search-result-display.goml b/tests/rustdoc-gui/search-result-display.goml index 20a88c36edb..93c71f23f24 100644 --- a/tests/rustdoc-gui/search-result-display.goml +++ b/tests/rustdoc-gui/search-result-display.goml @@ -1,6 +1,6 @@ // Checks that the search results have the expected width. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" -size: (900, 1000) +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" +set-window-size: (900, 1000) write: (".search-input", "test") // To be SURE that the search will be run. press-key: 'Enter' @@ -8,7 +8,7 @@ wait-for: "#crate-search" // The width is returned by "getComputedStyle" which returns the exact number instead of the // CSS rule which is "50%"... assert-css: (".search-results div.desc", {"width": "310px"}) -size: (600, 100) +set-window-size: (600, 100) // As counter-intuitive as it may seem, in this width, the width is "100%", which is why // when computed it's larger. assert-css: (".search-results div.desc", {"width": "566px"}) @@ -18,7 +18,7 @@ assert-css: (".search-results .result-name > span", {"display": "inline"}) // Check that the crate filter `