Skip to content

Commit

Permalink
set pipeline selenium chromedriver location.
Browse files Browse the repository at this point in the history
  • Loading branch information
JFU-NAVA-PBC committed Dec 13, 2024
1 parent 25e7dd9 commit fe62763
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ pipeline {
}
}

stage("Start selenium grid by DinD ... in detached mode...") {
steps{
sh """
whoami
docker run -d --rm -it -p 4444:4444 -p 5900:5900 -p 7900:7900 --shm-size 2g selenium/standalone-chromium:latest
"""
}
}

stage("START BB2 server in background") {
when {
expression { params.RUN_SELENIUM_TESTS == true }
Expand All @@ -94,7 +85,7 @@ pipeline {
}
steps{
sh """
USE_NEW_PERM_SCREEN=true SELENIUM_GRID=true SELENIUM_GRID_HOST=localhost pytest -s ./apps/integration_tests/logging_tests.py::TestLoggings::test_auth_fhir_flows_logging
USE_NEW_PERM_SCREEN=true ON_REMOTE_CI=true pytest -s ./apps/integration_tests/logging_tests.py::TestLoggings::test_auth_fhir_flows_logging
"""
}
}
Expand All @@ -106,7 +97,7 @@ pipeline {
steps{
sh 'echo "RUN selenium tests - user account and app management tests"'
sh """
USE_NEW_PERM_SCREEN=true SELENIUM_GRID=true SELENIUM_GRID_HOST=localhost pytest -s ./apps/integration_tests/selenium_accounts_tests.py::TestUserAndAppMgmt::testAccountAndAppMgmt
USE_NEW_PERM_SCREEN=true ON_REMOTE_CI=true pytest -s ./apps/integration_tests/selenium_accounts_tests.py::TestUserAndAppMgmt::testAccountAndAppMgmt
"""
}
}
Expand Down Expand Up @@ -134,7 +125,7 @@ pipeline {
steps{
sh 'echo "RUN selenium tests - testclient based authorization flow tests and data flow tests"'
sh """
USE_NEW_PERM_SCREEN=true SELENIUM_GRID=true SELENIUM_GRID_HOST=localhost pytest -s ./apps/integration_tests/selenium_tests.py
USE_NEW_PERM_SCREEN=true ON_REMOTE_CI=true pytest -s ./apps/integration_tests/selenium_tests.py
"""
}
}
Expand Down
3 changes: 2 additions & 1 deletion apps/integration_tests/selenium_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def setup_method(self, method):
else:
print("driver_ready={}".format(SeleniumGenericTests.driver_ready))

self.on_remote_ci = os.getenv('ON_REMOTE_CI', 'false')
self.selenium_grid_host = os.getenv('SELENIUM_GRID_HOST', "chrome")
self.selenium_grid = os.getenv('SELENIUM_GRID', "false")
self.hostname_url = os.environ['HOSTNAME_URL']
Expand Down Expand Up @@ -80,7 +81,7 @@ def setup_method(self, method):
self.driver = webdriver.Remote(
command_executor=hub_url, options=opt)
else:
driver_exec = '/usr/bin/chromedriver'
driver_exec = '/usr/local/bin/chromedriver' if self.on_remote_ci.lower() == 'true' else '/usr/bin/chromedriver'
print("Chrome Driver, location={}".format(driver_exec))
opt.add_argument("--window-size=1920,1080")
opt.add_argument("--headless")
Expand Down

0 comments on commit fe62763

Please sign in to comment.