Skip to content

Commit

Permalink
Attempt to change which chromedriver is foudn first in the path, as s…
Browse files Browse the repository at this point in the history
…etting location using selenium code is not working
  • Loading branch information
asset-web committed Oct 24, 2023
1 parent 2637785 commit 7909696
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 7 additions & 1 deletion deploy/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,13 @@ def run_tests(env="test", use_local_mode=False, reuse_db=False, db_type="mysql",
src_dir = project_dir + "lib/" + env + "/src/temmpo/"

with change_dir(src_dir):
caller('%sbin/python3 manage.py test --noinput --exclude-tag=slow %s --settings=temmpo.settings.test_%s' % (venv_dir, cmd_suffix, db_type))
# Activate virtualenv to make local download of chromedriver first in path
caller('which chromedriver')
caller('source %sbin/activate' % venv_dir)
caller('which chromedriver')
caller('chromedriver -v')
caller('python3 manage.py test --noinput --exclude-tag=slow %s --settings=temmpo.settings.test_%s' % (venv_dir, cmd_suffix, db_type))
caller('%sbin/deactivate' % venv_dir)

def run_slow_tests(env="test", use_local_mode=False, reuse_db=False, db_type="mysql", run_selenium_tests=False, tag=None, project_dir=PROJECT_ROOT):
"""env=test,use_local_mode=False,reuse_db=False,db_type=mysql,run_selenium_tests=False,tag=None"""
Expand Down
4 changes: 1 addition & 3 deletions tests/base_selenium_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

logger = logging.getLogger(__name__)

# Attempt to bugfix setting path by overriding contstant used in selenium code
CHROMEDRIVER_PATH = "/usr/local/projects/temmpo/lib/test/bin/chromedriver"

class SeleniumBaseTestCase(StaticLiveServerTestCase):
"""A base test case for Selenium, providing helper methods - NB specifically to be run on the test server"""
Expand All @@ -32,7 +30,7 @@ def setUpClass(cls):
cls.display = Display(visible=0, size=(1920, 1080))
cls.display.start()
# ref: https://github.com/SeleniumHQ/selenium/issues/12746
service = webdriver.ChromeService(executable_path=CHROMEDRIVER_PATH)
service = webdriver.ChromeService()
cls.driver = webdriver.Chrome(service=service)
cls.driver.implicitly_wait(10)

Expand Down

0 comments on commit 7909696

Please sign in to comment.