diff --git a/tests/features/ui/ui_meta.feature b/tests/features/ui/ui_meta.feature index 774a79790..431d4660d 100644 --- a/tests/features/ui/ui_meta.feature +++ b/tests/features/ui/ui_meta.feature @@ -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 @@ -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 + 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 + 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 @@ -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 diff --git a/tests/step_defs/ui/test_ui_meta.py b/tests/step_defs/ui/test_ui_meta.py index 13e2be40a..3cb2504b0 100644 --- a/tests/step_defs/ui/test_ui_meta.py +++ b/tests/step_defs/ui/test_ui_meta.py @@ -12,6 +12,7 @@ then, when, ) +from selenium.webdriver.common.keys import Keys scenarios('../../features/ui/ui_meta.feature') @@ -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'.