]>
Commit | Line | Data |
---|---|---|
2b03887a FG |
1 | // This test checks the position of the `i` for the notable traits. |
2 | goto: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html" | |
3 | show-text: true | |
4 | // We start with a wide screen. | |
5 | size: (1100, 600) | |
6 | // Checking they have the same y position. | |
7 | compare-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. | |
13 | compare-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. | |
19 | assert-position: ( | |
20 | "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", | |
21 | {"x": 677}, | |
22 | ) | |
23 | assert-position: ( | |
24 | "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", | |
25 | {"x": 951}, | |
26 | ) | |
27 | // The tooltip should be beside the `i` | |
28 | click: "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']" | |
29 | compare-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 | ) | |
34 | compare-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. | |
40 | assert-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. | |
46 | size: (1055, 600) | |
47 | compare-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. | |
54 | size: (980, 600) | |
55 | // Checking they have the same y position. | |
56 | compare-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. | |
62 | compare-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. | |
68 | assert-position: ( | |
69 | "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", | |
70 | {"x": 245}, | |
71 | ) | |
72 | assert-position: ( | |
73 | "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", | |
74 | {"x": 519}, | |
75 | ) | |
76 | ||
77 | // Checking on mobile now. | |
78 | size: (650, 600) | |
79 | // Checking they have the same y position. | |
80 | compare-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. | |
86 | compare-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. | |
92 | assert-position: ( | |
93 | "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", | |
94 | {"x": 15}, | |
95 | ) | |
96 | assert-position: ( | |
97 | "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", | |
98 | {"x": 289}, | |
99 | ) | |
100 | // The tooltip should be below `i` | |
101 | compare-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 | ) | |
106 | compare-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 | ) | |
111 | compare-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. | |
117 | assert-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. | |
123 | size: (365, 600) | |
124 | compare-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 | ) |