From c1407c4dc59a7a5a8d6350d713932d022b181c80 Mon Sep 17 00:00:00 2001 From: philip Date: Thu, 23 Nov 2023 16:49:19 +0000 Subject: [PATCH] support headless --- .circleci/config.yml | 1 + doajtest/selenium_helpers.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 01c6a666da..a8b6e6f257 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,6 +54,7 @@ jobs: command: | echo "SELENIUM_REMOTE_URL = ''" >> test.cfg echo "SELENIUM_DOAJ_HOST = '127.0.0.1'" >> test.cfg + echo "SELENIUM_HEADLESS = True" >> test.cfg # - run: # name: Install Dcoker Compose # environment: diff --git a/doajtest/selenium_helpers.py b/doajtest/selenium_helpers.py index 54af3f02fd..8f620f3bba 100644 --- a/doajtest/selenium_helpers.py +++ b/doajtest/selenium_helpers.py @@ -108,6 +108,8 @@ def setUp(self): # run selenium with your local browser options = webdriver.ChromeOptions() options.add_argument('--start-maximized') # maximize browser window + if self.app_test.config.get('SELENIUM_HEADLESS', False): + options.add_argument('--headless') browser_driver = webdriver.Chrome(options=options) self.selenium = browser_driver