|
| 1 | +*** Settings *** |
| 2 | +Suite Setup Setup Suite For Screenshots highlights |
| 3 | +Test Setup Setup Highlights Test |
| 4 | +Test Teardown Clean Up After Working With File Highlights.ipynb |
| 5 | +Force Tags feature:highlights |
| 6 | +Resource ../Keywords.robot |
| 7 | + |
| 8 | +*** Test Cases *** |
| 9 | +# cursor is symbolized by pipe (|), for example when |
| 10 | +# it is at the end of line, after `1` in `test = 1` |
| 11 | +# it is presented as: `test = 1|` |
| 12 | +Highlights work at the start of a token |
| 13 | + Enter Cell Editor 1 line=1 |
| 14 | + Press Keys None END # cursor to the end of first line (`test = 1|`) |
| 15 | + Should Not Highlight Any Tokens |
| 16 | + Press Keys None HOME # cursor before the token (`|test = 1`) |
| 17 | + Should Highlight Token test |
| 18 | + Should Not Highlight Token gist |
| 19 | + |
| 20 | +Highlights work at the end of a token |
| 21 | + Enter Cell Editor 1 line=1 |
| 22 | + Press Keys None END # cursor to the end of first line (`test = 1|`) |
| 23 | + Press Keys None DOWN # cursor to the end of the token in second line (`test`) |
| 24 | + Should Highlight Token test |
| 25 | + Should Not Highlight Token gist |
| 26 | + |
| 27 | +Highlights are changed when moving cursor between cells |
| 28 | + [Documentation] GH431 |
| 29 | + Enter Cell Editor 1 line=2 |
| 30 | + Press Keys None END # cursor after the token in second line (`test|`) |
| 31 | + Should Highlight Token test |
| 32 | + Should Not Highlight Token gist |
| 33 | + Press Keys None DOWN # cursor to next cell, which is empty |
| 34 | + Should Not Highlight Any Tokens |
| 35 | + Press Keys None DOWN # cursor to third cell (`|gist = 1`) |
| 36 | + Should Highlight Token gist |
| 37 | + Press Keys None DOWN # cursor to third cell, second line (`|test `) |
| 38 | + Should Highlight Token test |
| 39 | + |
| 40 | +Highlights are added after typing |
| 41 | + Enter Cell Editor 1 line=2 |
| 42 | + Should Highlight Token test |
| 43 | + Press Keys None a |
| 44 | + Should Highlight Token testa |
| 45 | + |
| 46 | +*** Keywords *** |
| 47 | +Should Not Highlight Any Tokens |
| 48 | + Page Should Not Contain css:.cm-lsp-highlight |
| 49 | + |
| 50 | +Should Highlight Token |
| 51 | + [Arguments] ${token} ${timeout}=10s |
| 52 | + ${token_element} Set Variable xpath://span[contains(@class, 'cm-lsp-highlight')][contains(text(), '${token}')] |
| 53 | + Wait Until Page Contains Element ${token_element} timeout=${timeout} |
| 54 | + |
| 55 | +Should Not Highlight Token |
| 56 | + [Arguments] ${token} ${timeout}=10s |
| 57 | + ${token_element} Set Variable xpath://span[contains(@class, 'cm-lsp-highlight')][contains(text(), '${token}')] |
| 58 | + Wait Until Page Does Not Contain Element ${token_element} timeout=${timeout} |
| 59 | + |
| 60 | +Setup Highlights Test |
| 61 | + Setup Notebook Python Highlights.ipynb |
0 commit comments