From 78cee22fb4c6c4b57a7e96b25e90ca50d67a3c3a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 21 Jan 2022 20:41:47 +0100 Subject: [PATCH] Add missing GUI test explanations --- src/test/rustdoc-gui/check_info_sign_position.goml | 2 ++ src/test/rustdoc-gui/code-sidebar-toggle.goml | 1 + src/test/rustdoc-gui/escape-key.goml | 2 ++ src/test/rustdoc-gui/font-weight.goml | 2 +- src/test/rustdoc-gui/huge-collection-of-constants.goml | 4 ++-- src/test/rustdoc-gui/list_code_block.goml | 1 + src/test/rustdoc-gui/search-filter.goml | 1 + src/test/rustdoc-gui/search-result-colors.goml | 1 + src/test/rustdoc-gui/search-result-display.goml | 1 + src/test/rustdoc-gui/search-result-keyword.goml | 1 + .../rustdoc-gui/search-tab-selection-if-current-is-empty.goml | 2 ++ src/test/rustdoc-gui/sidebar.goml | 1 + src/test/rustdoc-gui/source-code-page.goml | 1 + src/test/rustdoc-gui/theme-change.goml | 1 + src/test/rustdoc-gui/toggle-docs-mobile.goml | 2 ++ src/test/rustdoc-gui/toggle-docs.goml | 1 + src/test/rustdoc-gui/trait-sidebar-item-order.goml | 1 + 17 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/test/rustdoc-gui/check_info_sign_position.goml b/src/test/rustdoc-gui/check_info_sign_position.goml index 94e3fe79c9451..3bed7a0a03ea5 100644 --- a/src/test/rustdoc-gui/check_info_sign_position.goml +++ b/src/test/rustdoc-gui/check_info_sign_position.goml @@ -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 diff --git a/src/test/rustdoc-gui/code-sidebar-toggle.goml b/src/test/rustdoc-gui/code-sidebar-toggle.goml index 6fb92e196602e..1818f0dbcdf41 100644 --- a/src/test/rustdoc-gui/code-sidebar-toggle.goml +++ b/src/test/rustdoc-gui/code-sidebar-toggle.goml @@ -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" diff --git a/src/test/rustdoc-gui/escape-key.goml b/src/test/rustdoc-gui/escape-key.goml index 712920b16a91b..9cff12f3e4131 100644 --- a/src/test/rustdoc-gui/escape-key.goml +++ b/src/test/rustdoc-gui/escape-key.goml @@ -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") diff --git a/src/test/rustdoc-gui/font-weight.goml b/src/test/rustdoc-gui/font-weight.goml index a64ac8b422fc0..5f29fde6689bf 100644 --- a/src/test/rustdoc-gui/font-weight.goml +++ b/src/test/rustdoc-gui/font-weight.goml @@ -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']", diff --git a/src/test/rustdoc-gui/huge-collection-of-constants.goml b/src/test/rustdoc-gui/huge-collection-of-constants.goml index 4f7fe7a212c92..4f75b5841ee5e 100644 --- a/src/test/rustdoc-gui/huge-collection-of-constants.goml +++ b/src/test/rustdoc-gui/huge-collection-of-constants.goml @@ -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]", diff --git a/src/test/rustdoc-gui/list_code_block.goml b/src/test/rustdoc-gui/list_code_block.goml index 7d3490e9d9410..eba1a662b9fa8 100644 --- a/src/test/rustdoc-gui/list_code_block.goml +++ b/src/test/rustdoc-gui/list_code_block.goml @@ -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") diff --git a/src/test/rustdoc-gui/search-filter.goml b/src/test/rustdoc-gui/search-filter.goml index e5cdf3ea7a169..98ca40512ee3c 100644 --- a/src/test/rustdoc-gui/search-filter.goml +++ b/src/test/rustdoc-gui/search-filter.goml @@ -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") diff --git a/src/test/rustdoc-gui/search-result-colors.goml b/src/test/rustdoc-gui/search-result-colors.goml index b4eb896af1c7e..872df5fc3f95b 100644 --- a/src/test/rustdoc-gui/search-result-colors.goml +++ b/src/test/rustdoc-gui/search-result-colors.goml @@ -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. diff --git a/src/test/rustdoc-gui/search-result-display.goml b/src/test/rustdoc-gui/search-result-display.goml index 3162a067d2107..823ea67b1b055 100644 --- a/src/test/rustdoc-gui/search-result-display.goml +++ b/src/test/rustdoc-gui/search-result-display.goml @@ -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") diff --git a/src/test/rustdoc-gui/search-result-keyword.goml b/src/test/rustdoc-gui/search-result-keyword.goml index 5342d431d992f..8b50c5c5e1a5b 100644 --- a/src/test/rustdoc-gui/search-result-keyword.goml +++ b/src/test/rustdoc-gui/search-result-keyword.goml @@ -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... diff --git a/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml b/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml index a61ec672ae6e6..52b3ceae7b115 100644 --- a/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml +++ b/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml @@ -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... diff --git a/src/test/rustdoc-gui/sidebar.goml b/src/test/rustdoc-gui/sidebar.goml index a117552585820..c7abe896be1d1 100644 --- a/src/test/rustdoc-gui/sidebar.goml +++ b/src/test/rustdoc-gui/sidebar.goml @@ -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"} diff --git a/src/test/rustdoc-gui/source-code-page.goml b/src/test/rustdoc-gui/source-code-page.goml index f3682f59d2141..375ff4878e525 100644 --- a/src/test/rustdoc-gui/source-code-page.goml +++ b/src/test/rustdoc-gui/source-code-page.goml @@ -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. diff --git a/src/test/rustdoc-gui/theme-change.goml b/src/test/rustdoc-gui/theme-change.goml index 5221cda2f1fb6..60d089ffa3758 100644 --- a/src/test/rustdoc-gui/theme-change.goml +++ b/src/test/rustdoc-gui/theme-change.goml @@ -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" diff --git a/src/test/rustdoc-gui/toggle-docs-mobile.goml b/src/test/rustdoc-gui/toggle-docs-mobile.goml index e7a75b43c5a02..b502692300113 100644 --- a/src/test/rustdoc-gui/toggle-docs-mobile.goml +++ b/src/test/rustdoc-gui/toggle-docs-mobile.goml @@ -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": ""}) diff --git a/src/test/rustdoc-gui/toggle-docs.goml b/src/test/rustdoc-gui/toggle-docs.goml index e11aae21e3fa6..480d6242ac611 100644 --- a/src/test/rustdoc-gui/toggle-docs.goml +++ b/src/test/rustdoc-gui/toggle-docs.goml @@ -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", "[−]") diff --git a/src/test/rustdoc-gui/trait-sidebar-item-order.goml b/src/test/rustdoc-gui/trait-sidebar-item-order.goml index 739745792c2a1..38942baa0b597 100644 --- a/src/test/rustdoc-gui/trait-sidebar-item-order.goml +++ b/src/test/rustdoc-gui/trait-sidebar-item-order.goml @@ -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")