1 // The goal of this test is to ensure the color of the text is the one expected.
2 goto: file://|DOC_PATH|/test_docs/index.html?search=coo
4 // This is needed so that the text color is computed.
9 "rustdoc-theme": "ayu",
10 "rustdoc-preferred-dark-theme": "ayu",
11 "rustdoc-use-system-theme": "false",
15 // Waiting for the search results to appear...
18 "//*[@class='desc']//*[text()='Just a normal struct.']",
19 {"color": "rgb(197, 197, 197)"},
22 "//*[@class='result-name']/*[text()='test_docs::']",
23 {"color": "rgb(0, 150, 207)"},
26 // Checking the color for "keyword".
28 "//*[@class='result-name']//*[text()='(keyword)']",
29 {"color": "rgb(120, 135, 151)"},
32 // Checking the `<a>` container.
34 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
35 {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
38 // Checking color and background on hover.
39 move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
41 "//*[@class='result-name']/*[text()='test_docs::']",
42 {"color": "rgb(255, 255, 255)"},
45 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
46 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
51 "rustdoc-theme": "dark",
52 "rustdoc-preferred-dark-theme": "dark",
53 "rustdoc-use-system-theme": "false",
57 // Waiting for the search results to appear...
60 "//*[@class='desc']//*[text()='Just a normal struct.']",
61 {"color": "rgb(221, 221, 221)"},
64 "//*[@class='result-name']/*[text()='test_docs::']",
65 {"color": "rgb(221, 221, 221)"},
68 // Checking the color for "keyword".
70 "//*[@class='result-name']//*[text()='(keyword)']",
71 {"color": "rgb(221, 221, 221)"},
74 // Checking the `<a>` container.
76 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
77 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
80 // Checking color and background on hover.
81 move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
83 "//*[@class='result-name']/*[text()='test_docs::']",
84 {"color": "rgb(221, 221, 221)"},
87 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
88 {"color": "rgb(221, 221, 221)", "background-color": "rgb(119, 119, 119)"},
92 local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
95 // Waiting for the search results to appear...
98 "//*[@class='desc']//*[text()='Just a normal struct.']",
99 {"color": "rgb(0, 0, 0)"},
102 "//*[@class='result-name']/*[text()='test_docs::']",
103 {"color": "rgb(0, 0, 0)"},
106 // Checking the color for "keyword".
108 "//*[@class='result-name']//*[text()='(keyword)']",
109 {"color": "rgb(0, 0, 0)"},
112 // Checking the `<a>` container.
114 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
115 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
118 // Checking color and background on hover.
119 move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
121 "//*[@class='result-name']/*[text()='test_docs::']",
122 {"color": "rgb(0, 0, 0)"},
125 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
126 {"color": "rgb(0, 0, 0)", "background-color": "rgb(221, 221, 221)"},
129 // Check the alias more specifically in the dark theme.
130 goto: file://|DOC_PATH|/test_docs/index.html
131 // We set the theme so we're sure that the correct values will be used, whatever the computer
132 // this test is running on.
134 "rustdoc-theme": "dark",
135 "rustdoc-preferred-dark-theme": "dark",
136 "rustdoc-use-system-theme": "false",
138 // If the text isn't displayed, the browser doesn't compute color style correctly...
140 // We reload the page so the local storage settings are being used.
142 write: (".search-input", "thisisanalias")
143 // To be SURE that the search will be run.
145 // Waiting for the search results to appear...
147 // Checking that the colors for the alias element are the ones expected.
148 assert-css: (".result-name > .alias", {"color": "rgb(255, 255, 255)"})
149 assert-css: (".result-name > .alias > .grey", {"color": "rgb(204, 204, 204)"})