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-use-system-theme": "false",
14 // Waiting for the search results to appear...
17 "//*[@class='desc']//*[text()='Just a normal struct.']",
18 {"color": "rgb(197, 197, 197)"},
21 "//*[@class='result-name']/*[text()='test_docs::']",
22 {"color": "rgb(0, 150, 207)"},
25 // Checking the color of "keyword" text.
27 "//*[@class='result-name']//*[text()='(keyword)']",
28 {"color": "rgb(120, 135, 151)"},
31 // Checking the color of "keyword".
33 ".result-name .keyword",
34 {"color": "rgb(57, 175, 215)"},
37 // Check the color of "struct".
39 ".result-name .struct",
40 {"color": "rgb(255, 160, 165)"},
43 // Check the color of "associated type".
45 ".result-name .associatedtype",
46 {"color": "rgb(57, 175, 215)"},
49 // Check the color of "type method".
51 ".result-name .tymethod",
52 {"color": "rgb(253, 214, 135)"},
55 // Check the color of "method".
57 ".result-name .method",
58 {"color": "rgb(253, 214, 135)"},
61 // Check the color of "struct field".
63 ".result-name .structfield",
64 {"color": "rgb(0, 150, 207)"},
67 // Check the color of "macro".
69 ".result-name .macro",
70 {"color": "rgb(163, 122, 204)"},
73 // Check the color of "fn".
76 {"color": "rgb(253, 214, 135)"},
80 // Checking the `<a>` container.
82 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
83 {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
87 // Checking color and background on hover.
88 move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
90 "//*[@class='result-name']/*[text()='test_docs::']",
91 {"color": "rgb(255, 255, 255)"},
94 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
95 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
100 "rustdoc-theme": "dark",
101 "rustdoc-use-system-theme": "false",
105 // Waiting for the search results to appear...
108 "//*[@class='desc']//*[text()='Just a normal struct.']",
109 {"color": "rgb(221, 221, 221)"},
112 "//*[@class='result-name']/*[text()='test_docs::']",
113 {"color": "rgb(221, 221, 221)"},
116 // Checking the color for "keyword".
118 "//*[@class='result-name']//*[text()='(keyword)']",
119 {"color": "rgb(221, 221, 221)"},
122 // Checking the color of "keyword".
124 ".result-name .keyword",
125 {"color": "rgb(210, 153, 29)"},
128 // Check the color of "struct".
130 ".result-name .struct",
131 {"color": "rgb(45, 191, 184)"},
134 // Check the color of "associated type".
136 ".result-name .associatedtype",
137 {"color": "rgb(210, 153, 29)"},
140 // Check the color of "type method".
142 ".result-name .tymethod",
143 {"color": "rgb(43, 171, 99)"},
146 // Check the color of "method".
148 ".result-name .method",
149 {"color": "rgb(43, 171, 99)"},
152 // Check the color of "struct field".
154 ".result-name .structfield",
155 {"color": "rgb(221, 221, 221)"},
158 // Check the color of "macro".
160 ".result-name .macro",
161 {"color": "rgb(9, 189, 0)"},
164 // Check the color of "fn".
167 {"color": "rgb(43, 171, 99)"},
171 // Checking the `<a>` container.
173 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
174 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
177 // Checking color and background on hover.
178 move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
180 "//*[@class='result-name']/*[text()='test_docs::']",
181 {"color": "rgb(221, 221, 221)"},
184 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
185 {"color": "rgb(221, 221, 221)", "background-color": "rgb(119, 119, 119)"},
189 local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
192 // Waiting for the search results to appear...
195 "//*[@class='desc']//*[text()='Just a normal struct.']",
196 {"color": "rgb(0, 0, 0)"},
199 "//*[@class='result-name']/*[text()='test_docs::']",
200 {"color": "rgb(0, 0, 0)"},
203 // Checking the color for "keyword".
205 "//*[@class='result-name']//*[text()='(keyword)']",
206 {"color": "rgb(0, 0, 0)"},
209 // Checking the color of "keyword".
211 ".result-name .keyword",
212 {"color": "rgb(56, 115, 173)"},
215 // Check the color of "struct".
217 ".result-name .struct",
218 {"color": "rgb(173, 55, 138)"},
221 // Check the color of "associated type".
223 ".result-name .associatedtype",
224 {"color": "rgb(56, 115, 173)"},
227 // Check the color of "type method".
229 ".result-name .tymethod",
230 {"color": "rgb(173, 124, 55)"},
233 // Check the color of "method".
235 ".result-name .method",
236 {"color": "rgb(173, 124, 55)"},
239 // Check the color of "struct field".
241 ".result-name .structfield",
242 {"color": "rgb(0, 0, 0)"},
245 // Check the color of "macro".
247 ".result-name .macro",
248 {"color": "rgb(6, 128, 0)"},
251 // Check the color of "fn".
254 {"color": "rgb(173, 124, 55)"},
258 // Checking the `<a>` container.
260 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
261 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
264 // Checking color and background on hover.
265 move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
267 "//*[@class='result-name']/*[text()='test_docs::']",
268 {"color": "rgb(0, 0, 0)"},
271 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
272 {"color": "rgb(0, 0, 0)", "background-color": "rgb(221, 221, 221)"},
275 // Check the alias more specifically in the dark theme.
276 goto: file://|DOC_PATH|/test_docs/index.html
277 // We set the theme so we're sure that the correct values will be used, whatever the computer
278 // this test is running on.
280 "rustdoc-theme": "dark",
281 "rustdoc-use-system-theme": "false",
283 // If the text isn't displayed, the browser doesn't compute color style correctly...
285 // We reload the page so the local storage settings are being used.
287 write: (".search-input", "thisisanalias")
288 // To be SURE that the search will be run.
290 // Waiting for the search results to appear...
292 // Checking that the colors for the alias element are the ones expected.
293 assert-css: (".result-name > .alias", {"color": "rgb(255, 255, 255)"})
294 assert-css: (".result-name > .alias > .grey", {"color": "rgb(204, 204, 204)"})