From 0358602bb7b6d3d368889318159fc17be5593267 Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Wed, 27 Nov 2019 09:23:33 +0100 Subject: [PATCH] TT#70901 selenium: add speed dial test - log in to csc interface - create a speed dial - check if speed dial was correctly created - delete speed dial - check if speed dial was deleted Change-Id: Ia99de89171fd1f8781bcbc4b2864364fcb7769f8 --- t/selenium/testrun.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/t/selenium/testrun.py b/t/selenium/testrun.py index e9ee8bd1..04801038 100644 --- a/t/selenium/testrun.py +++ b/t/selenium/testrun.py @@ -71,6 +71,49 @@ class testrun(unittest.TestCase): driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Successfully logged out") + def test_speed_dial(self): + driver = self.driver + driver.find_element_by_link_text('Expand Groups').click() + domainname = driver.find_element_by_xpath( + '//*[@id="subscribers_table"]//tr[1]/td[3]').text + Collections.login(driver, "testuser@" + domainname, "testpasswd") + WebDriverWait(driver, 10).until(EC.element_to_be_clickable(( + By.XPATH, '//*[@id="main-menu"]//div[@class="q-item-label"]' + '[contains(text(), "Speed Dial")]'))) + driver.find_element_by_xpath( + '//*[@id="main-menu"]//div[@class="q-item-label"]' + '[contains(text(), "Speed Dial")]').click() + driver.find_element_by_xpath( + '//*[@id="q-app"]//div//button[contains' + '(@class, "q-btn-rectangle")]').click() + driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@tabindex="0"]').click() + driver.find_element_by_xpath( + '//*[@class="no-border scroll q-list q-list-link"]/div[2]').click() + driver.find_element_by_xpath( + '//*[@id="q-app"]//div/input' + '[@class="col q-input-target text-left"]').send_keys("testtext") + driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@class="row justify-center form-actions"]' + '/button[contains(@class, "text-primary")]').click() + self.assertEqual(driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@class="q-item-label"]' + '/span[contains(text(), "When")]') + .text, "When I dial *1 ...") + self.assertEqual(driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@class="q-item-sublabel"]' + '[contains(text(), "ring")]') + .text, "ring testtext") + driver.find_element_by_xpath( + '//*[@id="q-app"]//div/button[@slot="right"]').click() + driver.find_element_by_xpath( + '/html/body//div[@class="modal-buttons row"]//button' + '[contains(@class, "text-negative")]').click() + self.assertTrue(driver.find_element_by_xpath( + '//*[@id="q-app"]//div[contains(text(), "No speed dials found")]') + .is_displayed()) + Collections.logout(driver) + def tearDown(self): driver = self.driver try: