@@ -4,31 +4,60 @@ Force Tags feature:jump-to-definition gh:403
44Resource ../Keywords.robot
55
66*** Variables ***
7- ${FOLDER WITH SPACE } a földer
7+ ${FOLDER WITH SPACE } a föl@der
88
99*** Test Cases ***
10- Python Jumps between Files
10+ Python Jumps Between Files
1111 Copy Files to Folder With Spaces jump_a.py jump_b.py
12- ${def } = Set Variable a_function_definition
1312 Open ${FOLDER WITH SPACE } /jump_b.py in ${MENU EDITOR }
1413 Wait Until Fully Initialized
15- ${sel } = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), ' ${ def } ')])[last()]
14+ ${sel } = Select Token Occurrence a_function_definition
1615 Jump To Definition ${sel }
1716 Wait Until Page Contains ANOTHER_CONSTANT
1817 Capture Page Screenshot 10-jumped.png
1918 Clean Up After Working With File jump_b.py
2019
20+ Jumps To References With Modifier Click
21+ [Setup] Prepare File for Editing Python editor jump_references.py
22+ Configure JupyterLab Plugin {"modifierKey": "Accel"} plugin id=${JUMP PLUGIN ID }
23+ Wait Until Fully Initialized
24+ ${token } = Select Token Occurrence func type=def
25+ Click Element ${token }
26+ ${original } = Measure Cursor Position
27+ Ctrl Click Element ${token }
28+ Wait Until Page Contains Choose the jump target
29+ ${references_count } = Get Element Count css:.jp-Dialog select option
30+ Should Be True ${references_count } == ${3 }
31+ Select From List By Index css:.jp-Dialog select 2
32+ Click Element css:.jp-Dialog-button.jp-mod-accept
33+ Wait Until Keyword Succeeds 10 x 1 s Cursor Should Jump ${original }
34+ Clean Up After Working With File jump_references.py
35+
36+ Jumps To References From Context Menu
37+ [Setup] Prepare File for Editing Python editor jump_references.py
38+ Wait Until Fully Initialized
39+ ${token } = Select Token Occurrence func type=def
40+ Click Element ${token }
41+ ${original } = Measure Cursor Position
42+ Open Context Menu Over ${token }
43+ Select Menu Entry Jump to references
44+ Wait Until Page Contains Choose the jump target
45+ ${references_count } = Get Element Count css:.jp-Dialog select option
46+ Should Be True ${references_count } == ${3 }
47+ Select From List By Index css:.jp-Dialog select 2
48+ Click Element css:.jp-Dialog-button.jp-mod-accept
49+ Wait Until Keyword Succeeds 10 x 1 s Cursor Should Jump ${original }
50+ Clean Up After Working With File jump_references.py
51+
2152Ctrl Click And Jumping Back Works
2253 [Setup] Prepare File for Editing Python editor jump.py
2354 Configure JupyterLab Plugin {"modifierKey": "Accel"} plugin id=${JUMP PLUGIN ID }
2455 Wait Until Fully Initialized
25- ${usage } = Set Variable a_variable
26- ${sel } = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), '${usage } ')])[last()]
56+ ${sel } = Select Token Occurrence a_variable
2757 Click Element ${sel }
2858 ${original } = Measure Cursor Position
2959 Capture Page Screenshot 01-ready-to-jump.png
30- ${key } = Evaluate 'COMMAND' if platform.system() == 'Darwin' else 'CTRL' platform
31- Click Element ${sel } modifier=${key }
60+ Ctrl Click Element ${sel }
3261 Capture Page Screenshot 02-jumped.png
3362 Wait Until Keyword Succeeds 10 x 1 s Cursor Should Jump ${original }
3463 ${new } = Measure Cursor Position
@@ -47,3 +76,16 @@ Copy Files to Folder With Spaces
4776 FOR ${file } IN @{files }
4877 Copy File examples${/ }${file } ${NOTEBOOK DIR }${/ }${FOLDER WITH SPACE }${/ }${file }
4978 END
79+
80+ Select Token Occurrence
81+ [Arguments] ${token } ${type } =variable ${which } =last
82+ [Return] xpath:(//span[contains(@class, 'cm-${type } ')][contains(text(), '${token } ')])[${which } ()]
83+
84+ Ctrl Click Element
85+ [Arguments] ${element }
86+ ${key } = Evaluate 'COMMAND' if platform.system() == 'Darwin' else 'CTRL' platform
87+ Click Element ${element } modifier=${key }
88+
89+ Should Have Expected Count
90+ [Arguments] ${expected_count }
91+ ${count } = Count Diagnostics In Panel
0 commit comments