Skip to content

Commit

Permalink
YDA-5894: add empty checksum report UI tests
Browse files Browse the repository at this point in the history
Co-authored-by: Lazlo Westerhof <l.r.westerhof@uu.nl>
  • Loading branch information
leonidastri and lwesterhof authored Aug 26, 2024
1 parent cef34e5 commit a3e3b8e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/features/ui/ui_research.feature
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,21 @@ Feature: Research UI
| research-initial | ui_test_overwrite | ui_test_copy |


Scenario Outline: Checksum report of added empty folder
Given user researcher is logged in
And module "research" is shown
When user browses to folder <folder>
And user adds a new folder <folder_new>
And user browses to subfolder <folder_new>
And user open checksum report
Then user cannot download <format> checksum report

Examples:
| folder | folder_new | format |
| research-initial | ui_test_empty_checksum1 | csv |
| research-initial | ui_test_empty_checksum2 | txt |


Scenario Outline: Deleting a folder
Given user researcher is logged in
And module "research" is shown
Expand All @@ -188,7 +203,8 @@ Feature: Research UI
| research-initial | ui_test_folder1_renamed |
| research-initial | ui_test_folder2_renamed |
| research-initial | ui_test_copy |

| research-initial | ui_test_empty_checksum1 |
| research-initial | ui_test_empty_checksum2 |

Scenario Outline: Multi-select moving files / folder
Given user researcher is logged in
Expand Down
10 changes: 10 additions & 0 deletions tests/step_defs/ui/test_ui_research.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
then,
when,
)
from splinter.exceptions import ElementDoesNotExist

scenarios('../../features/ui/ui_research.feature')

Expand Down Expand Up @@ -307,3 +308,12 @@ def ui_research_checksum_report_downloaded(browser, tmpdir, format):
return

raise AssertionError()


@then(parsers.parse("user cannot download {format} checksum report"))
def ui_research_empty_checksum_report_not_downloaded(browser, format):
try:
el = "a.download-report-csv" if format == "csv" else "a.download-report-text"
browser.find_by_css(el)
except ElementDoesNotExist:
assert True, "The Download as {format} button is not present as expected."

0 comments on commit a3e3b8e

Please sign in to comment.