forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#102008 - GuillaumeGomez:notable-trait-gui-t…
…est, r=notriddle Add GUI test for notable traits element position Fixes rust-lang#101891. r? ``@notriddle``
- Loading branch information
Showing
2 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// This test checks the position of the `i` for the notable traits. | ||
goto: file://|DOC_PATH|/test_docs/struct.NotableStructWithLongName.html | ||
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']", | ||
{"x": 692}, | ||
) | ||
assert-position: ( | ||
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", | ||
{"x": 966}, | ||
) | ||
|
||
|
||
// 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}, | ||
) | ||
|
||
// Checking on very small mobile. The `i` should be on its own line. | ||
size: (410, 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"), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters