fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.6 KiB33 linesraw
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.
3go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
4set-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
5reload:
6// First we check that the reexport has the correct ID and no background color.
7assert-text: ("//*[@id='reexport.TheStdReexport']", "pub use ::std as TheStdReexport;")
8assert-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgba(0, 0, 0, 0)"})
9write: (".search-input", "TheStdReexport")
10// To be SURE that the search will be run.
11press-key: 'Enter'
12wait-for: "//a[@class='result-import']"
13assert-attribute: (
14    "//a[@class='result-import']",
15    {"href": "../test_docs/index.html#reexport.TheStdReexport"},
16)
17assert-text: ("a.result-import .result-name", "re-export test_docs::TheStdReexport")
18click: "//a[@class='result-import']"
19// We check that it has the background modified thanks to the focus.
20wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "#494a3d"})
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.
24press-key: 'Enter'
25write: (".search-input", "AliasForTheStdReexport")
26wait-for: "//a[@class='result-import']"
27assert-text: (
28    "a.result-import .result-name",
29    "re-export AliasForTheStdReexport - see test_docs::TheStdReexport",
30)
31// Same thing again, we click on it to ensure the background is once again set as expected.
32click: "//a[@class='result-import']"
33wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "#494a3d"})