|
| 1 | +*** Settings *** |
| 2 | +Suite Setup Setup Suite For Screenshots style |
| 3 | +Force Tags ui:editor aspect:style |
| 4 | +Resource Keywords.robot |
| 5 | +Resource Variables.robot |
| 6 | +Library Collections |
| 7 | + |
| 8 | +*** Variables *** |
| 9 | +${THEME NAMES} ${EMPTY} |
| 10 | + |
| 11 | +*** Test Cases *** |
| 12 | +Light |
| 13 | + Screenshot Editor Themes with Lab Theme JupyterLab Light |
| 14 | + |
| 15 | +Dark |
| 16 | + Screenshot Editor Themes with Lab Theme JupyterLab Dark |
| 17 | + |
| 18 | +*** Keywords *** |
| 19 | +Screenshot Editor Themes with Lab Theme |
| 20 | + [Arguments] ${lab theme} ${file}=example.py |
| 21 | + ${norm lab theme} = Set Variable ${lab theme.lower().replace(" ", "-")} |
| 22 | + Set Tags theme:lab:${norm lab theme} |
| 23 | + Set Screenshot Directory ${OUTPUT DIR}${/}style${/}${norm lab theme} |
| 24 | + Copy File examples${/}${file} ${OUTPUT DIR}${/}home${/}${file} |
| 25 | + Run Keyword If "${THEME NAMES}" == "" Wait Until Keyword Succeeds 3x 1s Get Theme Names |
| 26 | + Lab Command Use ${lab theme} Theme |
| 27 | + Try to Close All Tabs |
| 28 | + Open ${file} in ${MENU EDITOR} |
| 29 | + Capture Page Screenshot 00-opened.png |
| 30 | + FOR ${editor theme} IN @{THEME NAMES} |
| 31 | + Capture Theme Screenshot ${editor theme} |
| 32 | + END |
| 33 | + [Teardown] Clean Up After Working With File ${file} |
| 34 | + |
| 35 | +Capture Theme Screenshot |
| 36 | + [Arguments] ${editor theme} |
| 37 | + Change Editor Theme ${editor theme} |
| 38 | + Wait Until Fully Initialized |
| 39 | + Wait Until Page Contains Element css:.cm-lsp-diagnostic timeout=20s |
| 40 | + Click the second Accumulate |
| 41 | + Capture Page Screenshot ${editor theme.replace(' ', '-')}.png |
| 42 | + |
| 43 | +Click the second Accumulate |
| 44 | + Click Element xpath://span[text()\='accumulate'][2] |
| 45 | + |
| 46 | +Change Editor Theme |
| 47 | + [Arguments] ${editor theme} |
| 48 | + Open Editor Theme Menu |
| 49 | + ${sel} = Set Variable xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), "${editor theme}")] |
| 50 | + Wait Until Page Contains Element ${sel} |
| 51 | + Mouse Over ${sel} |
| 52 | + Click Element ${sel} |
| 53 | + |
| 54 | +Open Editor Theme Menu |
| 55 | + Wait Until Page Contains Element ${MENU SETTINGS} |
| 56 | + Mouse Over ${MENU SETTINGS} |
| 57 | + Click Element ${MENU SETTINGS} |
| 58 | + Wait Until Page Contains Element ${MENU EDITOR THEME} |
| 59 | + Mouse Over ${MENU EDITOR THEME} |
| 60 | + Click Element ${MENU EDITOR THEME} |
| 61 | + |
| 62 | +Get Theme Names |
| 63 | + Open Editor Theme Menu |
| 64 | + ${els} = Get WebElements css:[data-command\="codemirror:change-theme"] |
| 65 | + ${theme names} = Create List |
| 66 | + FOR ${element} IN @{els} |
| 67 | + Append To List ${theme names} ${element.text} |
| 68 | + END |
| 69 | + Set Suite Variable ${THEME NAMES} ${theme names} |
0 commit comments