TT#70901 selenium: more post-80-column-change cleanups

cleans up more code and removes an unnecessary file

Change-Id: I588ba2c4082cb1e0f11536833c68b303d1f1c6d0
changes/59/40859/4
Nico Schedel 5 years ago
parent f65b85b64b
commit 6894b5cc68

@ -116,8 +116,7 @@ class testrun(unittest.TestCase):
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="csc-login"]//div//button').click() '//*[@id="csc-login"]//div//button').click()
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//div[contains(@class, "q-alert-container")]')) > 0, '//div[contains(@class, "q-alert-container")]')) > 0, "Error Message was not shown")
"Error Message was not shown")
print("OK") print("OK")
print("Try to log in with valid credentials...", end="") print("Try to log in with valid credentials...", end="")
fill_element( fill_element(
@ -127,10 +126,8 @@ class testrun(unittest.TestCase):
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="csc-login"]//div//button').click() '//*[@id="csc-login"]//div//button').click()
self.assertEqual( self.assertEqual(
"testuser", "testuser", driver.find_element_by_xpath('//*[@id="csc-header-toolbar"]//div//span[contains(text(), "testuser")]').text,
driver.find_element_by_xpath('//*[@id="csc-header-toolbar"]//div//span[contains(text(), "testuser")]').text, "Login failed")
"Login failed"
)
print("OK") print("OK")
print("Try to log out...", end="") print("Try to log out...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -138,19 +135,15 @@ class testrun(unittest.TestCase):
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//div[contains(text(), "Logout")]').click() '//div[contains(text(), "Logout")]').click()
self.assertEqual( self.assertEqual(
driver.current_url, os.environ['CATALYST_SERVER'] + driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Logout failed")
"/login/subscriber/#/login", "Logout failed")
print("OK") print("OK")
print( print("Change login page language to all avalible languages...", end="")
"Change login page language to all avalible languages...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="csc-header-toolbar"]/button').click() '//*[@id="csc-header-toolbar"]/button').click()
xp = '/html/body/div[@class="q-popover animate-scale"]//div[@class="q-item q-item-division relative-position q-item-link"]' xp = '/html/body/div[@class="q-popover animate-scale"]//div[@class="q-item q-item-division relative-position q-item-link"]'
step(driver, xp) step(driver, xp)
click_js( click_js(
driver, driver, '/html/body/div[@class="q-popover animate-scale"]//div[@class="q-collapsible-sub-item relative-position"]/div[2]')
'/html/body/div[@class="q-popover animate-scale"]//div[@class="q-collapsible-sub-item relative-position"]/div[2]'
)
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="csc-login"]//div[@class="q-card-title"][contains(text(), "Authentification de labonné")]')) > 0, '//*[@id="csc-login"]//div[@class="q-card-title"][contains(text(), "Authentification de labonné")]')) > 0,
'Language was not changed to France') 'Language was not changed to France')
@ -273,9 +266,7 @@ class testrun(unittest.TestCase):
'//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Outgoing")]').click() '//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Outgoing")]').click()
step(driver, '//*[@id="q-app"]//div[@class="q-item-label"][contains(text(), "Only outgoing calls")]') step(driver, '//*[@id="q-app"]//div[@class="q-item-label"][contains(text(), "Only outgoing calls")]')
print("OK") print("OK")
print( print("Enable 'Only outgoing calls from listed numbers are allowed'...", end="")
"Enable 'Only outgoing calls from listed numbers are allowed'...",
end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="q-item-label"][contains(text(), "Only outgoing calls")]').click() '//*[@id="q-app"]//div[@class="q-item-label"][contains(text(), "Only outgoing calls")]').click()
step(driver, '//*[@id="q-app"]//div/button[contains(@class, "q-btn-flat")]/span[contains(@class, "q-btn-inner")]') step(driver, '//*[@id="q-app"]//div/button[contains(@class, "q-btn-flat")]/span[contains(@class, "q-btn-inner")]')
@ -301,9 +292,7 @@ class testrun(unittest.TestCase):
'//div[@class="csc-item-buttons-menu q-list no-border"]/div[1]').click() '//div[@class="csc-item-buttons-menu q-list no-border"]/div[1]').click()
fill_element( fill_element(
driver, '//*[@id="q-app"]//div/input[@class="col q-input-target text-left"]', '54321') driver, '//*[@id="q-app"]//div/input[@class="col q-input-target text-left"]', '54321')
elem = driver.find_element_by_xpath( click_js(driver, '//*[@id="q-app"]//div//i[text()="check"]')
'//*[@id="q-app"]//div//i[text()="check"]')
driver.execute_script("arguments[0].click();", elem)
driver.implicitly_wait(2) driver.implicitly_wait(2)
step(driver, '//*[@id="q-app"]//div[@class="csc-spinner"]/svg', inv=True) step(driver, '//*[@id="q-app"]//div[@class="csc-spinner"]/svg', inv=True)
driver.implicitly_wait(10) driver.implicitly_wait(10)
@ -441,24 +430,23 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if all values are correct...", end="") print("Check if all values are correct...", end="")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[@tabindex="0"][contains(@class, "q-toggle")]/div[@class="q-option-inner relative-position active"]')) > 0, "Option 'Ring own Phone' was not " '//*[@id="q-app"]//div[@tabindex="0"][contains(@class, "q-toggle")]/div[@class="q-option-inner relative-position active"]')) > 0,
"enabled") "Option 'Ring own Phone' was not enabled")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span').text, 'first ring own phone for 15 secs',
).text, 'first ring own phone for 15 secs', "Option 'first ring ' " "Option 'first ring own Phone for 15 secs' is missing")
"own Phone for 15 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'then ring testdestination for 100 secs', "Option " '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'then ring testdestination for 100 secs',
"'Ring testdestination for 100 secs' is missing") "Option 'Ring testdestination for 100 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " '//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox',
"im online' is missing") "Option 'Ring Voicebox when im online' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfb"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 200 secs', "Option " '//*[@id="q-app"]//div[@groupname="cfb"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 200 secs',
"'Ring testdestination for 200 secs' is missing") "Option 'Ring testdestination for 200 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfb"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " '//*[@id="q-app"]//div[@groupname="cfb"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox',
"im busy' is missing") "Option 'Ring Voicebox when im busy' is missing")
print("OK") print("OK")
print("Add new source set...", end="") print("Add new source set...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -480,9 +468,8 @@ class testrun(unittest.TestCase):
'//*[@id="q-app"]//div/span[contains(text(), "firsttestsourceset")]').click() '//*[@id="q-app"]//div/span[contains(text(), "firsttestsourceset")]').click()
print("OK") print("OK")
print("Check if source in source set is correct...", end="") print("Check if source in source set is correct...", end="")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(
'//*[@id="q-app"]//div[contains(text(), "firsttestsource")]' len(driver.find_elements_by_xpath('//*[@id="q-app"]//div[contains(text(), "firsttestsource")]')) > 0, "Source was not found")
)) > 0, "Source was not found")
print("OK") print("OK")
print("Add a new source...", end="") print("Add a new source...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -496,9 +483,8 @@ class testrun(unittest.TestCase):
wait_for_loading_screen(driver) wait_for_loading_screen(driver)
print("OK") print("OK")
print("Check if second source is created properly...", end="") print("Check if second source is created properly...", end="")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(
'//*[@id="q-app"]//div[contains(text(), "newtestsource")]' len(driver.find_elements_by_xpath('//*[@id="q-app"]//div[contains(text(), "newtestsource")]')) > 0, "Second Source was not found")
)) > 0, "Second Source was not found")
print("OK") print("OK")
print("Delete second source...", end="") print("Delete second source...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -510,17 +496,14 @@ class testrun(unittest.TestCase):
print("Check if second source was deleted...", end="") print("Check if second source was deleted...", end="")
wait_for_loading_screen(driver) wait_for_loading_screen(driver)
self.assertFalse(driver.find_elements_by_xpath( self.assertFalse(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "newtestsource")]'), '//*[@id="q-app"]//div[contains(text(), "newtestsource")]'), "Second Source was not deleted")
"Second Source was not deleted")
print("OK") print("OK")
print( print("Try to delete first source and check if error message appears...", end="")
"Try to delete first source and check if error message appears...",
end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "firsttestsource")]/../div[2]').click() '//*[@id="q-app"]//div[contains(text(), "firsttestsource")]/../div[2]').click()
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(
'/html/body//div[@class="q-alert row no-wrap shadow-2 bg-negative"]')) > 0, "Error Message 'Removing the " len(driver.find_elements_by_xpath('/html/body//div[@class="q-alert row no-wrap shadow-2 bg-negative"]')) > 0,
"last source entry is not allowed' did not appear") "Error Message 'Removing the last source entry is not allowed' did not appear")
print("OK") print("OK")
print("Add number to 'When im online'...", end="") print("Add number to 'When im online'...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -544,33 +527,29 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if everyting was added correctly...", end="") print("Check if everyting was added correctly...", end="")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span').text, 'do not ring own phone',
).text, 'do not ring own phone', "Option 'do not ring own phone' " "Option 'do not ring own phone' is missing")
"is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 100 secs', "Option " '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 100 secs',
"'Ring testdestination for 100 secs' is missing") "Option 'Ring testdestination for 100 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " '//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox',
"im online' is missing") "Option 'Ring Voicebox when im online' is missing")
print("OK") print("OK")
print("Swap entries in 'When im online'...", end="") print("Swap entries in 'When im online'...", end="")
driver.find_element_by_xpath( 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"]' '//*[@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()
).click()
driver.find_element_by_xpath( driver.find_element_by_xpath(
'/html/body/div[@class="q-popover animate-scale"]/div/div[1]' '/html/body/div[@class="q-popover animate-scale"]/div/div[1]').click()
).click()
wait_for_loading_screen(driver) wait_for_loading_screen(driver)
print("OK") print("OK")
print("Check if entries got swapped...", end="") print("Check if entries got swapped...", end="")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span').text, 'do not ring own phone',
).text, 'do not ring own phone', "Option 'do not ring own phone' " "Option 'do not ring own phone' is missing")
"is missing")
self.assertEqual(driver.find_element_by_xpath( 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" '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'first ring Voicebox',
) "Options did not get swapped")
print("OK") print("OK")
print("Delete second source set...", end="") print("Delete second source set...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -585,14 +564,12 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if second source set was deleted...", end="") print("Check if second source set was deleted...", end="")
self.assertFalse(driver.find_elements_by_xpath( self.assertFalse(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div/span[contains(text(), "firsttestsourceset")]'), '//*[@id="q-app"]//div/span[contains(text(), "firsttestsourceset")]'), "Second Source Set was not deleted")
"Second Source Set was not deleted")
print("OK") print("OK")
print("Logout...", end="") print("Logout...", end="")
logout_csc(driver) logout_csc(driver)
self.assertEqual( self.assertEqual(
driver.current_url, os.environ['CATALYST_SERVER'] + driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Logout failed")
"/login/subscriber/#/login", "Logout failed")
print("OK") print("OK")
filename = 0 filename = 0
@ -661,30 +638,28 @@ class testrun(unittest.TestCase):
print("Enable 'Ring own phone'...", end="") print("Enable 'Ring own phone'...", end="")
step(driver, '//*[@id="q-app"]//div[@class="q-field-content col-xs-12 col-sm"]/div[@tabindex="0"]/div[@class="q-option-inner relative-position"]') step(driver, '//*[@id="q-app"]//div[@class="q-field-content col-xs-12 col-sm"]/div[@tabindex="0"]/div[@class="q-option-inner relative-position"]')
click_js( click_js(
driver, driver, '//*[@id="q-app"]//div[@class="q-field-content col-xs-12 col-sm"]/div[@tabindex="0"]/div[@class="q-option-inner relative-position"]')
'//*[@id="q-app"]//div[@class="q-field-content col-xs-12 col-sm"]/div[@tabindex="0"]/div[@class="q-option-inner relative-position"]')
wait_for_loading_screen(driver) wait_for_loading_screen(driver)
print("OK") print("OK")
print("Check if all values are correct...", end="") print("Check if all values are correct...", end="")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[@tabindex="0"][contains(@class, "q-toggle")]/div[@class="q-option-inner relative-position active"]')) > 0, "Option 'Ring own Phone' was not " '//*[@id="q-app"]//div[@tabindex="0"][contains(@class, "q-toggle")]/div[@class="q-option-inner relative-position active"]')) > 0,
"enabled") "Option 'Ring own Phone' was not enabled")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span').text, 'first ring own phone for 15 secs',
).text, 'first ring own phone for 15 secs', "Option 'first ring ' " "Option 'first ring own Phone for 15 secs' is missing")
"own Phone for 15 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'then ring testdestination for 100 secs', "Option " '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'then ring testdestination for 100 secs',
"'Ring testdestination for 100 secs' is missing") "Option 'Ring testdestination for 100 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " '//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox',
"im online' is missing") "Option 'Ring Voicebox when im online' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfb"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 200 secs', "Option " '//*[@id="q-app"]//div[@groupname="cfb"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 200 secs',
"'Ring testdestination for 200 secs' is missing") "Option 'Ring testdestination for 200 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfb"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " '//*[@id="q-app"]//div[@groupname="cfb"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox',
"im busy' is missing") "Option 'Ring Voicebox when im busy' is missing")
print("OK") print("OK")
print("Add new source set...", end="") print("Add new source set...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -714,17 +689,14 @@ class testrun(unittest.TestCase):
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="sources-section"]/button').click() '//*[@id="q-app"]//div[@class="sources-section"]/button').click()
fill_element( fill_element(
driver, '//*[@id="q-app"]//div[@class="add-source-form"]//input', driver, '//*[@id="q-app"]//div[@class="add-source-form"]//input', 'newtestsource')
'newtestsource')
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="add-source-form"]/button[2]' '//*[@id="q-app"]//div[@class="add-source-form"]/button[2]').click()
).click()
wait_for_loading_screen(driver) wait_for_loading_screen(driver)
print("OK") print("OK")
print("Check if second source is created properly...", end="") print("Check if second source is created properly...", end="")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "newtestsource")]' '//*[@id="q-app"]//div[contains(text(), "newtestsource")]')) > 0, "Second Source was not found")
)) > 0, "Second Source was not found")
print("OK") print("OK")
print("Delete second source...", end="") print("Delete second source...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -736,17 +708,14 @@ class testrun(unittest.TestCase):
print("Check if second source was deleted...", end="") print("Check if second source was deleted...", end="")
wait_for_loading_screen(driver) wait_for_loading_screen(driver)
self.assertFalse(driver.find_elements_by_xpath( self.assertFalse(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "newtestsource")]'), '//*[@id="q-app"]//div[contains(text(), "newtestsource")]'), "Second Source was not deleted")
"Second Source was not deleted")
print("OK") print("OK")
print( print("Try to delete first source and check if error message appears...", end="")
"Try to delete first source and check if error message appears...",
end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "secondtestsource")]/../div[2]').click() '//*[@id="q-app"]//div[contains(text(), "secondtestsource")]/../div[2]').click()
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(
'/html/body//div[@class="q-alert row no-wrap shadow-2 bg-negative"]')) > 0, "Error Message 'Removing the " len(driver.find_elements_by_xpath('/html/body//div[@class="q-alert row no-wrap shadow-2 bg-negative"]')) > 0,
"last source entry is not allowed' did not appear") "Error Message 'Removing the last source entry is not allowed' did not appear")
print("OK") print("OK")
print("Add number to 'When im online'...", end="") print("Add number to 'When im online'...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -770,33 +739,29 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if everyting was added correctly...", end="") print("Check if everyting was added correctly...", end="")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span').text, 'do not ring own phone',
).text, 'do not ring own phone', "Option 'do not ring own phone' " "Option 'do not ring own phone' is missing")
"is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 100 secs', "Option " '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 100 secs',
"'Ring testdestination for 100 secs' is missing") "Option 'Ring testdestination for 100 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " '//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox',
"im online' is missing") "Option 'Ring Voicebox when im online' is missing")
print("OK") print("OK")
print("Swap entries in 'When im online'...", end="") print("Swap entries in 'When im online'...", end="")
driver.find_element_by_xpath( 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"]' '//*[@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()
).click()
driver.find_element_by_xpath( driver.find_element_by_xpath(
'/html/body/div[@class="q-popover animate-scale"]/div/div[1]' '/html/body/div[@class="q-popover animate-scale"]/div/div[1]').click()
).click()
wait_for_loading_screen(driver) wait_for_loading_screen(driver)
print("OK") print("OK")
print("Check if entries got swapped...", end="") print("Check if entries got swapped...", end="")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span').text, 'do not ring own phone',
).text, 'do not ring own phone', "Option 'do not ring own phone' " "Option 'do not ring own phone' is missing")
"is missing")
self.assertEqual(driver.find_element_by_xpath( 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" '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'first ring Voicebox',
) "Options did not get swapped")
print("OK") print("OK")
print("Delete second source set...", end="") print("Delete second source set...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -811,14 +776,12 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if second source set was deleted...", end="") print("Check if second source set was deleted...", end="")
self.assertFalse(driver.find_elements_by_xpath( self.assertFalse(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div/span[contains(text(), "secondtestsourceset")]'), '//*[@id="q-app"]//div/span[contains(text(), "secondtestsourceset")]'), "Second Source Set was not deleted")
"Second Source Set was not deleted")
print("OK") print("OK")
print("Logout...", end="") print("Logout...", end="")
logout_csc(driver) logout_csc(driver)
self.assertEqual( self.assertEqual(
driver.current_url, os.environ['CATALYST_SERVER'] + driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Logout failed")
"/login/subscriber/#/login", "Logout failed")
print("OK") print("OK")
filename = 0 filename = 0
@ -905,30 +868,28 @@ class testrun(unittest.TestCase):
print("Enable 'Ring own phone'...", end="") print("Enable 'Ring own phone'...", end="")
step(driver, '//*[@id="q-app"]//div[@class="q-field-content col-xs-12 col-sm"]/div[@tabindex="0"]/div[@class="q-option-inner relative-position"]') step(driver, '//*[@id="q-app"]//div[@class="q-field-content col-xs-12 col-sm"]/div[@tabindex="0"]/div[@class="q-option-inner relative-position"]')
click_js( click_js(
driver, driver, '//*[@id="q-app"]//div[@class="q-field-content col-xs-12 col-sm"]/div[@tabindex="0"]/div[@class="q-option-inner relative-position"]')
'//*[@id="q-app"]//div[@class="q-field-content col-xs-12 col-sm"]/div[@tabindex="0"]/div[@class="q-option-inner relative-position"]')
wait_for_loading_screen(driver) wait_for_loading_screen(driver)
print("OK") print("OK")
print("Check if all values are correct...", end="") print("Check if all values are correct...", end="")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[@tabindex="0"][contains(@class, "q-toggle")]/div[@class="q-option-inner relative-position active"]')) > 0, "Option 'Ring own Phone' was not " '//*[@id="q-app"]//div[@tabindex="0"][contains(@class, "q-toggle")]/div[@class="q-option-inner relative-position active"]')) > 0,
"enabled") "Option 'Ring own Phone' was not enabled")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span').text, 'first ring own phone for 15 secs',
).text, 'first ring own phone for 15 secs', "Option 'first ring ' " "Option 'first ring own Phone for 15 secs' is missing")
"own Phone for 15 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'then ring testdestination for 100 secs', "Option " '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'then ring testdestination for 100 secs',
"'Ring testdestination for 100 secs' is missing") "Option 'Ring testdestination for 100 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " '//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox',
"im online' is missing") "Option 'Ring Voicebox when im online' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfb"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 200 secs', "Option " '//*[@id="q-app"]//div[@groupname="cfb"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 200 secs',
"'Ring testdestination for 200 secs' is missing") "Option 'Ring testdestination for 200 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfb"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " '//*[@id="q-app"]//div[@groupname="cfb"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox',
"im busy' is missing") "Option 'Ring Voicebox when im busy' is missing")
print("OK") print("OK")
print("Add new source set...", end="") print("Add new source set...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -951,24 +912,20 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if source in source set is correct...", end="") print("Check if source in source set is correct...", end="")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "thirdtestsource")]' '//*[@id="q-app"]//div[contains(text(), "thirdtestsource")]')) > 0, "Source was not found")
)) > 0, "Source was not found")
print("OK") print("OK")
print("Add a new source...", end="") print("Add a new source...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="sources-section"]/button').click() '//*[@id="q-app"]//div[@class="sources-section"]/button').click()
fill_element( fill_element(
driver, '//*[@id="q-app"]//div[@class="add-source-form"]//input', driver, '//*[@id="q-app"]//div[@class="add-source-form"]//input', 'newtestsource')
'newtestsource')
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="add-source-form"]/button[2]' '//*[@id="q-app"]//div[@class="add-source-form"]/button[2]').click()
).click()
wait_for_loading_screen(driver) wait_for_loading_screen(driver)
print("OK") print("OK")
print("Check if second source is created properly...", end="") print("Check if second source is created properly...", end="")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "newtestsource")]' '//*[@id="q-app"]//div[contains(text(), "newtestsource")]')) > 0, "Second Source was not found")
)) > 0, "Second Source was not found")
print("OK") print("OK")
print("Delete second source...", end="") print("Delete second source...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -980,17 +937,14 @@ class testrun(unittest.TestCase):
print("Check if second source was deleted...", end="") print("Check if second source was deleted...", end="")
wait_for_loading_screen(driver) wait_for_loading_screen(driver)
self.assertFalse(driver.find_elements_by_xpath( self.assertFalse(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "newtestsource")]'), '//*[@id="q-app"]//div[contains(text(), "newtestsource")]'), "Second Source was not deleted")
"Second Source was not deleted")
print("OK") print("OK")
print( print("Try to delete first source and check if error message appears...", end="")
"Try to delete first source and check if error message appears...",
end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "thirdtestsource")]/../div[2]').click() '//*[@id="q-app"]//div[contains(text(), "thirdtestsource")]/../div[2]').click()
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(
'/html/body//div[@class="q-alert row no-wrap shadow-2 bg-negative"]')) > 0, "Error Message 'Removing the " len(driver.find_elements_by_xpath('/html/body//div[@class="q-alert row no-wrap shadow-2 bg-negative"]')) > 0,
"last source entry is not allowed' did not appear") "Error Message 'Removing the last source entry is not allowed' did not appear")
print("OK") print("OK")
print("Add number to 'When im online'...", end="") print("Add number to 'When im online'...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -1014,33 +968,28 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if everyting was added correctly...", end="") print("Check if everyting was added correctly...", end="")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span').text, 'do not ring own phone',
).text, 'do not ring own phone', "Option 'do not ring own phone' " "Option 'do not ring own phone' is missing")
"is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 100 secs', "Option " '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'first ring testdestination for 100 secs',
"'Ring testdestination for 100 secs' is missing") "Option 'Ring testdestination for 100 secs' is missing")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox', "Option 'Ring Voicebox when " '//*[@id="q-app"]//div[@groupname="cfu"]/div[2]//div[@class="dest-row"]').text, 'then ring Voicebox',
"im online' is missing") "Option 'Ring Voicebox when im online' is missing")
print("OK") print("OK")
print("Swap entries in 'When im online'...", end="") print("Swap entries in 'When im online'...", end="")
driver.find_element_by_xpath( 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"]' '//*[@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()
).click()
driver.find_element_by_xpath( driver.find_element_by_xpath(
'/html/body/div[@class="q-popover animate-scale"]/div/div[1]' '/html/body/div[@class="q-popover animate-scale"]/div/div[1]').click()
).click()
wait_for_loading_screen(driver) wait_for_loading_screen(driver)
print("OK") print("OK")
print("Check if entries got swapped...", end="") print("Check if entries got swapped...", end="")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span' '//*[@id="q-app"]//div[@class="dest-row own-phone-desktop"]/span').text, 'do not ring own phone',
).text, 'do not ring own phone', "Option 'do not ring own phone' " "Option 'do not ring own phone' is missing")
"is missing")
self.assertEqual(driver.find_element_by_xpath( 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" '//*[@id="q-app"]//div[@groupname="cfu"]/div[1]//div[@class="dest-row"]').text, 'first ring Voicebox', "Options did not get swapped")
)
print("OK") print("OK")
print("Delete second source set...", end="") print("Delete second source set...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -1055,14 +1004,12 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if second source set was deleted...", end="") print("Check if second source set was deleted...", end="")
self.assertFalse(driver.find_elements_by_xpath( self.assertFalse(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div/span[contains(text(), "thirdtestsourceset")]'), '//*[@id="q-app"]//div/span[contains(text(), "thirdtestsourceset")]'), "Second Source Set was not deleted")
"Second Source Set was not deleted")
print("OK") print("OK")
print("Logout...", end="") print("Logout...", end="")
logout_csc(driver) logout_csc(driver)
self.assertEqual( self.assertEqual(
driver.current_url, os.environ['CATALYST_SERVER'] + driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Logout failed")
"/login/subscriber/#/login", "Logout failed")
print("OK") print("OK")
filename = 0 filename = 0
@ -1102,7 +1049,8 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if all sections are empty...", end="") print("Check if all sections are empty...", end="")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="csc-conversation-content"]/div[@class="row justify-center csc-conversation-list-message"]').text, 'No Calls, Voicemails or Faxes found', "Section 'All' is not empty") '//*[@id="csc-conversation-content"]/div[@class="row justify-center csc-conversation-list-message"]').text, 'No Calls, Voicemails or Faxes found',
"Section 'All' is not empty")
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="csc-conversations-tabs"]//div[@class="q-tabs-scroller row no-wrap"]//span[contains(text(), "Calls")]').click() '//*[@id="csc-conversations-tabs"]//div[@class="q-tabs-scroller row no-wrap"]//span[contains(text(), "Calls")]').click()
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
@ -1116,13 +1064,13 @@ class testrun(unittest.TestCase):
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="csc-conversations-tabs"]//div[@class="q-tabs-scroller row no-wrap"]//span[contains(text(), "Voicemails")]').click() '//*[@id="csc-conversations-tabs"]//div[@class="q-tabs-scroller row no-wrap"]//span[contains(text(), "Voicemails")]').click()
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="csc-conversation-content"]/div[@class="row justify-center csc-conversation-list-message"]').text, 'No Voicemails found', "Section 'Voicemails' is not empty") '//*[@id="csc-conversation-content"]/div[@class="row justify-center csc-conversation-list-message"]').text, 'No Voicemails found',
"Section 'Voicemails' is not empty")
print("OK") print("OK")
print("Logout...", end="") print("Logout...", end="")
logout_csc(driver) logout_csc(driver)
self.assertEqual( self.assertEqual(
driver.current_url, os.environ['CATALYST_SERVER'] + driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Logout failed")
"/login/subscriber/#/login", "Logout failed")
print("OK") print("OK")
filename = 0 filename = 0
@ -1165,11 +1113,9 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if reminder settings were applied correctly...", end="") print("Check if reminder settings were applied correctly...", end="")
self.assertEqual('Reminder is enabled', driver.find_element_by_xpath( self.assertEqual('Reminder is enabled', driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@tabindex="0"]//span[contains(text(), "Reminder")]').text, '//*[@id="q-app"]//div[@tabindex="0"]//span[contains(text(), "Reminder")]').text, "Reminder is not enabled")
"Reminder is not enabled")
self.assertEqual('13:35', driver.find_element_by_xpath( self.assertEqual('13:35', driver.find_element_by_xpath(
'//*[@id="q-app"]//div[contains(@class, "q-input-target justify-start")]').text, '//*[@id="q-app"]//div[contains(@class, "q-input-target justify-start")]').text, "Time is not correct")
"Time is not correct")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[@tabindex="0"]/div[contains(@class, "active")]/../span[contains(text(), "Always")]')) > 0, '//*[@id="q-app"]//div[@tabindex="0"]/div[contains(@class, "active")]/../span[contains(text(), "Always")]')) > 0,
"Option 'Always' was not selected") "Option 'Always' was not selected")
@ -1177,8 +1123,7 @@ class testrun(unittest.TestCase):
print("Logout...", end="") print("Logout...", end="")
logout_csc(driver) logout_csc(driver)
self.assertEqual( self.assertEqual(
driver.current_url, os.environ['CATALYST_SERVER'] + driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Logout failed")
"/login/subscriber/#/login", "Logout failed")
print("OK") print("OK")
filename = 0 filename = 0
@ -1192,43 +1137,37 @@ class testrun(unittest.TestCase):
step(driver, '//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Reminder")]') step(driver, '//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Reminder")]')
print("OK") print("OK")
print("Change home page language to all avalible languages...", end="") print("Change home page language to all avalible languages...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath('//*[@id="csc-header-toolbar"]/button').click()
'//*[@id="csc-header-toolbar"]/button').click()
xp = '/html/body/div[@class="q-popover animate-scale"]//div[@class="q-item q-item-division relative-position q-item-link"]' xp = '/html/body/div[@class="q-popover animate-scale"]//div[@class="q-item q-item-division relative-position q-item-link"]'
click_div = '/html/body/div[@class="q-popover animate-scale"]//div[@class="q-collapsible-sub-item relative-position"]/div[{}]' click_div = '/html/body/div[@class="q-popover animate-scale"]//div[@class="q-collapsible-sub-item relative-position"]/div[{}]'
step(driver, xp) step(driver, xp)
click_js(driver, click_div.format(2)) click_js(driver, click_div.format(2))
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Rappel")]')) > 0, '//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Rappel")]')) > 0, 'Language was not changed to France')
'Language was not changed to France')
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="csc-header-toolbar"]/button').click() '//*[@id="csc-header-toolbar"]/button').click()
step(driver, xp) step(driver, xp)
click_js(driver, click_div.format(3)) click_js(driver, click_div.format(3))
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Promemoria")]')) > 0, '//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Promemoria")]')) > 0, 'Language was not changed to Italian')
'Language was not changed to Italian')
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="csc-header-toolbar"]/button').click() '//*[@id="csc-header-toolbar"]/button').click()
step(driver, xp) step(driver, xp)
click_js(driver, click_div.format(4)) click_js(driver, click_div.format(4))
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Recordatorio")]')) > 0, '//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Recordatorio")]')) > 0, 'Language was not changed to Spanish')
'Language was not changed to Spanish')
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="csc-header-toolbar"]/button').click() '//*[@id="csc-header-toolbar"]/button').click()
step(driver, xp) step(driver, xp)
click_js(driver, click_div.format(5)) click_js(driver, click_div.format(5))
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Erinnerung")]')) > 0, '//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Erinnerung")]')) > 0, 'Language was not changed to German')
'Language was not changed to German')
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="csc-header-toolbar"]/button').click() '//*[@id="csc-header-toolbar"]/button').click()
step(driver, xp) step(driver, xp)
click_js(driver, click_div.format(1)) click_js(driver, click_div.format(1))
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Reminder")]')) > 0, '//*[@id="main-menu"]//div[@class="q-item-label"][contains(text(), "Reminder")]')) > 0, 'Language was not changed back to English')
'Language was not changed back to English')
print("OK") print("OK")
print("Change user password...", end="") print("Change user password...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -1247,8 +1186,7 @@ class testrun(unittest.TestCase):
'/html/body//div[@class="csc-dialog-actions row justify-end no-wrap"]/button[2]').click() '/html/body//div[@class="csc-dialog-actions row justify-end no-wrap"]/button[2]').click()
step(driver, '//*[@id="csc-login-form"]//div//input[@type="text"]') step(driver, '//*[@id="csc-login-form"]//div//input[@type="text"]')
self.assertEqual( self.assertEqual(
driver.current_url, os.environ['CATALYST_SERVER'] + driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Logout failed")
"/login/subscriber/#/login", "Logout failed")
print("OK") print("OK")
print("Try to log in with new password...", end="") print("Try to log in with new password...", end="")
login_csc(driver, "testuser@" + self.domainname, 'pass1234') login_csc(driver, "testuser@" + self.domainname, 'pass1234')
@ -1272,8 +1210,7 @@ class testrun(unittest.TestCase):
'/html/body//div[@class="csc-dialog-actions row justify-end no-wrap"]/button[2]').click() '/html/body//div[@class="csc-dialog-actions row justify-end no-wrap"]/button[2]').click()
step(driver, '//*[@id="csc-login-form"]//div//input[@type="text"]') step(driver, '//*[@id="csc-login-form"]//div//input[@type="text"]')
self.assertEqual( self.assertEqual(
driver.current_url, os.environ['CATALYST_SERVER'] + driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Logout failed")
"/login/subscriber/#/login", "Logout failed")
print("OK") print("OK")
filename = 0 filename = 0
@ -1307,11 +1244,11 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if speed dial details are correct...", end="") print("Check if speed dial details are correct...", end="")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="q-item-label"]/span[contains(text(), "When")]') '//*[@id="q-app"]//div[@class="q-item-label"]/span[contains(text(), "When")]').text, "When I dial *1 ...",
.text, "When I dial *1 ...", "Speed dial has not been created") "Speed dial has not been created")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="q-item-sublabel"][contains(text(), "ring")]') '//*[@id="q-app"]//div[@class="q-item-sublabel"][contains(text(), "ring")]').text, "ring testtext",
.text, "ring testtext", "Speed dial is not correct") "Speed dial is not correct")
print("OK") print("OK")
print("Add a second speed dial...", end="") print("Add a second speed dial...", end="")
step(driver, '//*[@id="q-app"]//div//button[contains(@class, "q-btn-rectangle")]') step(driver, '//*[@id="q-app"]//div//button[contains(@class, "q-btn-rectangle")]')
@ -1328,11 +1265,11 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if second speed dial details are correct...", end="") print("Check if second speed dial details are correct...", end="")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="q-item-label"]/span[contains(text(), "*2")]') '//*[@id="q-app"]//div[@class="q-item-label"]/span[contains(text(), "*2")]').text, "When I dial *2 ...",
.text, "When I dial *2 ...", "Speed dial has not been created") "Speed dial has not been created")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[@class="q-item-sublabel"][contains(text(), "asdf")]') '//*[@id="q-app"]//div[@class="q-item-sublabel"][contains(text(), "asdf")]').text, "ring asdf",
.text, "ring asdf", "Speed dial is not correct") "Speed dial is not correct")
print("OK") print("OK")
print("Delete all speed dials...", end="") print("Delete all speed dials...", end="")
driver.find_element_by_xpath( driver.find_element_by_xpath(
@ -1349,14 +1286,12 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if speed dials were deleted...", end="") print("Check if speed dials were deleted...", end="")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "No speed dials found")]') '//*[@id="q-app"]//div[contains(text(), "No speed dials found")]')) > 0, "Speed dials was not deleted")
) > 0, "Speed dials was not deleted")
print("OK") print("OK")
print("Logout...", end="") print("Logout...", end="")
logout_csc(driver) logout_csc(driver)
self.assertEqual( self.assertEqual(
driver.current_url, os.environ['CATALYST_SERVER'] + driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Logout failed")
"/login/subscriber/#/login", "Logout failed")
print("OK") print("OK")
filename = 0 filename = 0
@ -1408,24 +1343,20 @@ class testrun(unittest.TestCase):
print("OK") print("OK")
print("Check if voicebox settings are correct...", end="") print("Check if voicebox settings are correct...", end="")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "Change PIN")]/../input') '//*[@id="q-app"]//div[contains(text(), "Change PIN")]/../input').get_attribute('value'), "12345", "PIN is not correct")
.get_attribute('value'), "12345", "PIN is not correct")
self.assertEqual(driver.find_element_by_xpath( self.assertEqual(driver.find_element_by_xpath(
'//*[@id="q-app"]//div[contains(text(), "Change Email")]/../input') '//*[@id="q-app"]//div[contains(text(), "Change Email")]/../input').get_attribute('value'), "test@email.com", "Email is not correct")
.get_attribute('value'), "test@email.com", "Email is not correct")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[contains(@class, "csc-toggle-enabled")]/span[contains(text(), "Attach voicemail")]')) > 0, '//*[@id="q-app"]//div[contains(@class, "csc-toggle-enabled")]/span[contains(text(), "Attach voicemail")]')) > 0,
"Option 'Attach voicemail to email notification' was not enabled") "Option 'Attach voicemail to email notification' was not enabled")
self.assertTrue(len(driver.find_elements_by_xpath( self.assertTrue(len(driver.find_elements_by_xpath(
'//*[@id="q-app"]//div[contains(@class, "csc-toggle-enabled")]/span[contains(text(), "Delete voicemail")]')) > 0, '//*[@id="q-app"]//div[contains(@class, "csc-toggle-enabled")]/span[contains(text(), "Delete voicemail")]')) > 0,
"Option 'Delete voicemail after email notification is delivered' " "Option 'Delete voicemail after email notification is delivered' was not enabled")
"was not enabled")
print("OK") print("OK")
print("Logout...", end="") print("Logout...", end="")
logout_csc(driver) logout_csc(driver)
self.assertEqual( self.assertEqual(
driver.current_url, os.environ['CATALYST_SERVER'] + driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Logout failed")
"/login/subscriber/#/login", "Logout failed")
print("OK") print("OK")
filename = 0 filename = 0
@ -1445,7 +1376,7 @@ if __name__ == '__main__':
try: try:
preparation() preparation()
except Exception as e: except Exception as e:
print('Preperation failed! See logs below for more details') print('Preperation failed! See log below for more details')
print('--------------------------------------------------------------') print('--------------------------------------------------------------')
traceback.print_exc() traceback.print_exc()
print('--------------------------------------------------------------') print('--------------------------------------------------------------')

Loading…
Cancel
Save