2022-01-21 19:41:47 +00:00
|
|
|
// Checks that the search results have the expected width.
|
2021-05-22 14:41:26 +00:00
|
|
|
goto: file://|DOC_PATH|/test_docs/index.html
|
|
|
|
size: (900, 1000)
|
|
|
|
write: (".search-input", "test")
|
2022-07-16 11:53:43 +00:00
|
|
|
// To be SURE that the search will be run.
|
|
|
|
press-key: 'Enter'
|
2022-08-10 13:50:20 +00:00
|
|
|
wait-for: "#crate-search"
|
2021-05-22 14:41:26 +00:00
|
|
|
// The width is returned by "getComputedStyle" which returns the exact number instead of the
|
|
|
|
// CSS rule which is "50%"...
|
2022-09-22 18:51:48 +00:00
|
|
|
assert-css: (".search-results div.desc", {"width": "318px"})
|
2021-05-22 14:41:26 +00:00
|
|
|
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.
|
2022-09-09 18:48:43 +00:00
|
|
|
assert-css: (".search-results div.desc", {"width": "566px"})
|
2022-07-09 13:54:36 +00:00
|
|
|
|
2022-09-12 21:04:11 +00:00
|
|
|
// The result set is all on one line.
|
|
|
|
assert-css: (".search-results .result-name > span", {"display": "inline"})
|
|
|
|
|
2022-07-09 13:54:36 +00:00
|
|
|
// 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)
|
|
|
|
|
2022-08-10 13:50:20 +00:00
|
|
|
// First we check the current width, height and position.
|
|
|
|
assert-css: ("#crate-search", {"width": "223px"})
|
|
|
|
assert-css: (".search-results-title", {"height": "44px", "width": "336px"})
|
2022-07-09 13:54:36 +00:00
|
|
|
|
2022-08-10 13:50:20 +00:00
|
|
|
// Then we update the text of one of the `<option>`.
|
|
|
|
text: (
|
|
|
|
"#crate-search option",
|
|
|
|
"sdjfaksdjfaksjdbfkadsbfkjsadbfkdsbkfbsadkjfbkdsabfkadsfkjdsafa",
|
|
|
|
)
|
2022-07-09 13:54:36 +00:00
|
|
|
|
2022-08-10 13:50:20 +00:00
|
|
|
// 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"})
|