mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-18 16:44:34 +00:00
tests: Add Selenium webdriver options.
Some checks are pending
lint / build (3.12) (push) Waiting to run
Some checks are pending
lint / build (3.12) (push) Waiting to run
This commit is contained in:
parent
1d5d6004bc
commit
cc3ef1c065
1 changed files with 14 additions and 3 deletions
|
@ -7,7 +7,6 @@
|
|||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
import os
|
||||
from selenium.webdriver import Firefox
|
||||
from selenium.webdriver.common.by import By
|
||||
|
||||
|
||||
|
@ -15,10 +14,22 @@ BSX_0_PORT = int(os.getenv('BSX_0_PORT', 12701))
|
|||
BSX_1_PORT = int(os.getenv('BSX_1_PORT', BSX_0_PORT + 1))
|
||||
BSX_2_PORT = int(os.getenv('BSX_1_PORT', BSX_0_PORT + 2))
|
||||
|
||||
BSX_SELENIUM_DRIVER = os.getenv('BSX_SELENIUM_DRIVER', 'firefox')
|
||||
|
||||
|
||||
def get_driver():
|
||||
# driver = Chrome() # 2023-11: Hangs here
|
||||
driver = Firefox()
|
||||
if BSX_SELENIUM_DRIVER == 'firefox':
|
||||
from selenium.webdriver import Firefox, FirefoxOptions
|
||||
driver = Firefox(options=FirefoxOptions())
|
||||
elif BSX_SELENIUM_DRIVER == 'chrome':
|
||||
from selenium.webdriver import Chrome, ChromeOptions
|
||||
driver = Chrome(options=ChromeOptions())
|
||||
elif BSX_SELENIUM_DRIVER == 'safari':
|
||||
from selenium.webdriver import Safari, SafariOptions
|
||||
driver = Safari(options=SafariOptions())
|
||||
else:
|
||||
raise ValueError('Unknown driver ' + BSX_SELENIUM_DRIVER)
|
||||
|
||||
return driver
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue