Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update browser UI test version #102789

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.0
0.12.0
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/anchor-navigable.goml
Original file line number Diff line number Diff line change
Expand Up @@ -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
goto: "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"})
Expand Down
12 changes: 6 additions & 6 deletions src/test/rustdoc-gui/anchors.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This test is to ensure that the anchors (`§`) have the expected color and position.
goto: file://|DOC_PATH|/staged_api/struct.Foo.html
goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"

// This is needed to ensure that the text color is computed.
show-text: true
Expand Down Expand Up @@ -36,7 +36,7 @@ assert-css: (
{"color": "rgb(56, 115, 173)", "text-decoration": "none solid rgb(56, 115, 173)"},
)

goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"

assert-css: ("#top-doc-prose-title", {"color": "rgb(0, 0, 0)"})

Expand All @@ -57,7 +57,7 @@ assert-css: ("#title-for-struct-impl-item-doc", {"margin-left": "0px"})
// We do the same checks with the dark theme now.
//
local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
goto: file://|DOC_PATH|/staged_api/struct.Foo.html
goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"

assert-css: ("#toggle-all-docs", {"color": "rgb(221, 221, 221)"})
assert-css: (".fqn a:nth-of-type(1)", {"color": "rgb(221, 221, 221)"})
Expand Down Expand Up @@ -86,7 +86,7 @@ assert-css: (
{"color": "rgb(210, 153, 29)", "text-decoration": "none solid rgb(210, 153, 29)"},
)

goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"

assert-css: ("#top-doc-prose-title", {"color": "rgb(221, 221, 221)"})

Expand All @@ -107,7 +107,7 @@ assert-css: ("#title-for-struct-impl-item-doc", {"margin-left": "0px"})
// We do the same checks with the ayu theme now.
//
local-storage: {"rustdoc-theme": "ayu", "rustdoc-use-system-theme": "false"}
goto: file://|DOC_PATH|/staged_api/struct.Foo.html
goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"

assert-css: ("#toggle-all-docs", {"color": "rgb(197, 197, 197)"})
assert-css: (".fqn a:nth-of-type(1)", {"color": "rgb(255, 255, 255)"})
Expand Down Expand Up @@ -136,7 +136,7 @@ assert-css: (
{"color": "rgb(57, 175, 215)", "text-decoration": "none solid rgb(57, 175, 215)"},
)

goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"

assert-css: ("#top-doc-prose-title", {"color": "rgb(255, 255, 255)"})

Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/auto-hide-trait-implementations.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Checks that the setting "auto hide trait implementations" is working as expected.
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"

// By default, the trait implementations are not collapsed.
assert-attribute: ("#trait-implementations-list > details", {"open": ""}, ALL)
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/basic-code.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
goto: file://|DOC_PATH|/test_docs/index.html
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
click: ".srclink"
assert-count: (".src-line-numbers", 1)
4 changes: 2 additions & 2 deletions src/test/rustdoc-gui/basic.goml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
goto: file://|DOC_PATH|/test_docs/index.html
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert: ("#functions")
goto: ./struct.Foo.html
goto: "./struct.Foo.html"
assert: ("div.item-decl")
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/check-code-blocks-margin.goml
Original file line number Diff line number Diff line change
@@ -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
goto: "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!
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/check-stab-in-docblock.goml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This test checks that using `.stab` attributes in `.docblock` elements doesn't
// create scrollable paragraphs.
goto: file://|DOC_PATH|/test_docs/index.html
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Needs the text to be display to check for scrollable content.
show-text: true
size: (786, 600)
Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc-gui/check_info_sign_position.goml
Original file line number Diff line number Diff line change
@@ -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
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
goto: "./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" })
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/code-blocks-overflow.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This test ensures that codeblocks content don't overflow.
goto: file://|DOC_PATH|/lib2/sub_mod/struct.Foo.html
goto: "file://" + |DOC_PATH| + "/lib2/sub_mod/struct.Foo.html"
size: (1080, 600)
// There should be two codeblocks: a rust one and a non-rust one.
assert-count: (".docblock > .example-wrap", 2)
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/code-color.goml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// check that the rule isn't applied on other "<code>" elements.
//
// While we're at it, we also check it for the other themes.
goto: file://|DOC_PATH|/test_docs/fn.foo.html
goto: "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
// Set the theme to dark.
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/code-sidebar-toggle.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This test checks that the source code pages sidebar toggle is working as expected.
goto: file://|DOC_PATH|/test_docs/index.html
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
click: ".srclink"
wait-for: "#sidebar-toggle"
click: "#sidebar-toggle"
Expand Down
10 changes: 5 additions & 5 deletions src/test/rustdoc-gui/code-tags.goml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// This test ensures that items and documentation code blocks are wrapped in <pre><code>
goto: file://|DOC_PATH|/test_docs/fn.foo.html
goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
size: (1080, 600)
// There should be four doc codeblocks.
// Check that their content is inside <pre><code>
assert-count: (".example-wrap pre > code", 4)
// Check that function signature is inside <pre><code>
assert: "pre.rust.fn > code"

goto: file://|DOC_PATH|/test_docs/struct.Foo.html
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert: "pre.rust.struct > code"

