|
| 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 |
| 3 | + |
| 4 | +// This is needed so that the text color is computed. |
| 5 | +show-text: true |
| 6 | + |
| 7 | +// Ayu theme |
| 8 | +local-storage: {"rustdoc-theme": "ayu", "rustdoc-preferred-dark-theme": "ayu", "rustdoc-use-system-theme": "false"} |
| 9 | +reload: |
| 10 | + |
| 11 | +// Waiting for the search results to appear... |
| 12 | +wait-for: "#titles" |
| 13 | +assert-css: ("//*[@class='desc']//*[text()='Just a normal struct.']", {"color": "rgb(197, 197, 197)"}) |
| 14 | +assert-css: ("//*[@class='result-name']/*[text()='test_docs::']", {"color": "rgb(0, 150, 207)"}) |
| 15 | + |
| 16 | +// Checking the color for "keyword". |
| 17 | +assert-css: ("//*[@class='result-name']//*[text()='(keyword)']", {"color": "rgb(120, 135, 151)"}) |
| 18 | + |
| 19 | +// Dark theme |
| 20 | +local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"} |
| 21 | +reload: |
| 22 | + |
| 23 | +// Waiting for the search results to appear... |
| 24 | +wait-for: "#titles" |
| 25 | +assert-css: ("//*[@class='desc']//*[text()='Just a normal struct.']", {"color": "rgb(221, 221, 221)"}) |
| 26 | +assert-css: ("//*[@class='result-name']/*[text()='test_docs::']", {"color": "rgb(221, 221, 221)"}) |
| 27 | + |
| 28 | +// Checking the color for "keyword". |
| 29 | +assert-css: ("//*[@class='result-name']//*[text()='(keyword)']", {"color": "rgb(221, 221, 221)"}) |
| 30 | + |
| 31 | +// Light theme |
| 32 | +local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} |
| 33 | +reload: |
| 34 | + |
| 35 | +// Waiting for the search results to appear... |
| 36 | +wait-for: "#titles" |
| 37 | +assert-css: ("//*[@class='desc']//*[text()='Just a normal struct.']", {"color": "rgb(0, 0, 0)"}) |
| 38 | +assert-css: ("//*[@class='result-name']/*[text()='test_docs::']", {"color": "rgb(0, 0, 0)"}) |
| 39 | + |
| 40 | +// Checking the color for "keyword". |
| 41 | +assert-css: ("//*[@class='result-name']//*[text()='(keyword)']", {"color": "rgb(0, 0, 0)"}) |
0 commit comments