From 0d19893f7a0a2c24c86aa8bc2ec472ae2afc24a1 Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Thu, 19 Aug 2021 10:17:26 +0200 Subject: [PATCH] TT#70901 selenium: prevent date selection from choosing year instead of date When day = 20 for example, it selects the year 20xx instead of the 20. of the month, due to only checking if button contains number 20. Specifying XPATH more clearly and dropping contains check to prevent this Change-Id: I597e181ad2d88e40dfa0efc27dd29bacea7722eb --- t/selenium/testrun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/selenium/testrun.py b/t/selenium/testrun.py index 9bd4e3ea..145c2676 100644 --- a/t/selenium/testrun.py +++ b/t/selenium/testrun.py @@ -205,7 +205,7 @@ class testrun(unittest.TestCase): day += 1 driver.find_element_by_xpath('//*[@id="csc-wrapper-call-forwarding"]//div/span[contains(., "condition")]').click() driver.find_element_by_xpath('/html/body/div[3]/div/div[2]/div/div[3]/div[3]').click() - driver.find_element_by_xpath('/html/body//div/button[contains(., ' + str(day) + ')]').click() + driver.find_element_by_xpath('/html/body//div[@class="q-date__calendar-days fit"]/div[' + str(day) + ']/button').click() driver.find_element_by_xpath('/html/body//div//button[contains(., "Save")]').click() wait_for_invisibility(driver, '//*[@id="csc-wrapper-call-forwarding"]/div/div[2]/div[4]/svg') self.assertTrue(