From 714f69e7ae3989c409561cdaad8f2e7c8f1a833a Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Tue, 14 Jan 2020 11:11:41 +0100 Subject: [PATCH] TT#70901 selenium: more crash fixes - improve 2 cases where WebDriverWait should check for the loading animation screen dissapearing rather than an element beeing clickable again Change-Id: Ic30da67ce79095559224cdf20b5f2e8e46663f02 --- t/selenium/testrun.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/t/selenium/testrun.py b/t/selenium/testrun.py index 2f693437..5ca81bb1 100644 --- a/t/selenium/testrun.py +++ b/t/selenium/testrun.py @@ -617,9 +617,12 @@ class testrun(unittest.TestCase): '/button[3]').click() driver.find_element_by_xpath( '//*[@id="q-app"]//div[@class="q-item-"]/button[2]').click() - WebDriverWait(driver, 10).until(EC.element_to_be_clickable(( - By.XPATH, '//*[@id="q-app"]//div[1]/div' - '[@class="add-destination-form"]/button'))) + driver.implicitly_wait(2) + WebDriverWait(driver, 10).until(EC.invisibility_of_element_located(( + By.XPATH, '//div[@class="q-loading animate-fade fullscreen column ' + 'flex-center z-maxundefined"]/svg[@class="q-spinner q-spinner-mat ' + 'text-white"]'))) + driver.implicitly_wait(10) driver.find_element_by_xpath( '//*[@id="q-app"]//div[1]/div[@class="add-destination-form"]' '/button').click() @@ -1050,9 +1053,12 @@ class testrun(unittest.TestCase): driver.find_element_by_xpath( '//*[@id="main-menu"]//div[@class="q-item-label"]' '[contains(text(), "Speed Dial")]').click() - WebDriverWait(driver, 10).until(EC.element_to_be_clickable(( - By.XPATH, '//*[@id="q-app"]//div//button[contains' - '(@class, "q-btn-rectangle")]'))) + driver.implicitly_wait(2) + WebDriverWait(driver, 10).until(EC.invisibility_of_element_located(( + By.XPATH, '//div[@class="q-loading animate-fade fullscreen column ' + 'flex-center z-maxundefined"]/svg[@class="q-spinner q-spinner-mat ' + 'text-white"]'))) + driver.implicitly_wait(10) driver.find_element_by_xpath( '//*[@id="q-app"]//div//button[contains' '(@class, "q-btn-rectangle")]').click()