Skip to content

Commit

Permalink
YDA-5497: add UI tests for copy and move overwrite functionality
Browse files Browse the repository at this point in the history
Co-authored-by: Lazlo Westerhof <[email protected]>
  • Loading branch information
kaur16 and lwesterhof authored Dec 15, 2023
1 parent a01bec9 commit 9f9179b
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 12 deletions.
131 changes: 119 additions & 12 deletions tests/features/ui/ui_research.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ Feature: Research UI
And user browses to folder <folder>
Then file <file> exists in folder

Examples:
| folder | subfolder | file |
| research-initial | testdata | lorem.txt |
| research-initial | testdata | SIPI_Jelly_Beans_4.1.07.tiff |


Scenario Outline: Copy and overwrite a file
Given user researcher is logged in
And module "research" is shown
When user browses to folder <folder>
And user browses to subfolder <subfolder>
And user copies file <file> to <folder>
And user accepts overwriting file
And user browses to folder <folder>
Then file <file> exists in folder

Examples:
| folder | subfolder | file |
| research-initial | testdata | lorem.txt |
Expand All @@ -29,8 +45,8 @@ Feature: Research UI
Then file <file> exists in folder

Examples:
| folder | file | file_renamed |
| research-initial | lorem.txt | lorem_renamed.txt |
| folder | file | file_renamed |
| research-initial | lorem.txt | lorem_renamed.txt |


Scenario Outline: Moving a file
Expand All @@ -47,6 +63,21 @@ Feature: Research UI
| research-initial | testdata | lorem_renamed.txt |


Scenario Outline: Move and overwrite a file
Given user researcher is logged in
And module "research" is shown
When user browses to folder <folder>
And user moves file <file> to <subfolder>
And user accepts overwriting file
Then file <file> does not exist in folder
And user browses to subfolder <subfolder>
And file <file> exists in folder

Examples:
| folder | subfolder | file |
| research-initial | testdata | SIPI_Jelly_Beans_4.1.07.tiff |


Scenario Outline: Deleting a file
Given user researcher is logged in
And module "research" is shown
Expand All @@ -69,11 +100,12 @@ Feature: Research UI
Then folder <folder_new> exists in <folder>

Examples:
| folder | folder_new |
| research-initial | ui_test_folder1 |
| research-initial | ui_test_folder2 |
| research-initial | ui_test_copy |
| research-initial | ui_test_move |
| folder | folder_new |
| research-initial | ui_test_folder1 |
| research-initial | ui_test_folder2 |
| research-initial | ui_test_copy |
| research-initial | ui_test_move |
| research-initial | ui_test_overwrite |


Scenario Outline: Renaming a folder
Expand All @@ -97,6 +129,21 @@ Feature: Research UI
Then user browses to subfolder <folder_new>
And folder <folder_new> exists in <folder_old>

Examples:
| folder | folder_old | folder_new |
| research-initial | ui_test_copy | ui_test_move |
| research-initial | ui_test_overwrite | ui_test_copy |


Scenario Outline: Copying and overwriting a folder
Given user researcher is logged in
And module "research" is shown
When user browses to folder <folder>
And user copies folder <folder_old> to <folder_new>
And user accepts overwriting folder
Then user browses to subfolder <folder_new>
And folder <folder_new> exists in <folder_old>

Examples:
| folder | folder_old | folder_new |
| research-initial | ui_test_copy | ui_test_move |
Expand All @@ -115,6 +162,20 @@ Feature: Research UI
| research-initial | ui_test_move | ui_test_copy |


Scenario Outline: Moving and overwriting a folder
Given user researcher is logged in
And module "research" is shown
When user browses to folder <folder>
And user moves folder <folder_old> to <folder_new>
And user accepts overwriting folder
Then user browses to subfolder <folder_new>
And folder <folder_new> exists in <folder_old>

Examples:
| folder | folder_old | folder_new |
| research-initial | ui_test_overwrite | ui_test_copy |


Scenario Outline: Deleting a folder
Given user researcher is logged in
And module "research" is shown
Expand All @@ -139,8 +200,54 @@ Feature: Research UI
And files / folders do not exist in <folder_new>

Examples:
| folder | folder_new |
| research-initial | clone |
| folder | folder_new |
| research-initial | clone |


