|
| 1 | +// Checks that the "crate pages" have all the same style (ie: not centered). |
| 2 | +go-to: |DOC_PATH| + "/crate/sysinfo" |
| 3 | + |
| 4 | +store-value: (tabs_menu_selector, ".description-container .pure-menu-horizontal ul.pure-menu-list") |
| 5 | +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 | +) |
| 24 | + |
| 25 | +// If this assert fails, it means we added new entries for this menu so this test needs to be |
| 26 | +// updated. |
| 27 | +assert-count: (|tabs_menu_selector| + " > li", 4) |
| 28 | + |
| 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}) |
0 commit comments