]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/search-form-elements.goml
Rollup merge of #107740 - oli-obk:lock_tcx, r=petrochenkov
[rust.git] / tests / rustdoc-gui / search-form-elements.goml
1 // This test ensures that the elements in ".search-form" have the expected display.
2 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
3 show-text: true
4
5 // Ayu theme
6 local-storage: {
7     "rustdoc-theme": "ayu",
8     "rustdoc-use-system-theme": "false",
9 }
10 reload:
11
12 assert-css: (
13     ".search-input",
14     {
15         "border-color": "rgb(92, 103, 115)",
16         "background-color": "rgb(20, 25, 32)",
17         "color": "rgb(255, 255, 255)",
18     },
19 )
20 focus: ".search-input"
21 // Nothing should change.
22 assert-css: (
23     ".search-input",
24     {
25         "border-color": "rgb(92, 103, 115)",
26         "background-color": "rgb(20, 25, 32)",
27         "color": "rgb(255, 255, 255)",
28     },
29 )
30
31 assert-css: (
32     "#help-button",
33     {"border-color": "rgb(197, 197, 197)"},
34 )
35 assert-css: (
36     "#help-button > a",
37     {
38         "color": "rgb(255, 255, 255)",
39         "border-color": "rgb(92, 103, 115)",
40         "background-color": "rgb(20, 25, 32)",
41     },
42 )
43 move-cursor-to: "#help-button"
44 assert-css: (
45     "#help-button:hover",
46     {"border-color": "rgb(197, 197, 197)"},
47 )
48 // Only "border-color" should change.
49 assert-css: (
50     "#help-button:hover > a",
51     {
52         "color": "rgb(255, 255, 255)",
53         "border-color": "rgb(224, 224, 224)",
54         "background-color": "rgb(20, 25, 32)",
55     },
56 )
57 // Link color inside
58 click: "#help-button"
59 assert-css: (
60     "#help a",
61     {
62         "color": "rgb(57, 175, 215)",
63     },
64 )
65
66 assert-css: (
67     "#settings-menu",
68     {"border-color": "rgb(197, 197, 197)"},
69 )
70 assert-css: (
71     "#settings-menu > a",
72     {
73         "border-color": "rgb(92, 103, 115)",
74         "background-color": "rgb(20, 25, 32)",
75     },
76 )
77 move-cursor-to: "#settings-menu"
78 assert-css: (
79     "#settings-menu:hover",
80     {"border-color": "rgb(197, 197, 197)"},
81 )
82 // Only "border-color" should change.
83 assert-css: (
84     "#settings-menu:hover > a",
85     {
86         "border-color": "rgb(224, 224, 224)",
87         "background-color": "rgb(20, 25, 32)",
88     },
89 )
90
91 // Dark theme
92 local-storage: {
93     "rustdoc-theme": "dark",
94     "rustdoc-use-system-theme": "false",
95 }
96 reload:
97
98 assert-css: (
99     ".search-input",
100     {
101         "border-color": "rgb(224, 224, 224)",
102         "background-color": "rgb(240, 240, 240)",
103         "color": "rgb(17, 17, 17)",
104     },
105 )
106 focus: ".search-input"
107 // Only "border-color" should change.
108 assert-css: (
109     ".search-input",
110     {
111         "border-color": "rgb(0, 141, 253)",
112         "background-color": "rgb(240, 240, 240)",
113         "color": "rgb(17, 17, 17)",
114     },
115 )
116
117 assert-css: (
118     "#help-button",
119     {"border-color": "rgb(221, 221, 221)"},
120 )
121 assert-css: (
122     "#help-button > a",
123     {
124         "color": "rgb(0, 0, 0)",
125         "border-color": "rgb(224, 224, 224)",
126         "background-color": "rgb(240, 240, 240)",
127     },
128 )
129 move-cursor-to: "#help-button"
130 assert-css: (
131     "#help-button:hover",
132     {"border-color": "rgb(221, 221, 221)"},
133 )
134 // Only "border-color" should change.
135 assert-css: (
136     "#help-button:hover > a",
137     {
138         "color": "rgb(0, 0, 0)",
139         "border-color": "rgb(255, 185, 0)",
140         "background-color": "rgb(240, 240, 240)",
141     },
142 )
143 // Link color inside
144 click: "#help-button"
145 assert-css: (
146     "#help a",
147     {
148         "color": "rgb(210, 153, 29)",
149     },
150 )
151
152 assert-css: (
153     "#settings-menu",
154     {"border-color": "rgb(221, 221, 221)"},
155 )
156 assert-css: (
157     "#settings-menu > a",
158     {
159         "border-color": "rgb(224, 224, 224)",
160         "background-color": "rgb(240, 240, 240)",
161     },
162 )
163 move-cursor-to: "#settings-menu"
164 assert-css: (
165     "#settings-menu:hover",
166     {"border-color": "rgb(221, 221, 221)"},
167 )
168 // Only "border-color" should change.
169 assert-css: (
170     "#settings-menu:hover > a",
171     {
172         "color": "rgb(0, 0, 0)",
173         "border-color": "rgb(255, 185, 0)",
174         "background-color": "rgb(240, 240, 240)",
175     },
176 )
177
178 // Light theme
179 local-storage: {
180     "rustdoc-theme": "light",
181     "rustdoc-use-system-theme": "false",
182 }
183 reload:
184
185 assert-css: (
186     ".search-input",
187     {
188         "border-color": "rgb(224, 224, 224)",
189         "background-color": "rgb(255, 255, 255)",
190         "color": "rgb(0, 0, 0)",
191     },
192 )
193 focus: ".search-input"
194 // Nothing should change.
195 assert-css: (
196     ".search-input",
197     {
198         "border-color": "rgb(102, 175, 233)",
199         "background-color": "rgb(255, 255, 255)",
200         "color": "rgb(0, 0, 0)",
201     },
202 )
203
204 assert-css: (
205     "#help-button",
206     {"border-color": "rgb(0, 0, 0)"},
207 )
208 assert-css: (
209     "#help-button > a",
210     {
211         "color": "rgb(0, 0, 0)",
212         "border-color": "rgb(224, 224, 224)",
213         "background-color": "rgb(255, 255, 255)",
214     },
215 )
216 move-cursor-to: "#help-button"
217 assert-css: (
218     "#help-button:hover",
219     {"border-color": "rgb(0, 0, 0)"},
220 )
221 // Only "border-color" should change.
222 assert-css: (
223     "#help-button:hover > a",
224     {
225         "color": "rgb(0, 0, 0)",
226         "border-color": "rgb(113, 113, 113)",
227         "background-color": "rgb(255, 255, 255)",
228     },
229 )
230 // Link color inside
231 click: "#help-button"
232 assert-css: (
233     "#help a",
234     {
235         "color": "rgb(56, 115, 173)",
236     },
237 )
238
239 assert-css: (
240     "#settings-menu",
241     {"border-color": "rgb(0, 0, 0)"},
242 )
243 assert-css: (
244     "#settings-menu > a",
245     {
246         "border-color": "rgb(224, 224, 224)",
247         "background-color": "rgb(255, 255, 255)",
248     },
249 )
250 move-cursor-to: "#settings-menu"
251 assert-css: (
252     "#settings-menu:hover",
253     {"border-color": "rgb(0, 0, 0)"},
254 )
255 // Only "border-color" should change.
256 assert-css: (
257     "#settings-menu:hover > a",
258     {
259         "color": "rgb(0, 0, 0)",
260         "border-color": "rgb(113, 113, 113)",
261         "background-color": "rgb(255, 255, 255)",
262     },
263 )