Skip to content

Commit

Permalink
fix date filling
Browse files Browse the repository at this point in the history
  • Loading branch information
98llm committed Jan 24, 2025
1 parent 487f3e8 commit 0e9a5be
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions tir/technologies/webapp_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ def filling_date(self, shadow_root=None, container=None):
click_type = 1
send_type = 1
base_date_value = ''
is_active_element = None
endtime = time.time() + self.config.time_out / 2
while (time.time() < endtime and (base_date_value.strip() != self.config.date.strip())):

Expand Down Expand Up @@ -862,31 +863,31 @@ def filling_date(self, shadow_root=None, container=None):

self.wait_blocker()
for i in range(3):
self.take_screenshot(f'fill_data_before_click{click_type}_{time.time()}')
time.sleep(1)
self.click(date(), click_type=enum.ClickType(click_type))
self.take_screenshot(f'fill_data_after_click{click_type}_{time.time()}')

ActionChains(self.driver).key_down(Keys.CONTROL).send_keys(Keys.HOME).key_up(Keys.CONTROL).perform()
ActionChains(self.driver).key_down(Keys.CONTROL).key_down(Keys.SHIFT).send_keys(
Keys.END).key_up(Keys.CONTROL).key_up(Keys.SHIFT).perform()

self.take_screenshot(f'fill_data_before_send{send_type}_{time.time()}')
self.try_send_keys(date, self.config.date, try_counter=send_type)
self.take_screenshot(f'fill_data_after_send{send_type}_{time.time()}')

base_date_value = self.merge_date_mask(self.config.date, self.get_web_value(date()))
if self.config.poui_login:
ActionChains(self.driver).send_keys(Keys.TAB * 2).perform()

time.sleep(1)
click_type += 1
if click_type > 3:
click_type = 1
send_type += 1
if send_type > 3:
send_type = 1

if base_date_value.strip() == self.config.date.strip():
break
send_type += 1
if send_type > 3:
send_type = 1

if not self.is_active_element(date()) and click_type == 3:
self.filling_group(shadow_root, container)

click_type += 1
if click_type > 3:
click_type = 1

def filling_group(self, shadow_root=None, container=None):
"""
Expand Down

0 comments on commit 0e9a5be

Please sign in to comment.