]> git.proxmox.com Git - rustc.git/blame - src/test/rustdoc-gui/notable-trait.goml
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / rustdoc-gui / notable-trait.goml
CommitLineData
2b03887a
FG
1// This test checks the position of the `i` for the notable traits.
2goto: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html"
3show-text: true
4// We start with a wide screen.
5size: (1100, 600)
6// Checking they have the same y position.
7compare-elements-position: (
8 "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
9 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
10 ("y"),
11)
12// Checking they don't have the same x position.
13compare-elements-position-false: (
14 "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
15 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
16 ("x"),
17)
18// The `i` should be *after* the type.
19assert-position: (
20 "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
21 {"x": 677},
22)
23assert-position: (
24 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
25 {"x": 951},
26)
27// The tooltip should be beside the `i`
28click: "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']"
29compare-elements-position-near: (
30 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
31 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
32 {"y": 2}
33)
34compare-elements-position-false: (
35 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
36 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
37 ("x")
38)
39// The docblock should be flush with the border.
40assert-css: (
41 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']",
42 {"margin-left": "0px"}
43)
44
45// Now only the `i` should be on the next line.
46size: (1055, 600)
47compare-elements-position-false: (
48 "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
49 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
50 ("y", "x"),
51)
52
53// Now both the `i` and the struct name should be on the next line.
54size: (980, 600)
55// Checking they have the same y position.
56compare-elements-position: (
57 "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
58 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
59 ("y"),
60)
61// Checking they don't have the same x position.
62compare-elements-position-false: (
63 "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
64 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
65 ("x"),
66)
67// The `i` should be *after* the type.
68assert-position: (
69 "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
70 {"x": 245},
71)
72assert-position: (
73 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
74 {"x": 519},
75)
76
77// Checking on mobile now.
78size: (650, 600)
79// Checking they have the same y position.
80compare-elements-position: (
81 "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
82 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
83 ("y"),
84)
85// Checking they don't have the same x position.
86compare-elements-position-false: (
87 "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
88 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
89 ("x"),
90)
91// The `i` should be *after* the type.
92assert-position: (
93 "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
94 {"x": 15},
95)
96assert-position: (
97 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
98 {"x": 289},
99)
100// The tooltip should be below `i`
101compare-elements-position-near-false: (
102 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
103 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
104 {"y": 2}
105)
106compare-elements-position-false: (
107 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
108 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
109 ("x")
110)
111compare-elements-position-near: (
112 "//*[@id='method.create_an_iterator_from_read']/parent::*",
113 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
114 {"x": 5}
115)
116// The docblock should be flush with the border.
117assert-css: (
118 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']",
119 {"margin-left": "0px"}
120)
121
122// Checking on very small mobile. The `i` should be on its own line.
123size: (365, 600)
124compare-elements-position-false: (
125 "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
126 "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
127 ("y", "x"),
128)