Skip to content

Commit

Permalink
Merge pull request #1603 from totvs/hotfix/poSearch
Browse files Browse the repository at this point in the history
Hotfix/po search
  • Loading branch information
renanllisboa authored Nov 29, 2024
2 parents e3c87ab + 23475fd commit 6e77644
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tir/technologies/poui_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3413,14 +3413,11 @@ def POSearch(self, content, placeholder):
self.wait_element(term='po-page')
endtime = time.time() + self.config.time_out
while (not element and time.time() < endtime):
po_page = next(iter(
self.web_scrap(term="[class='po-page']", scrap_type=enum.ScrapType.CSS_SELECTOR,
main_container='body')),
None)

po_page = next(iter(self.web_scrap(term="[class='po-page']", scrap_type=enum.ScrapType.CSS_SELECTOR,
main_container='body')),None)
if po_page:
page_list = next(iter(po_page.find_all_next('div', 'po-page-list-filter-wrapper')), None)

page_list = po_page.find_all_next('div', 'po-page-list-filter-wrapper')
page_list = next(iter(list(filter(lambda x: self.element_is_displayed(x), page_list))),None)
if page_list:
input = page_list.select('input')

Expand All @@ -3434,14 +3431,15 @@ def POSearch(self, content, placeholder):

if not element:
self.log_error("Couldn't find element")

self.switch_to_iframe()
element().clear()
element().send_keys(content)

action = lambda: self.soup_to_selenium(next(iter(po_page.select('po-icon'))))
action = lambda: self.soup_to_selenium(next(iter(input.parent.select('po-icon'))))
ActionChains(self.driver).move_to_element(action()).click().perform()


def ClickTable(self, first_column, second_column, first_content, second_content, table_number, itens, click_cell, checkbox):
"""
Clicks on the Table of POUI component.
Expand Down

0 comments on commit 6e77644

Please sign in to comment.