From 9721e1ac6b0467291f15f05e5e6d0ab5d1398c30 Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Wed, 27 Nov 2019 13:42:08 +0100 Subject: [PATCH] TT#70901 selenium: add reminder test - log in to csc interface - enable reminders - set time for reminders - change reminders setting to 'always' - check with asserts if everything was applied correctly Change-Id: Id87aeaa32cc9362989530169bb221eb5af0e09b1 --- t/selenium/testrun.py | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/t/selenium/testrun.py b/t/selenium/testrun.py index 04801038..e5e6fa9b 100644 --- a/t/selenium/testrun.py +++ b/t/selenium/testrun.py @@ -71,6 +71,61 @@ class testrun(unittest.TestCase): driver.current_url, os.environ['CATALYST_SERVER'] + "/login/subscriber/#/login", "Successfully logged out") + def test_reminder(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(), "Reminder")]'))) + driver.find_element_by_xpath( + '//*[@id="main-menu"]//div[@class="q-item-label"]' + '[contains(text(), "Reminder")]').click() + WebDriverWait(driver, 10).until(EC.element_to_be_clickable(( + By.XPATH, '//*[@id="q-app"]//div[@tabindex="0"][@class="q-toggle ' + 'q-option cursor-pointer no-outline q-focusable row inline ' + 'no-wrap items-center"]'))) + driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@tabindex="0"][@class="q-toggle ' + 'q-option cursor-pointer no-outline q-focusable row inline ' + 'no-wrap items-center"]').click() + WebDriverWait(driver, 10).until(EC.element_to_be_clickable(( + By.XPATH, '//*[@id="q-app"]//div[contains(@class, ' + '"q-input-target justify-start")]'))) + driver.find_element_by_xpath( + '//*[@id="q-app"]//div[contains' + '(@class, "q-input-target justify-start")]').click() + driver.find_element_by_xpath( + '/html/body//div[contains(@class, "q-datetime-clock-circle")]' + '//div[contains(@class, "q-datetime-clock-pos-13")]').click() + driver.find_element_by_xpath( + '/html/body//div[contains(@class, "q-datetime-clock-circle")]' + '//div[contains(@class, "q-datetime-clock-pos-7")]').click() + driver.find_element_by_xpath( + '/html/body//div[contains(@class, "q-datetime-controls")]' + '/button[2]').click() + WebDriverWait(driver, 10).until(EC.element_to_be_clickable(( + By.XPATH, '//*[@id="q-app"]//div[@tabindex="0"]/span' + '[@class="q-option-label"][contains(text(), "Always")]'))) + driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@tabindex="0"]//span' + '[contains(text(), "Always")]').click() + self.assertEqual('Reminder is enabled', driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@tabindex="0"]//' + 'span[contains(text(), "Reminder")]').text, + "Reminder is enabled") + self.assertEqual('13:35', driver.find_element_by_xpath( + '//*[@id="q-app"]//div[contains' + '(@class, "q-input-target justify-start")]').text, + "Time is correct") + self.assertTrue(driver.find_element_by_xpath( + '//*[@id="q-app"]//div[@tabindex="0"]/div' + '[contains(@class, "active")]/../' + 'span[contains(text(), "Always")]').is_displayed(), + "Option 'Always' was selected") + def test_speed_dial(self): driver = self.driver driver.find_element_by_link_text('Expand Groups').click()