Skip to content

Commit

Permalink
Merge pull request #248 from jrusz/ouia-update
Browse files Browse the repository at this point in the history
ouia: use "contains" in xpath locator
  • Loading branch information
digitronik authored Oct 10, 2023
2 parents 8cb1d04 + 6151030 commit ed02ea7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/widgetastic/ouia/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class OUIABase:
"""

ROOT = ParametrizedLocator(
".//*[@data-ouia-component-type={@component_type}{@component_id_suffix}]"
".//*[contains(@data-ouia-component-type,{@component_type}){@component_id_suffix}]"
)
browser: Browser

Expand Down
6 changes: 3 additions & 3 deletions testing/test_ouia.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class TestView(OUIAGenericView):

view = TestView(browser)
assert view.is_displayed
assert view.locator == './/*[@data-ouia-component-type="TestView"]'
assert view.locator == './/*[contains(@data-ouia-component-type,"TestView")]'


def test_ouia_view(testing_view):
assert (
testing_view.locator
== './/*[@data-ouia-component-type="TestView" and @data-ouia-component-id="ouia"]'
== './/*[contains(@data-ouia-component-type,"TestView") and @data-ouia-component-id="ouia"]'
)
assert testing_view.is_displayed

Expand Down Expand Up @@ -66,4 +66,4 @@ class TestView(OUIAGenericView):

view = TestView(browser)
assert view.is_displayed
assert view.button.locator == './/*[@data-ouia-component-type="PF/Button"]'
assert view.button.locator == './/*[contains(@data-ouia-component-type,"PF/Button")]'

0 comments on commit ed02ea7

Please sign in to comment.