From 3676eca1068b4f63b9ed375f7c6eb2a9401d7a8e Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Thu, 16 Jan 2020 10:29:01 +0100 Subject: [PATCH] TT#70901 selenium: add tests: swap around call actions - this test will check if options move down/up for call actions work properly Change-Id: I7ecfc25923e319750a0d63c908cca58d42863eea --- t/selenium/testrun.py | 63 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/t/selenium/testrun.py b/t/selenium/testrun.py index 146112f2..9e3da550 100644 --- a/t/selenium/testrun.py +++ b/t/selenium/testrun.py @@ -529,6 +529,27 @@ class testrun(unittest.TestCase): '//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-' 'row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " "im online' is missing") + driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]/div[@class="q-item' + '-side q-item-side-right q-item-section dest-btns cursor-pointer"]' + ).click() + driver.find_element_by_xpath( + '/html/body/div[@class="q-popover animate-scale"]/div/div[1]' + ).click() + 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) + self.assertEqual(driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' + ).text, 'do not ring own phone', "Option 'do not ring own phone' " + "is missing") + self.assertEqual(driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-' + 'row"]').text, 'first ring Voicebox', "Options did not get swapped" + ) driver.find_element_by_xpath( '//*[@id="q-app"]//div[@class="sources-section"]/div/button' '[@align="right"]').click() @@ -829,6 +850,27 @@ class testrun(unittest.TestCase): '//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-' 'row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " "im online' is missing") + driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]/div[@class="q-item' + '-side q-item-side-right q-item-section dest-btns cursor-pointer"]' + ).click() + driver.find_element_by_xpath( + '/html/body/div[@class="q-popover animate-scale"]/div/div[1]' + ).click() + 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) + self.assertEqual(driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' + ).text, 'do not ring own phone', "Option 'do not ring own phone' " + "is missing") + self.assertEqual(driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-' + 'row"]').text, 'first ring Voicebox', "Options did not get swapped" + ) driver.find_element_by_xpath( '//*[@id="q-app"]//div[@class="sources-section"]/div/button' '[@align="right"]').click() @@ -1123,6 +1165,27 @@ class testrun(unittest.TestCase): '//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-' 'row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " "im online' is missing") + driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]/div[@class="q-item' + '-side q-item-side-right q-item-section dest-btns cursor-pointer"]' + ).click() + driver.find_element_by_xpath( + '/html/body/div[@class="q-popover animate-scale"]/div/div[1]' + ).click() + 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) + self.assertEqual(driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' + ).text, 'do not ring own phone', "Option 'do not ring own phone' " + "is missing") + self.assertEqual(driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-' + 'row"]').text, 'first ring Voicebox', "Options did not get swapped" + ) driver.find_element_by_xpath( '//*[@id="q-app"]//div[@class="sources-section"]/div/button' '[@align="right"]').click()