Skip to content

Commit

Permalink
Merge pull request #1655 from totvs/1.20.30rc3_to_2.0
Browse files Browse the repository at this point in the history
fix button footer 2.0
  • Loading branch information
renanllisboa authored Jan 28, 2025
2 parents 0184188 + b8e88f9 commit 0d66801
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tir/technologies/webapp_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4452,11 +4452,12 @@ def SetButton(self, button, sub_item="", position=1, check_error=True):
if self.webapp_shadowroot():
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))
if footer:
buttons = self.find_shadow_element("wa-button", footer)
if not buttons:
buttons = footer.find_elements(By.CSS_SELECTOR, "wa-button")
if buttons:
filtered_button = list(filter(lambda x: x.text.strip().replace('\n', '') == button.strip().replace(' \n ', ''), buttons))

if filtered_button and len(filtered_button) - 1 >= position:
parents_actives = list(filter(lambda x: self.filter_active_tabs(x), filtered_button ))
Expand Down

0 comments on commit 0d66801

Please sign in to comment.