Skip to content

Commit

Permalink
YDA-5059: Add keyword selector ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
claravox committed Dec 11, 2024
1 parent 9132eb6 commit 45bb675
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
26 changes: 24 additions & 2 deletions tests/features/ui/ui_meta.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Feature: Meta UI
Given user researcher is authenticated
And collection /tempZone/home/research-initial exists
And collection /tempZone/home/research-initial/folder space exists
And collection /tempZone/home/research-epos-msl-0 exists
And /tempZone/home/research-initial is unlocked
And /tempZone/home/research-epos-msl-0 is unlocked


Scenario Outline: Save metadata
Expand Down Expand Up @@ -36,6 +38,25 @@ Feature: Meta UI
| research-initial/folder space | research-initial | folder space |


Scenario Outline: Save hierarchical keywords
Given user researcher is logged in
And module "research" is shown
When user browses to folder <folder>
And user opens metadata form
# EPOS keyword
And user selects keyword "decane"
# user-defined keyword
And user selects keyword "totally custom keyword!42"
And user clicks save button
Then metadata form is saved as yoda-metadata.json for folder <folder>
When user clears keyword selector
And user clicks save button

Examples:
| folder |
| research-epos-msl-0 |


Scenario Outline: Delete metadata
Given user researcher is logged in
And module "research" is shown
Expand All @@ -45,8 +66,9 @@ Feature: Meta UI
Then metadata is deleted from folder

Examples:
| folder |
| research-initial |
| folder |
| research-initial |
| research-epos-msl-0 |


Scenario Outline: Check person identifier functionality in metadata form
Expand Down
14 changes: 14 additions & 0 deletions tests/step_defs/ui/test_ui_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
then,
when,
)
from selenium.webdriver.common.keys import Keys

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

Expand All @@ -31,6 +32,19 @@ def ui_metadata_fill(browser):
input.fill('The quick brown fox jumps over the lazy dog')


@when(parsers.parse('user selects keyword "{keyword}"'))
def ui_metadata_select_keyword(browser, keyword):
browser.find_by_css('.ant-select').click()
active_web_el = browser.switch_to.active_element
active_web_el.send_keys(keyword)
active_web_el.send_keys(Keys.ENTER)


@when('user clears keyword selector')
def ui_metadata_clear_hierarchal_keywords(browser):
browser.find_by_css('.ant-select-clear').click()


@when('users checks person identifier field in metadata form')
def ui_metadata_check_person_id_field(browser):
# Find the fieldset for the first 'Person identifier'.
Expand Down

0 comments on commit 45bb675

Please sign in to comment.