Scenario Outline: Multi-select copying files / folder
Given user researcher is logged in
And module "research" is shown
When user browses to folder <folder>
And user browses to subfolder <folder_new>
And user multi-select copies files / folders to <folder>
Then files / folders exist in <folder_new>
And module "research" is shown
And user browses to folder <folder>
And files / folders exist in <folder>

Examples:
| folder | folder_new |
| research-initial | clone |


Scenario Outline: Multi-select copying and overwriting files / folder
Given user researcher is logged in
And module "research" is shown
When user browses to folder <folder>
And user browses to subfolder <folder_new>
And user multi-select copies overwrites files / folders to <folder>
Then files / folders exist in <folder_new>
And module "research" is shown
And user browses to folder <folder>
And files / folders exist in <folder>

Examples:
| folder | folder_new |
| research-initial | clone |


Scenario Outline: Multi-select moving and overwriting files / folder
Given user researcher is logged in
And module "research" is shown
When user browses to folder <folder>
And user multi-select moves overwrites files / folders to <folder_new>
Then user browses to subfolder <folder_new>
And files / folders exist in <folder_new>
And files / folders do not exist in <folder_new>

Examples:
| folder | folder_new |
| research-initial | clone |


Scenario Outline: Multi-select copying files / folder
Expand All @@ -155,8 +262,8 @@ Feature: Research UI
And files / folders exist in <folder>

Examples:
| folder | folder_new |
| research-initial | clone |
| folder | folder_new |
| research-initial | clone |


Scenario Outline: Multi-select deleting files / folder
Expand Down Expand Up @@ -195,4 +302,4 @@ Feature: Research UI

Examples:
| folder | group |
| research-initial1 | research-initial1 |
| research-initial1 | research-initial1 |
40 changes: 40 additions & 0 deletions tests/step_defs/ui/test_ui_research.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ def ui_research_folder_move(browser, folder_old, folder_new):
browser.find_by_css('.dlg-action-button').click()


@when(parsers.parse("user accepts overwriting file"))
@when(parsers.parse("user accepts overwriting folder"))
def ui_research_overwrite(browser):
browser.find_by_css('.dlg-action-button').click()


@when(parsers.parse("user deletes folder {folder_delete}"))
def ui_research_folder_delete(browser, folder_delete):
browser.find_by_css('button[data-name={}]'.format(folder_delete)).click()
Expand All @@ -118,6 +124,23 @@ def ui_research_multi_move(browser, folder_new):
browser.find_by_id('finishMultiSelect').click()


@when(parsers.parse("user multi-select moves overwrites files / folders to {folder_new}"))
def ui_research_multi_move_overwrite(browser, folder_new):
browser.find_by_css('input[data-name="testdata"]').click()
browser.find_by_css('input[data-name="yoda-metadata.json"]').click()
browser.find_by_id('multiSelect').click()
browser.find_by_css('a.multiple-move').click()
time.sleep(1)
browser.links.find_by_partial_text(folder_new).click()
browser.find_by_css('.dlg-action-button').click()
time.sleep(1)
browser.find_by_css('.multi-overwrite-button').click()
time.sleep(1)
browser.find_by_css('.multi-overwrite-button').click()
time.sleep(1)
browser.find_by_id('finishMultiSelect').click()


@when(parsers.parse("user multi-select copies files / folders to {folder}"))
def ui_research_multi_copy(browser, folder):
browser.find_by_css('input[data-name="testdata"]').click()
Expand All @@ -131,6 +154,23 @@ def ui_research_multi_copy(browser, folder):
browser.find_by_id('finishMultiSelect').click()


@when(parsers.parse("user multi-select copies overwrites files / folders to {folder}"))
def ui_research_multi_copy_overwrite(browser, folder):
browser.find_by_css('input[data-name="testdata"]').click()
browser.find_by_css('input[data-name="yoda-metadata.json"]').click()
browser.find_by_id('multiSelect').click()
browser.find_by_css('a.multiple-copy').click()
time.sleep(1)
browser.find_by_css('[data-path="/{}"]'.format(folder)).click()
browser.find_by_css('.dlg-action-button').click()
time.sleep(1)
browser.find_by_css('.multi-overwrite-button').click()
time.sleep(1)
browser.find_by_css('.multi-overwrite-button').click()
time.sleep(1)
browser.find_by_id('finishMultiSelect').click()


@when(parsers.parse("user multi-select deletes files / folders"))
def ui_research_multi_delete(browser):
browser.find_by_css('input[data-name="testdata"]').click()
Expand Down

0 comments on commit 9f9179b

Please sign in to comment.