Skip to content

Commit

Permalink
Rollup merge of rust-lang#93170 - GuillaumeGomez:gui-tests-explanatio…
Browse files Browse the repository at this point in the history
…ns, r=jsha

Add missing GUI test explanations

Some GUI tests didn't have a global explanation about what they were testing. This fixes it.

r? ``@jsha``
  • Loading branch information
matthiaskrgr authored Jan 22, 2022
2 parents 828b28c + 78cee22 commit 0bfa1a4
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/test/rustdoc-gui/check_info_sign_position.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// 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
// If the codeblock is the first element of the docblock, the information tooltip must have
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/code-sidebar-toggle.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// This test checks that the source code pages sidebar toggle is working as expected.
goto: file://|DOC_PATH|/test_docs/index.html
click: ".srclink"
wait-for: "#sidebar-toggle"
Expand Down
2 changes: 2 additions & 0 deletions src/test/rustdoc-gui/escape-key.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This test ensures that the "Escape" shortcut is handled correctly based on the
// current content displayed.
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")
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/font-weight.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
goto: file://|DOC_PATH|/lib2/struct.Foo.html
// This test checks that the font weight is correctly applied.
goto: file://|DOC_PATH|/lib2/struct.Foo.html
assert-css: ("//*[@class='docblock item-decl']//a[text()='Alias']", {"font-weight": "400"})
assert-css: (
"//*[@class='structfield small-section-header']//a[text()='Alias']",
Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc-gui/huge-collection-of-constants.goml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
goto: file://|DOC_PATH|/test_docs/huge_amount_of_consts/index.html

// 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

compare-elements-position-near-false: (
"//*[@class='item-table']//div[last()-1]",
"//*[@class='item-table']//div[last()-3]",
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/list_code_block.goml
Original file line number Diff line number Diff line change
@@ -1,3 +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
assert: ("pre.rust.fn")
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/search-filter.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Checks that the crate search filtering is handled correctly and changes the results.
goto: file://|DOC_PATH|/test_docs/index.html
show-text: true
write: (".search-input", "test")
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/search-result-colors.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Checks that the result colors are as expected.
goto: file://|DOC_PATH|/test_docs/index.html
// We set the theme so we're sure that the correct values will be used, whatever the computer
// this test is running on.
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/search-result-display.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Checks that the search results have the expected width.
goto: file://|DOC_PATH|/test_docs/index.html
size: (900, 1000)
write: (".search-input", "test")
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/search-result-keyword.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Checks that the "keyword" results have the expected text alongside them.
goto: file://|DOC_PATH|/test_docs/index.html
write: (".search-input", "CookieMonster")
// Waiting for the search results to appear...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Checks that the first non-empty search result tab is selected if the default/currently selected
// one is empty.
goto: file://|DOC_PATH|/test_docs/index.html
write: (".search-input", "Foo")
// Waiting for the search results to appear...
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/sidebar.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Checks multiple things on the sidebar display (width of its elements, colors, etc).
goto: file://|DOC_PATH|/test_docs/index.html
show-text: true
local-storage: {"rustdoc-theme": "light"}
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/source-code-page.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Checks that the interactions with the source code pages are workined as expected.
goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
// Check that we can click on the line number.
click: ".line-numbers > span:nth-child(4)" // This is the span for line 4.
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/theme-change.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Ensures that the theme change is working as expected.
goto: file://|DOC_PATH|/test_docs/index.html
click: "#theme-picker"
click: "#theme-choices > button:first-child"
Expand Down
2 changes: 2 additions & 0 deletions src/test/rustdoc-gui/toggle-docs-mobile.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Checks that the documentation toggles on mobile have the correct position, style and work
// as expected.
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
size: (433, 600)
assert-attribute: (".top-doc", {"open": ""})
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/toggle-docs.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Checks that the documentation toggles have the correct position, style and work as expected.
goto: file://|DOC_PATH|/test_docs/index.html
assert-attribute: ("#main-content > details.top-doc", {"open": ""})
assert-text: ("#toggle-all-docs", "[−]")
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/trait-sidebar-item-order.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Checks that the elements in the sidebar are alphabetically sorted.
goto: file://|DOC_PATH|/test_docs/trait.AnotherOne.html
assert-text: (".sidebar-links a:nth-of-type(1)", "another")
assert-text: (".sidebar-links a:nth-of-type(2)", "func1")
Expand Down

0 comments on commit 0bfa1a4

Please sign in to comment.