]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/search-result-go-to-first.goml
Rollup merge of #100567 - Rageking8:fix-100563, r=wesleywiser
[rust.git] / src / test / rustdoc-gui / search-result-go-to-first.goml
1 // This test ensures that the "go_to_first" feature is working as expected.
2
3 // First, we check that the first page doesn't have the string we're looking for to ensure
4 // that the feature is changing page as expected.
5 goto: file://|DOC_PATH|/test_docs/index.html
6 assert-text-false: (".fqn .in-band", "Struct test_docs::Foo")
7
8 // We now check that we land on the search result page if "go_to_first" isn't set.
9 goto: file://|DOC_PATH|/test_docs/index.html?search=struct%3AFoo
10 // Waiting for the search results to appear...
11 wait-for: "#titles"
12 assert-text-false: (".fqn .in-band", "Struct test_docs::Foo")
13 // Ensure that the search results are displayed, not the "normal" content.
14 assert-css: ("#main-content", {"display": "none"})
15
16 // Now we can check that the feature is working as expected!
17 goto: file://|DOC_PATH|/test_docs/index.html?search=struct%3AFoo&go_to_first=true
18 // Waiting for the page to load...
19 wait-for-text: (".fqn .in-band", "Struct test_docs::Foo")