Skip to content

Commit

Permalink
[QOLDEV-955] prepare scenario test expectations for latest CKAN
Browse files Browse the repository at this point in the history
  • Loading branch information
ThrawnCA committed Nov 20, 2024
1 parent bff3e3b commit d96bd37
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/features/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ def log_in_directly(context):
:return:
"""

assert context.persona, "A persona is required to log in, found [{}] in context. Have you configured the personas in before_scenario?".format(context.persona)
assert context.persona, "A persona is required to log in, found [{}] in context." \
" Have you configured the personas in before_scenario?".format(context.persona)
context.execute_steps(u"""
When I attempt to log in with password "$password"
Then I should see an element with xpath "//*[@title='Log out']/i[contains(@class, 'fa-sign-out')]"
Then I should see an element with xpath "//*[@title='Log out' or @data-bs-title='Log out']/i[contains(@class, 'fa-sign-out')]"
""")


Expand Down Expand Up @@ -161,7 +162,8 @@ def go_to_new_resource_form(context, name):
""")
else:
# Existing dataset, browse to the resource form
if context.browser.is_element_present_by_xpath("//a[contains(string(), 'Resources') and contains(@href, '/dataset/resources/')]"):
if context.browser.is_element_present_by_xpath(
"//a[contains(string(), 'Resources') and contains(@href, '/dataset/resources/')]"):
context.execute_steps(u"""
When I press "Resources"
""")
Expand Down Expand Up @@ -254,7 +256,7 @@ def fill_in_default_link_resource_fields(context):
@when(u'I upload "{file_name}" of type "{file_format}" to resource')
def upload_file_to_resource(context, file_name, file_format):
context.execute_steps(u"""
When I execute the script "$('#resource-upload-button').trigger(click);"
When I execute the script "$('#resource-upload-button').trigger('click');"
And I attach the file "{file_name}" to "upload"
# Don't quote the injected string since it can have trailing spaces
And I execute the script "document.getElementById('field-format').value='{file_format}'"
Expand Down Expand Up @@ -476,7 +478,7 @@ def go_to_admin_config(context):
@when(u'I log out')
def log_out(context):
context.execute_steps(u"""
When I press the element with xpath "//*[@title='Log out']"
When I press the element with xpath "//*[@title='Log out' or @data-bs-title='Log out']"
Then I should see "Log in"
""")

Expand Down

0 comments on commit d96bd37

Please sign in to comment.