|
1 | 1 | // Checks that the "crate pages" have all the same style (ie: not centered). |
| 2 | +include: "utils.goml" |
2 | 3 | go-to: |DOC_PATH| + "/crate/sysinfo" |
| 4 | +// Big enough to have "margin: auto" to kick in. |
| 5 | +set-window-size: (1300, 800) |
3 | 6 |
|
4 | 7 | store-value: (tabs_menu_selector, ".description-container .pure-menu-horizontal ul.pure-menu-list") |
5 | 8 | store-value: (current_tab, 1) |
6 | | - |
7 | | -define-function: ( |
8 | | - "check-tab", |
9 | | - [tab_name, click_next], |
10 | | - block { |
11 | | - // We check the tab's name is the one expected. |
12 | | - assert-text: (|tabs_menu_selector| + " > li a.pure-menu-active .title", |tab_name|) |
13 | | - // We check it also matches the one we clicked. |
14 | | - assert: |tabs_menu_selector| + " > li:nth-of-type(" + |current_tab| + ") a.pure-menu-active" |
15 | | - // We ensure that the content of the page is not centered. |
16 | | - assert: "body:not(.centered)" |
17 | | - assert-css: ("div.container", {"margin": "0px"}) |
18 | | - if: (|click_next|, block { |
19 | | - store-value: (current_tab, |current_tab| + 1) |
20 | | - click: |tabs_menu_selector| + " > li:nth-of-type(" + |current_tab| + ")" |
21 | | - }) |
22 | | - } |
23 | | -) |
| 9 | +store-value: (nb_tabs, 4) |
24 | 10 |
|
25 | 11 | // If this assert fails, it means we added new entries for this menu so this test needs to be |
26 | 12 | // updated. |
27 | | -assert-count: (|tabs_menu_selector| + " > li", 4) |
| 13 | +assert-count: (|tabs_menu_selector| + " > li", |nb_tabs|) |
| 14 | + |
| 15 | +call-function: ("check-tab-not-centered", {"tab_name": " Crate", "click_next": true}) |
| 16 | +call-function: ("check-tab-not-centered", {"tab_name": " Source", "click_next": true}) |
| 17 | +call-function: ("check-tab-not-centered", {"tab_name": " Builds", "click_next": true}) |
| 18 | +call-function: ("check-tab-not-centered", {"tab_name": "Feature flags", "click_next": false}) |
28 | 19 |
|
29 | | -call-function: ("check-tab", {"tab_name": " Crate", "click_next": true}) |
30 | | -call-function: ("check-tab", {"tab_name": " Source", "click_next": true}) |
31 | | -call-function: ("check-tab", {"tab_name": " Builds", "click_next": true}) |
32 | | -call-function: ("check-tab", {"tab_name": "Feature flags", "click_next": false}) |
| 20 | +assert: |nb_tabs| == |current_tab| |
0 commit comments