]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/search-reexport.goml
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / 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 // To be SURE that the search will be run.
11 press-key: 'Enter'
12 wait-for: "//a[@class='result-import']"
13 assert-attribute: (
14     "//a[@class='result-import']",
15     {"href": "../test_docs/index.html#reexport.TheStdReexport"},
16 )
17 assert-text: ("//a[@class='result-import']", "test_docs::TheStdReexport")
18 click: "//a[@class='result-import']"
19 // We check that it has the background modified thanks to the focus.
20 wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgb(73, 74, 61)"})
21
22 // We now check that the alias is working as well on the reexport.
23 // To be SURE that the search will be run.
24 press-key: 'Enter'
25 write: (".search-input", "AliasForTheStdReexport")
26 wait-for: "//a[@class='result-import']"
27 assert-text: (
28     "//a[@class='result-import']",
29     "AliasForTheStdReexport - see test_docs::TheStdReexport",
30 )
31 // Same thing again, we click on it to ensure the background is once again set as expected.
32 click: "//a[@class='result-import']"
33 wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgb(73, 74, 61)"})