Skip to content

Commit

Permalink
Merge pull request #1628 from HelenaAdrignoli/hotfix/setbutton
Browse files Browse the repository at this point in the history
hotfix in setbutton
  • Loading branch information
98llm authored Dec 31, 2024
2 parents a63d9fc + 42c4b24 commit 814b641
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/install_package.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ taskkill /f /im chromedriver.exe
echo -------------------------
echo Installing project...
echo -------------------------
pip install -U dist/tir_framework-1.20.29rc3.tar.gz
pip install -U dist/tir_framework-1.20.29rc4.tar.gz
pause >nul | set/p = Press any key to exit ...
6 changes: 2 additions & 4 deletions tir/technologies/webapp_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4317,6 +4317,8 @@ def SetButton(self, button, sub_item="", position=1, check_error=True):
if not soup_objects:
footer = self.find_shadow_element('footer', self.soup_to_selenium(soup), get_all=False)
buttons = self.find_shadow_element("wa-button", footer)
if not buttons:
buttons = self.driver.execute_script("return arguments[0].querySelectorAll('wa-button')", footer)
if buttons:
filtered_button = list(filter(lambda x: x.text.strip().replace('\n', '') == button.strip().replace(' \n ', ''), buttons))

Expand Down Expand Up @@ -10759,10 +10761,6 @@ def find_shadow_element(self, term, objects, get_all=True):
elements = self.driver.execute_script(script, objects)
except:
pass

if not elements:
script = f"return arguments[0].querySelectorAll('{term}')"
elements = self.driver.execute_script(script, objects)

return elements if elements else None

Expand Down
2 changes: 1 addition & 1 deletion tir/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.20.29rc3'
__version__ = '1.20.29rc4'

0 comments on commit 814b641

Please sign in to comment.