use CI_COMMIT_SHORT_SHA for selenium test mock

This commit is contained in:
Andrew Dolgov 2023-10-22 12:46:39 +03:00
parent 8d3f570ee9
commit 752c692170
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
1 changed files with 12 additions and 2 deletions

View File

@ -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()