Skip to content

Commit

Permalink
[QOLDEV-955] make XPath to form button more robust
Browse files Browse the repository at this point in the history
- Use 'data-module' attribute instead of CSS class as it won't change with CKAN 2.11
  • Loading branch information
ThrawnCA committed Oct 25, 2024
1 parent 3537b24 commit 7bd8b2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/features/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
if not hasattr(base64, 'encodestring'):
base64.encodestring = base64.encodebytes


# Monkey-patch Behaving to handle function rename
from behaving.web.steps import forms
if not hasattr(forms, 'fill_in_elem_by_name'):
Expand Down Expand Up @@ -436,7 +437,7 @@ def create_resource_from_params(context, resource_params):
""".format(key, value))
context.execute_steps(u"""
When I take a debugging screenshot
And I press the element with xpath "//form[contains(@class, 'resource-form')]//button[contains(@class, 'btn-primary')]"
And I press the element with xpath "//form[contains(@data-module, 'resource-form')]//button[contains(@class, 'btn-primary')]"
And I take a debugging screenshot
""")

Expand Down

0 comments on commit 7bd8b2b

Please sign in to comment.