goto: file://|DOC_PATH|/test_docs/enum.AnEnum.html
goto: "file://" + |DOC_PATH| + "/test_docs/enum.AnEnum.html"
assert: "pre.rust.enum > code"

goto: file://|DOC_PATH|/test_docs/trait.AnotherOne.html
goto: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
assert: "pre.rust.trait > code"

goto: file://|DOC_PATH|/test_docs/type.SomeType.html
goto: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html"
assert: "pre.rust.typedef > code"
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/codeblock-tooltip.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Checking the colors of the codeblocks tooltips.
goto: file://|DOC_PATH|/test_docs/fn.foo.html
goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
show-text: true

// Dark theme.
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/default-settings.goml
Original file line number Diff line number Diff line change
Expand Up @@ -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
goto: "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)"})
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/docblock-big-code-mobile.goml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// If we have a long `<code>`, 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
goto: "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
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/docblock-code-block-line-number.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Checks that the setting "line numbers" is working as expected.
goto: file://|DOC_PATH|/test_docs/fn.foo.html
goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"

// We check that without this setting, there is no line number displayed.
assert-false: "pre.example-line-numbers"
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/docblock-details.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This ensures that the `<details>`/`<summary>` elements are displayed as expected.
goto: file://|DOC_PATH|/test_docs/details/struct.Details.html
goto: "file://" + |DOC_PATH| + "/test_docs/details/struct.Details.html"
show-text: true
local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
reload:
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/docblock-table-overflow.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This test ensures that the type declaration content overflow is handled inside the <pre> directly.
goto: file://|DOC_PATH|/lib2/long_table/struct.Foo.html
goto: "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)
// Logically, the ".docblock" and the "<p>" should have the same scroll width.
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/docblock-table.goml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
goto: file://|DOC_PATH|/test_docs/doc_block_table/struct.DocBlockTable.html#method.func
goto: "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"])
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/duplicate-macro-reexport.goml
Original file line number Diff line number Diff line change
@@ -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
goto: "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.
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/escape-key.goml
Original file line number Diff line number Diff line change
@@ -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
goto: "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.
Expand Down
8 changes: 4 additions & 4 deletions src/test/rustdoc-gui/font-weight.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This test checks that the font weight is correctly applied.
goto: file://|DOC_PATH|/lib2/struct.Foo.html
goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
assert-css: ("//*[@class='item-decl']//a[text()='Alias']", {"font-weight": "400"})
assert-css: (
"//*[@class='structfield small-section-header']//a[text()='Alias']",
Expand All @@ -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
goto: "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
goto: "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
goto: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html"

// This is a complex selector, so here's how it works:
//
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/hash-item-expansion.goml
Original file line number Diff line number Diff line change
@@ -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
goto: "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.
Expand Down
30 changes: 15 additions & 15 deletions src/test/rustdoc-gui/headers-color.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This test check for headers text and background colors for the different themes.
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"

// This is needed so that the text color is computed.
show-text: true
Expand All @@ -23,23 +23,23 @@ assert-css: (
ALL,
)

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl-Foo
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#impl-Foo"
assert-css: (
"#impl-Foo",
{"color": "rgb(197, 197, 197)", "background-color": "rgba(255, 236, 164, 0.06)"},
)

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.must_use"
assert-css: (
"#method\.must_use",
{"color": "rgb(197, 197, 197)", "background-color": "rgba(255, 236, 164, 0.06)"},
ALL,
)

goto: file://|DOC_PATH|/test_docs/index.html
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-css: (".small-section-header a", {"color": "rgb(197, 197, 197)"}, ALL)

goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
// We select headings (h2, h3, h...).
assert-css: (".docblock > :not(p) > a", {"color": "rgb(57, 175, 215)"}, ALL)

Expand All @@ -49,7 +49,7 @@ local-storage: {
"rustdoc-preferred-dark-theme": "dark",
"rustdoc-use-system-theme": "false",
}
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"

assert-css: (
".impl",
Expand All @@ -62,31 +62,31 @@ assert-css: (
ALL,
)

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl-Foo
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#impl-Foo"
assert-css: (
"#impl-Foo",
{"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"},
)

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.must_use"
assert-css: (
"#method\.must_use",
{"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"},
ALL,
)

goto: file://|DOC_PATH|/test_docs/index.html
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-css: (".small-section-header a", {"color": "rgb(221, 221, 221)"}, ALL)

goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
// We select headings (h2, h3, h...).
assert-css: (".docblock > :not(p) > a", {"color": "rgb(210, 153, 29)"}, ALL)

// Light theme
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
reload:

goto: file://|DOC_PATH|/test_docs/struct.Foo.html
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"

assert-css: (
".impl",
Expand All @@ -99,19 +99,19 @@ assert-css: (
ALL,
)

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl-Foo
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#impl-Foo"
assert-css: ("#impl-Foo", {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"})

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.must_use"
assert-css: (
"#method\.must_use",
{"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"},
ALL,
)

goto: file://|DOC_PATH|/test_docs/index.html
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-css: (".small-section-header a", {"color": "rgb(0, 0, 0)"}, ALL)

goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
// We select headings (h2, h3, h...).
assert-css: (".docblock > :not(p) > a", {"color": "rgb(56, 115, 173)"}, ALL)
Loading