@@ -4,31 +4,60 @@ Force Tags feature:jump-to-definition gh:403
4
4
Resource ../Keywords.robot
5
5
6
6
*** Variables ***
7
- ${FOLDER WITH SPACE } a földer
7
+ ${FOLDER WITH SPACE } a föl@der
8
8
9
9
*** Test Cases ***
10
- Python Jumps between Files
10
+ Python Jumps Between Files
11
11
Copy Files to Folder With Spaces jump_a.py jump_b.py
12
- ${def } = Set Variable a_function_definition
13
12
Open ${FOLDER WITH SPACE } /jump_b.py in ${MENU EDITOR }
14
13
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
16
15
Jump To Definition ${sel }
17
16
Wait Until Page Contains ANOTHER_CONSTANT
18
17
Capture Page Screenshot 10-jumped.png
19
18
Clean Up After Working With File jump_b.py
20
19
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
+
21
52
Ctrl Click And Jumping Back Works
22
53
[Setup] Prepare File for Editing Python editor jump.py
23
54
Configure JupyterLab Plugin {"modifierKey": "Accel"} plugin id=${JUMP PLUGIN ID }
24
55
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
27
57
Click Element ${sel }
28
58
${original } = Measure Cursor Position
29
59
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 }
32
61
Capture Page Screenshot 02-jumped.png
33
62
Wait Until Keyword Succeeds 10 x 1 s Cursor Should Jump ${original }
34
63
${new } = Measure Cursor Position
@@ -47,3 +76,16 @@ Copy Files to Folder With Spaces
47
76
FOR ${file } IN @{files }
48
77
Copy File examples${/ }${file } ${NOTEBOOK DIR }${/ }${FOLDER WITH SPACE }${/ }${file }
49
78
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