summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-10-22 12:46:39 +0300
committerAndrew Dolgov <[email protected]>2023-10-22 12:46:39 +0300
commit752c692170a828a4ca6dd6c16070940670da6c8e (patch)
treed4bda916445874841e7fad9466ada7c3a95f48b9
parent8d3f570ee9b14560ac4cb48543b28b9a5a1281fc (diff)
use CI_COMMIT_SHORT_SHA for selenium test mock
-rw-r--r--tests/selenium/test.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/selenium/test.py b/tests/selenium/test.py
index b1576cac1..6280b58b8 100644
--- a/tests/selenium/test.py
+++ b/tests/selenium/test.py
@@ -1,7 +1,14 @@
#!/usr/bin/python3
+import os
from selenium import webdriver
+CI_COMMIT_SHORT_SHA = os.getenv("CI_COMMIT_SHORT_SHA")
+
+if not CI_COMMIT_SHORT_SHA:
+ print("CI_COMMIT_SHORT_SHA env var should be defined")
+ exit(1)
+
options = webdriver.ChromeOptions()
driver = webdriver.Remote(
@@ -9,7 +16,10 @@ driver = webdriver.Remote(
options=options
)
-driver.get("http://tt-rss-latest-app.gitlab-fakecake.svc.cluster.local/tt-rss")
+app_url = f"http://tt-rss-{CI_COMMIT_SHORT_SHA}-app.gitlab-fakecake.svc.cluster.local/tt-rss"
+
+print(f"base url = {app_url}")
+
+driver.get(app_url)
print(driver.page_source)
driver.quit()
-