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-keyword .keyword",
34 {"color": "rgb(57, 175, 215)"},
39 {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
41 move-cursor-to: ".result-keyword"
43 ".result-keyword:hover",
44 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
47 ".result-keyword:hover .keyword",
48 {"color": "rgb(57, 175, 215)"},
50 move-cursor-to: ".search-input"
51 focus: ".result-keyword"
53 ".result-keyword:focus",
54 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
57 ".result-keyword:focus .keyword",
58 {"color": "rgb(57, 175, 215)"},
61 // Check the color of "struct".
63 ".result-struct .struct",
64 {"color": "rgb(255, 160, 165)"},
69 {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
71 move-cursor-to: ".result-struct"
73 ".result-struct:hover",
74 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
77 ".result-struct:hover .struct",
78 {"color": "rgb(255, 160, 165)"},
80 move-cursor-to: ".search-input"
81 focus: ".result-struct"
83 ".result-struct:focus",
84 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
87 ".result-struct:focus .struct",
88 {"color": "rgb(255, 160, 165)"},
91 // Check the color of "associated type".
93 ".result-associatedtype .associatedtype",
94 {"color": "rgb(57, 175, 215)"},
98 ".result-associatedtype",
99 {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
101 move-cursor-to: ".result-associatedtype"
103 ".result-associatedtype:hover",
104 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
107 ".result-associatedtype:hover .associatedtype",
108 {"color": "rgb(57, 175, 215)"},
110 move-cursor-to: ".search-input"
111 focus: ".result-associatedtype"
113 ".result-associatedtype:focus",
114 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
117 ".result-associatedtype:focus .associatedtype",
118 {"color": "rgb(57, 175, 215)"},
121 // Check the color of "type method".
123 ".result-tymethod .tymethod",
124 {"color": "rgb(253, 214, 135)"},
129 {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
132 ".result-tymethod .tymethod",
133 {"color": "rgb(253, 214, 135)"},
135 move-cursor-to: ".result-tymethod"
137 ".result-tymethod:hover",
138 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
140 move-cursor-to: ".search-input"
141 focus: ".result-tymethod"
143 ".result-tymethod:focus",
144 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
147 // Check the color of "method".
149 ".result-method .method",
150 {"color": "rgb(253, 214, 135)"},
155 {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
157 move-cursor-to: ".result-method"
159 ".result-method:hover",
160 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
163 ".result-method:hover .method",
164 {"color": "rgb(253, 214, 135)"},
166 move-cursor-to: ".search-input"
167 focus: ".result-method"
169 ".result-method:focus",
170 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
173 ".result-method:focus .method",
174 {"color": "rgb(253, 214, 135)"},
177 // Check the color of "struct field".
179 ".result-structfield .structfield",
180 {"color": "rgb(0, 150, 207)"},
184 ".result-structfield",
185 {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
187 move-cursor-to: ".result-structfield"
189 ".result-structfield:hover",
190 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
193 ".result-structfield:hover .structfield",
194 {"color": "rgb(255, 255, 255)"},
196 move-cursor-to: ".search-input"
197 focus: ".result-structfield"
199 ".result-structfield:focus",
200 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
203 ".result-structfield:focus .structfield",
204 {"color": "rgb(255, 255, 255)"},
207 // Check the color of "macro".
209 ".result-macro .macro",
210 {"color": "rgb(163, 122, 204)"},
215 {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
217 move-cursor-to: ".result-macro"
219 ".result-macro:hover",
220 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
223 ".result-macro:hover .macro",
224 {"color": "rgb(163, 122, 204)"},
226 move-cursor-to: ".search-input"
227 focus: ".result-macro"
229 ".result-macro:focus",
230 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
233 ".result-macro:focus .macro",
234 {"color": "rgb(163, 122, 204)"},
237 // Check the color of "fn".
240 {"color": "rgb(253, 214, 135)"},
245 {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
247 move-cursor-to: ".result-fn"
250 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
253 ".result-fn:hover .fn",
254 {"color": "rgb(253, 214, 135)"},
256 move-cursor-to: ".search-input"
260 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
263 ".result-fn:focus .fn",
264 {"color": "rgb(253, 214, 135)"},
267 // Checking the `<a>` container.
268 move-cursor-to: ".search-input"
269 focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
271 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
272 {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
276 // Checking color and background on hover.
277 move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
279 "//*[@class='result-name']/*[text()='test_docs::']",
280 {"color": "rgb(255, 255, 255)"},
283 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
284 {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
289 "rustdoc-theme": "dark",
290 "rustdoc-use-system-theme": "false",
294 // Waiting for the search results to appear...
297 "//*[@class='desc']//*[text()='Just a normal struct.']",
298 {"color": "rgb(221, 221, 221)"},
301 "//*[@class='result-name']/*[text()='test_docs::']",
302 {"color": "rgb(221, 221, 221)"},
305 // Checking the color for "keyword" text.
307 "//*[@class='result-name']//*[text()='(keyword)']",
308 {"color": "rgb(221, 221, 221)"},
311 // Checking the color of "keyword".
313 ".result-keyword .keyword",
314 {"color": "rgb(210, 153, 29)"},
319 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
321 move-cursor-to: ".result-keyword"
323 ".result-keyword:hover",
324 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
327 ".result-keyword:hover .keyword",
328 {"color": "rgb(210, 153, 29)"},
330 move-cursor-to: ".search-input"
331 focus: ".result-keyword"
333 ".result-keyword:focus",
334 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
337 ".result-keyword:focus .keyword",
338 {"color": "rgb(210, 153, 29)"},
341 // Check the color of "struct".
343 ".result-struct .struct",
344 {"color": "rgb(45, 191, 184)"},
349 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
351 move-cursor-to: ".result-struct"
353 ".result-struct:hover",
354 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
357 ".result-struct:hover .struct",
358 {"color": "rgb(45, 191, 184)"},
360 move-cursor-to: ".search-input"
361 focus: ".result-struct"
363 ".result-struct:focus",
364 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
367 ".result-struct:focus .struct",
368 {"color": "rgb(45, 191, 184)"},
371 // Check the color of "associated type".
373 ".result-associatedtype .associatedtype",
374 {"color": "rgb(210, 153, 29)"},
378 ".result-associatedtype",
379 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
381 move-cursor-to: ".result-associatedtype"
383 ".result-associatedtype:hover",
384 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
387 ".result-associatedtype:hover .associatedtype",
388 {"color": "rgb(210, 153, 29)"},
390 move-cursor-to: ".search-input"
391 focus: ".result-associatedtype"
393 ".result-associatedtype:focus",
394 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
397 ".result-associatedtype:focus .associatedtype",
398 {"color": "rgb(210, 153, 29)"},
401 // Check the color of "type method".
403 ".result-tymethod .tymethod",
404 {"color": "rgb(43, 171, 99)"},
409 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
411 move-cursor-to: ".result-tymethod"
413 ".result-tymethod:hover",
414 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
417 ".result-tymethod:hover .tymethod",
418 {"color": "rgb(43, 171, 99)"},
420 move-cursor-to: ".search-input"
421 focus: ".result-tymethod"
423 ".result-tymethod:focus",
424 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
427 ".result-tymethod:focus .tymethod",
428 {"color": "rgb(43, 171, 99)"},
431 // Check the color of "method".
433 ".result-method .method",
434 {"color": "rgb(43, 171, 99)"},
439 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
441 move-cursor-to: ".result-method"
443 ".result-method:hover",
444 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
447 ".result-method:hover .method",
448 {"color": "rgb(43, 171, 99)"},
450 move-cursor-to: ".search-input"
451 focus: ".result-method"
453 ".result-method:focus",
454 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
457 ".result-method:focus .method",
458 {"color": "rgb(43, 171, 99)"},
461 // Check the color of "struct field".
463 ".result-structfield .structfield",
464 {"color": "rgb(221, 221, 221)"},
468 ".result-structfield",
469 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
471 move-cursor-to: ".result-structfield"
473 ".result-structfield:hover",
474 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
477 ".result-structfield:hover .structfield",
478 {"color": "rgb(221, 221, 221)"},
480 move-cursor-to: ".search-input"
481 focus: ".result-structfield"
483 ".result-structfield:focus",
484 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
487 ".result-structfield:focus .structfield",
488 {"color": "rgb(221, 221, 221)"},
491 // Check the color of "macro".
493 ".result-macro .macro",
494 {"color": "rgb(9, 189, 0)"},
499 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
501 move-cursor-to: ".result-macro"
503 ".result-macro:hover",
504 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
507 ".result-macro:hover .macro",
508 {"color": "rgb(9, 189, 0)"},
510 move-cursor-to: ".search-input"
511 focus: ".result-macro"
513 ".result-macro:focus",
514 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
517 ".result-macro:focus .macro",
518 {"color": "rgb(9, 189, 0)"},
521 // Check the color of "fn".
524 {"color": "rgb(43, 171, 99)"},
529 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
531 move-cursor-to: ".result-fn"
534 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
537 ".result-fn:hover .fn",
538 {"color": "rgb(43, 171, 99)"},
540 move-cursor-to: ".search-input"
544 {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
547 ".result-fn:focus .fn",
548 {"color": "rgb(43, 171, 99)"},
551 // Checking the `<a>` container.
552 move-cursor-to: ".search-input"
553 focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
555 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
556 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
560 local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
563 // Waiting for the search results to appear...
566 "//*[@class='desc']//*[text()='Just a normal struct.']",
567 {"color": "rgb(0, 0, 0)"},
570 "//*[@class='result-name']/*[text()='test_docs::']",
571 {"color": "rgb(0, 0, 0)"},
574 // Checking the color for "keyword" text.
576 "//*[@class='result-name']//*[text()='(keyword)']",
577 {"color": "rgb(0, 0, 0)"},
580 // Checking the color of "keyword".
582 ".result-keyword .keyword",
583 {"color": "rgb(56, 115, 173)"},
588 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
590 move-cursor-to: ".result-keyword"
592 ".result-keyword:hover",
593 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
596 ".result-keyword:hover .keyword",
597 {"color": "rgb(56, 115, 173)"},
599 move-cursor-to: ".search-input"
600 focus: ".result-keyword"
602 ".result-keyword:focus",
603 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
606 ".result-keyword:focus .keyword",
607 {"color": "rgb(56, 115, 173)"},
610 // Check the color of "struct".
612 ".result-struct .struct",
613 {"color": "rgb(173, 55, 138)"},
618 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
620 move-cursor-to: ".result-struct"
622 ".result-struct:hover",
623 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
626 ".result-struct:hover .struct",
627 {"color": "rgb(173, 55, 138)"},
629 move-cursor-to: ".search-input"
630 focus: ".result-struct"
632 ".result-struct:focus",
633 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
636 ".result-struct:focus .struct",
637 {"color": "rgb(173, 55, 138)"},
640 // Check the color of "associated type".
642 ".result-associatedtype .associatedtype",
643 {"color": "rgb(56, 115, 173)"},
647 ".result-associatedtype",
648 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
650 move-cursor-to: ".result-associatedtype"
652 ".result-associatedtype:hover",
653 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
656 ".result-associatedtype:hover .associatedtype",
657 {"color": "rgb(56, 115, 173)"},
659 move-cursor-to: ".search-input"
660 focus: ".result-associatedtype"
662 ".result-associatedtype:focus",
663 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
666 ".result-associatedtype:focus .associatedtype",
667 {"color": "rgb(56, 115, 173)"},
670 // Check the color of "type method".
672 ".result-tymethod .tymethod",
673 {"color": "rgb(173, 124, 55)"},
678 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
680 move-cursor-to: ".result-tymethod"
682 ".result-tymethod:hover",
683 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
686 ".result-tymethod:hover .tymethod",
687 {"color": "rgb(173, 124, 55)"},
689 move-cursor-to: ".search-input"
690 focus: ".result-tymethod"
692 ".result-tymethod:focus",
693 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
696 ".result-tymethod:focus .tymethod",
697 {"color": "rgb(173, 124, 55)"},
700 // Check the color of "method".
702 ".result-method .method",
703 {"color": "rgb(173, 124, 55)"},
708 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
710 move-cursor-to: ".result-method"
712 ".result-method:hover",
713 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
716 ".result-method:hover .method",
717 {"color": "rgb(173, 124, 55)"},
719 move-cursor-to: ".search-input"
720 focus: ".result-method"
722 ".result-method:focus",
723 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
726 ".result-method:focus .method",
727 {"color": "rgb(173, 124, 55)"},
730 // Check the color of "struct field".
732 ".result-structfield .structfield",
733 {"color": "rgb(0, 0, 0)"},
737 ".result-structfield",
738 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
740 move-cursor-to: ".result-structfield"
742 ".result-structfield:hover",
743 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
746 ".result-structfield:hover .structfield",
747 {"color": "rgb(0, 0, 0)"},
749 move-cursor-to: ".search-input"
750 focus: ".result-structfield"
752 ".result-structfield:focus",
753 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
756 ".result-structfield:focus .structfield",
757 {"color": "rgb(0, 0, 0)"},
760 // Check the color of "macro".
762 ".result-macro .macro",
763 {"color": "rgb(6, 128, 0)"},
768 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
770 move-cursor-to: ".result-macro"
772 ".result-macro:hover",
773 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
776 ".result-macro:hover .macro",
777 {"color": "rgb(6, 128, 0)"},
779 move-cursor-to: ".search-input"
780 focus: ".result-macro"
782 ".result-macro:focus",
783 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
786 ".result-macro:focus .macro",
787 {"color": "rgb(6, 128, 0)"},
790 // Check the color of "fn".
793 {"color": "rgb(173, 124, 55)"},
798 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
800 move-cursor-to: ".result-fn"
803 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
806 ".result-fn:hover .fn",
807 {"color": "rgb(173, 124, 55)"},
809 move-cursor-to: ".search-input"
813 {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
816 ".result-fn:focus .fn",
817 {"color": "rgb(173, 124, 55)"},
820 // Checking the `<a>` container.
821 move-cursor-to: ".search-input"
822 focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
824 "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
825 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
828 // Check the alias more specifically in the dark theme.
829 goto: file://|DOC_PATH|/test_docs/index.html
830 // We set the theme so we're sure that the correct values will be used, whatever the computer
831 // this test is running on.
833 "rustdoc-theme": "dark",
834 "rustdoc-use-system-theme": "false",
836 // If the text isn't displayed, the browser doesn't compute color style correctly...
838 // We reload the page so the local storage settings are being used.
840 write: (".search-input", "thisisanalias")
841 // To be SURE that the search will be run.
843 // Waiting for the search results to appear...
845 // Checking that the colors for the alias element are the ones expected.
846 assert-css: (".result-name > .alias", {"color": "rgb(255, 255, 255)"})
847 assert-css: (".result-name > .alias > .grey", {"color": "rgb(204, 204, 204)"})