Skip to content

Commit 37f15f6

Browse files
committed
Cleanup folder in jump suite teardown
1 parent d63f100 commit 37f15f6

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

atest/05_Features/Jump.robot

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Python Jumps Between Files
1919
Jump To Definition ${sel}
2020
Wait Until Page Contains ANOTHER_CONSTANT
2121
Capture Page Screenshot 10-jumped.png
22-
Clean Up After Working With File jump_b.py
22+
[Teardown] Clean Up Folder With Spaces jump_a.py jump_b.py
2323

2424
Jumps To References With Modifier Click
2525
[Setup] Prepare File for Editing Python editor jump_references.py
@@ -35,7 +35,7 @@ Jumps To References With Modifier Click
3535
Select From List By Index css:.jp-Dialog select 2
3636
Click Element css:.jp-Dialog-button.jp-mod-accept
3737
Wait Until Keyword Succeeds 10 x 1 s Cursor Should Jump ${original}
38-
Clean Up After Working With File jump_references.py
38+
[Teardown] Clean Up After Working With File jump_references.py
3939

4040
Jumps To References From Context Menu
4141
[Setup] Prepare File for Editing Python editor jump_references.py
@@ -51,7 +51,7 @@ Jumps To References From Context Menu
5151
Select From List By Index css:.jp-Dialog select 2
5252
Click Element css:.jp-Dialog-button.jp-mod-accept
5353
Wait Until Keyword Succeeds 10 x 1 s Cursor Should Jump ${original}
54-
Clean Up After Working With File jump_references.py
54+
[Teardown] Clean Up After Working With File jump_references.py
5555

5656
Ctrl Click And Jumping Back Works
5757
[Setup] Prepare File for Editing Python editor jump.py
@@ -82,6 +82,15 @@ Copy Files to Folder With Spaces
8282
Copy File examples${/}${file} ${NOTEBOOK DIR}${/}${FOLDER WITH SPACE}${/}${file}
8383
END
8484

85+
Clean Up Folder With Spaces
86+
[Arguments] @{files}
87+
Try to Close All Tabs
88+
Navigate to Root Folder
89+
FOR ${file} IN @{files}
90+
Remove File ${NOTEBOOK DIR}${/}${FOLDER WITH SPACE}${/}${file}
91+
END
92+
Remove Directory ${NOTEBOOK DIR}${/}${FOLDER WITH SPACE} recursive=True
93+
8594
Select Token Occurrence
8695
[Arguments] ${token} ${type}=variable ${which}=last
8796
${sel} = Set Variable
@@ -92,7 +101,3 @@ Ctrl Click Element
92101
[Arguments] ${element}
93102
${key} = Evaluate 'COMMAND' if platform.system() == 'Darwin' else 'CTRL' platform
94103
Click Element ${element} modifier=${key}
95-
96-
Should Have Expected Count
97-
[Arguments] ${expected_count}
98-
${count} = Count Diagnostics In Panel

atest/Keywords.resource

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ Open Folder
257257
Double Click Element ${sel}
258258
END
259259

260+
Navigate to Root Folder
261+
Ensure File Browser is Open
262+
Click Element ${ROOT FOLDER}
263+
260264
Open ${file} in ${editor}
261265
${paths} = Set Variable ${file.split("/")}
262266
IF ${paths.__len__() > 1} Open Folder @{paths[:-1]}
@@ -267,12 +271,18 @@ Open ${file} in ${editor}
267271
Mouse Over ${editor}
268272
Click Element ${editor}
269273

270-
Clean Up After Working With File
271-
[Arguments] ${file}
272-
Remove File ${NOTEBOOK DIR}${/}${file}
274+
Clean Up After Working With Files
275+
[Arguments] @{files}
276+
FOR ${file} IN @{files}
277+
Remove File ${NOTEBOOK DIR}${/}${file}
278+
END
273279
Reset Application State
274280
Lab Log Should Not Contain Known Error Messages
275281

282+
Clean Up After Working With File
283+
[Arguments] ${file}
284+
Clean Up After Working With Files ${file}
285+
276286
Setup Notebook
277287
[Arguments] ${Language} ${file} ${isolated}=${True} ${wait}=${True}
278288
Set Tags language:${Language.lower()}

atest/Variables.resource

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ ${DIALOG WINDOW} css:.jp-Dialog
4141
${DIALOG INPUT} css:.jp-Input-Dialog input
4242
${DIALOG ACCEPT} css:button.jp-Dialog-button.jp-mod-accept
4343
${STATUSBAR} css:div.lsp-statusbar-item
44+
${ROOT FOLDER} css:.jp-BreadCrumbs-home
4445
${MENU EDITOR} xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(., "Editor")]
4546
${MENU JUMP}
4647
... xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), "Jump to definition")]

0 commit comments

Comments
 (0)