Skip to content

Commit

Permalink
Fixed common.py bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ericbsd committed Jun 7, 2024
1 parent d2c87a5 commit d164a37
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions keywords/webui/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ def assert_button_is_restricted(cls, name: str) -> bool:
Example:
- Common.assert_button_is_restricted('delete')
"""
assert WebUI.wait_until_visible(xpaths.common_xpaths.button_field_locked(name)) is True
xpath_name = cls.convert_to_tag_format(name)
assert WebUI.wait_until_visible(xpaths.common_xpaths.button_field_locked(xpath_name)) is True
try:
# At this point the button is visible a Timeout or ElementClickIntercepted exception will be thrown.
cls.click_button(name, 1)
cls.click_button(xpath_name, 1)
except (ElementClickInterceptedException, TimeoutException):
return True
return False
Expand All @@ -103,9 +104,10 @@ def assert_checkbox_is_restricted(cls, name: str) -> bool:
Example:
- Common.assert_checkbox_is_restricted('myCheckbox')
"""
assert WebUI.wait_until_visible(xpaths.common_xpaths.checkbox_field_locked(name)) is True
xpath_name = cls.convert_to_tag_format(name)
assert WebUI.wait_until_visible(xpaths.common_xpaths.checkbox_field_locked(xpath_name)) is True
try:
cls.set_checkbox(name)
cls.set_checkbox(xpath_name)
except ElementClickInterceptedException:
return True
return False
Expand Down Expand Up @@ -249,10 +251,11 @@ def assert_link_is_restricted(cls, name: str) -> bool:
Example:
- Common.assert_button_is_restricted('delete')
"""
assert WebUI.wait_until_visible(xpaths.common_xpaths.link_field_locked(name)) is True
xpath_name = cls.convert_to_tag_format(name)
assert WebUI.wait_until_visible(xpaths.common_xpaths.link_field_locked(xpath_name)) is True
try:
# At this point the link is visible a Timeout or ElementClickIntercepted exception will be thrown.
cls.click_link(name)
cls.click_link(xpath_name)
except (ElementClickInterceptedException, TimeoutException):
return True
return False
Expand Down Expand Up @@ -404,9 +407,10 @@ def assert_toggle_is_restricted(cls, name) -> bool:
Example:
- Common.assert_toggle_is_restricted()
"""
assert WebUI.wait_until_visible(xpaths.common_xpaths.toggle_field_locked(name)) is True
xpath_name = cls.convert_to_tag_format(name)
assert WebUI.wait_until_visible(xpaths.common_xpaths.toggle_field_locked(xpath_name)) is True
try:
cls.click_on_element(xpaths.common_xpaths.toggle_field(name))
cls.click_on_element(xpaths.common_xpaths.toggle_field(xpath_name))
except (ElementClickInterceptedException, TimeoutException):
return True
return False
Expand Down

0 comments on commit d164a37

Please sign in to comment.