fix: removed busy wait
This commit is contained in:
@@ -196,6 +196,10 @@ def main(driver: Chrome, logger = logging.getLogger('main')):
|
|||||||
result = wb.active.cell(row, headers.index(header) + 1)
|
result = wb.active.cell(row, headers.index(header) + 1)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def busy(driver: Chrome):
|
||||||
|
result = driver.find_elements(By.CSS_SELECTOR, ".io-ox-busy")
|
||||||
|
return result
|
||||||
|
|
||||||
try:
|
try:
|
||||||
click("li[data-id='default0/Brouillons']", condition=EC.presence_of_element_located)
|
click("li[data-id='default0/Brouillons']", condition=EC.presence_of_element_located)
|
||||||
click("button[data-id='default0/Brouillons']", condition=EC.presence_of_element_located)
|
click("button[data-id='default0/Brouillons']", condition=EC.presence_of_element_located)
|
||||||
@@ -213,12 +217,6 @@ def main(driver: Chrome, logger = logging.getLogger('main')):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def perform(cls):
|
def perform(cls):
|
||||||
try: busy = driver.find_elements(By.CSS_SELECTOR, ".io-ox-busy")
|
|
||||||
except: busy = None
|
|
||||||
|
|
||||||
if busy:
|
|
||||||
sleep(parameters['interval'])
|
|
||||||
return True
|
|
||||||
if status == Status.RUNNING:
|
if status == Status.RUNNING:
|
||||||
timer.start()
|
timer.start()
|
||||||
return False
|
return False
|
||||||
@@ -450,7 +448,8 @@ def main(driver: Chrome, logger = logging.getLogger('main')):
|
|||||||
|
|
||||||
flow.react(Wait)
|
flow.react(Wait)
|
||||||
click("ul.classic-toolbar button[aria-label='Edit copy']")
|
click("ul.classic-toolbar button[aria-label='Edit copy']")
|
||||||
flow.react(Wait)
|
until(lambda x: busy(x))
|
||||||
|
until(lambda x: not busy(x))
|
||||||
locate("div.io-ox-mail-compose-window iframe", condition=EC.frame_to_be_available_and_switch_to_it)
|
locate("div.io-ox-mail-compose-window iframe", condition=EC.frame_to_be_available_and_switch_to_it)
|
||||||
|
|
||||||
if options.get('greet') and not (clean := False):
|
if options.get('greet') and not (clean := False):
|
||||||
|
|||||||
Reference in New Issue
Block a user