summaryrefslogtreecommitdiffstats
path: root/src/test/rustdoc-gui/search-result-display.goml
blob: efbbfb925bd3bf1cf29a21978f034a29e913c359 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Checks that the search results have the expected width.
goto: file://|DOC_PATH|/test_docs/index.html
size: (900, 1000)
write: (".search-input", "test")
// To be SURE that the search will be run.
press-key: 'Enter'
wait-for: "#crate-search"
// The width is returned by "getComputedStyle" which returns the exact number instead of the
// CSS rule which is "50%"...
assert-css: (".search-results div.desc", {"width": "293px"})
size: (600, 100)
// As counter-intuitive as it may seem, in this width, the width is "100%", which is why
// when computed it's larger.
assert-css: (".search-results div.desc", {"width": "566px"})

// The result set is all on one line.
assert-css: (".search-results .result-name > span", {"display": "inline"})

// Check that the crate filter `<select>` is correctly handled when it goes to next line.
// To do so we need to update the length of one of its `<option>`.
size: (900, 900)

// First we check the current width, height and position.
assert-css: ("#crate-search", {"width": "223px"})
assert-css: (".search-results-title", {"height": "44px", "width": "336px"})

// Then we update the text of one of the `<option>`.
text: (
    "#crate-search option",
    "sdjfaksdjfaksjdbfkadsbfkjsadbfkdsbkfbsadkjfbkdsabfkadsfkjdsafa",
)

// Then we compare again to confirm the height didn't change.
assert-css: ("#crate-search", {"width": "527px"})
assert-css: (".search-results-title", {"height": "44px", "width": "640px"})
// And we check that the `<select>` isn't bigger than its container (".search-results-title").
assert-css: ("#search", {"width": "640px"})