]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/search-reexport.goml
Auto merge of #98637 - cjgillot:bare-trait-anon-lt, r=petrochenkov
[rust.git] / src / test / rustdoc-gui / search-reexport.goml
1 // Checks that the reexports are present in the search index, can have
2 // doc aliases and are highligted when their ID is the hash of the page.
3 goto: file://|DOC_PATH|/test_docs/index.html
4 local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
5 reload:
6 // First we check that the reexport has the correct ID and no background color.
7 assert-text: ("//*[@id='reexport.TheStdReexport']", "pub use ::std as TheStdReexport;")
8 assert-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgba(0, 0, 0, 0)"})
9 write: (".search-input", "TheStdReexport")
10 wait-for: "//a[@class='result-import']"
11 assert-attribute: (
12     "//a[@class='result-import']",
13     {"href": "../test_docs/index.html#reexport.TheStdReexport"},
14 )
15 assert-text: ("//a[@class='result-import']", "test_docs::TheStdReexport")
16 click: "//a[@class='result-import']"
17 // We check that it has the background modified thanks to the focus.
18 wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgb(73, 74, 61)"})
19
20 // We now check that the alias is working as well on the reexport.
21 write: (".search-input", "AliasForTheStdReexport")
22 wait-for: "//a[@class='result-import']"
23 assert-text: (
24     "//a[@class='result-import']",
25     "AliasForTheStdReexport - see test_docs::TheStdReexport",
26 )
27 // Same thing again, we click on it to ensure the background is once again set as expected.
28 click: "//a[@class='result-import']"
29 wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgb(73, 74, 61)"})