From 6d399c38317955429c4fd754893e3b140eaf3706 Mon Sep 17 00:00:00 2001 From: Omar Munoz Date: Wed, 15 May 2024 15:50:24 -0500 Subject: [PATCH] Fix selenium test for additional compatibility. Change-Id: I2b5bd47d1a648813987ff10184d2468473454dfd --- grafana/Chart.yaml | 2 +- grafana/templates/bin/_selenium-tests.py.tpl | 4 ++-- releasenotes/notes/grafana.yaml | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/grafana/Chart.yaml b/grafana/Chart.yaml index 469bc9f4c..2e43e99e5 100644 --- a/grafana/Chart.yaml +++ b/grafana/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v9.2.10 description: OpenStack-Helm Grafana name: grafana -version: 0.1.22 +version: 0.1.23 home: https://grafana.com/ sources: - https://github.com/grafana/grafana diff --git a/grafana/templates/bin/_selenium-tests.py.tpl b/grafana/templates/bin/_selenium-tests.py.tpl index 079a8d060..e8c21f740 100644 --- a/grafana/templates/bin/_selenium-tests.py.tpl +++ b/grafana/templates/bin/_selenium-tests.py.tpl @@ -83,11 +83,11 @@ try: {{- if .Values.selenium_v4 }} browser.find_element(By.NAME, 'user').send_keys(username) browser.find_element(By.NAME, 'password').send_keys(password) - browser.find_element(By.CSS_SELECTOR, '[aria-label="Login button"]').click() + browser.find_element(By.CSS_SELECTOR, '[type="submit"]').click() {{- else }} browser.find_element_by_name('user').send_keys(username) browser.find_element_by_name('password').send_keys(password) - browser.find_element_by_css_selector('[aria-label="Login button"]').click() + browser.find_element_by_css_selector('[type="submit"]').click() {{- end }} logger.info("Successfully logged in to Grafana") except NoSuchElementException: diff --git a/releasenotes/notes/grafana.yaml b/releasenotes/notes/grafana.yaml index deae4f874..ded34d789 100644 --- a/releasenotes/notes/grafana.yaml +++ b/releasenotes/notes/grafana.yaml @@ -23,4 +23,5 @@ grafana: - 0.1.20 Upgrade osh-selenium image to latest-ubuntu_focal - 0.1.21 Fix run migrator job deployment condition - 0.1.22 Make selenium v4 syntax optional + - 0.1.23 Modified selenium test for compatibility ...