2022-09-19 12:32:30 +02:00
|
|
|
// This test checks the position of the `i` for the notable traits.
|
2022-10-07 20:17:05 +02:00
|
|
|
goto: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html"
|
2022-09-19 12:32:30 +02:00
|
|
|
show-text: true
|
|
|
|
// We start with a wide screen.
|
|
|
|
size: (1100, 600)
|
|
|
|
// Checking they have the same y position.
|
|
|
|
compare-elements-position: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
("y"),
|
|
|
|
)
|
|
|
|
// Checking they don't have the same x position.
|
|
|
|
compare-elements-position-false: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
("x"),
|
|
|
|
)
|
|
|
|
// The `i` should be *after* the type.
|
|
|
|
assert-position: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
|
2022-09-22 11:51:48 -07:00
|
|
|
{"x": 677},
|
2022-09-19 12:32:30 +02:00
|
|
|
)
|
|
|
|
assert-position: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
2022-09-22 11:51:48 -07:00
|
|
|
{"x": 951},
|
2022-09-19 12:32:30 +02:00
|
|
|
)
|
2022-10-26 14:42:53 -07:00
|
|
|
// The tooltip should be beside the `i`
|
|
|
|
click: "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']"
|
|
|
|
compare-elements-position-near: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
|
|
|
|
{"y": 2}
|
|
|
|
)
|
|
|
|
compare-elements-position-false: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
|
|
|
|
("x")
|
|
|
|
)
|
|
|
|
// The docblock should be flush with the border.
|
|
|
|
assert-css: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']",
|
|
|
|
{"margin-left": "0px"}
|
|
|
|
)
|
2022-09-19 12:32:30 +02:00
|
|
|
|
|
|
|
// Now only the `i` should be on the next line.
|
|
|
|
size: (1055, 600)
|
|
|
|
compare-elements-position-false: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
("y", "x"),
|
|
|
|
)
|
|
|
|
|
|
|
|
// Now both the `i` and the struct name should be on the next line.
|
|
|
|
size: (980, 600)
|
|
|
|
// Checking they have the same y position.
|
|
|
|
compare-elements-position: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
("y"),
|
|
|
|
)
|
|
|
|
// Checking they don't have the same x position.
|
|
|
|
compare-elements-position-false: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
("x"),
|
|
|
|
)
|
|
|
|
// The `i` should be *after* the type.
|
|
|
|
assert-position: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
|
|
|
|
{"x": 245},
|
|
|
|
)
|
|
|
|
assert-position: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
{"x": 519},
|
|
|
|
)
|
|
|
|
|
|
|
|
// Checking on mobile now.
|
|
|
|
size: (650, 600)
|
|
|
|
// Checking they have the same y position.
|
|
|
|
compare-elements-position: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
("y"),
|
|
|
|
)
|
|
|
|
// Checking they don't have the same x position.
|
|
|
|
compare-elements-position-false: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
("x"),
|
|
|
|
)
|
|
|
|
// The `i` should be *after* the type.
|
|
|
|
assert-position: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
|
|
|
|
{"x": 15},
|
|
|
|
)
|
|
|
|
assert-position: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
{"x": 289},
|
|
|
|
)
|
2022-10-26 14:42:53 -07:00
|
|
|
// The tooltip should be below `i`
|
|
|
|
compare-elements-position-near-false: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
|
|
|
|
{"y": 2}
|
|
|
|
)
|
|
|
|
compare-elements-position-false: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
|
|
|
|
("x")
|
|
|
|
)
|
|
|
|
compare-elements-position-near: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']/parent::*",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
|
|
|
|
{"x": 5}
|
|
|
|
)
|
|
|
|
// The docblock should be flush with the border.
|
|
|
|
assert-css: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']",
|
|
|
|
{"margin-left": "0px"}
|
|
|
|
)
|
2022-09-19 12:32:30 +02:00
|
|
|
|
|
|
|
// Checking on very small mobile. The `i` should be on its own line.
|
2022-09-21 17:29:47 -07:00
|
|
|
size: (365, 600)
|
2022-09-19 12:32:30 +02:00
|
|
|
compare-elements-position-false: (
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
|
|
|
|
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
|
|
|
|
("y", "x"),
|
|
|
|
)
|