Commit 7842c41e authored by Romain Courteaud's avatar Romain Courteaud Committed by Kazuhiko Shiozaki

software/jstestnode: Webdriver now uses geckodriver

parent 54d95d6a
...@@ -38,15 +38,6 @@ output = $${directory:bin}/runTestSuite ...@@ -38,15 +38,6 @@ output = $${directory:bin}/runTestSuite
buildout-directory = $${buildout:directory} buildout-directory = $${buildout:directory}
mode = 0700 mode = 0700
[firefox-instance]
recipe = slapos.cookbook:firefox
executable = firefox
runner-path = $${directory:bin}/$${:executable}
firefox-path = ${firefox:location}/firefox-slapos
prefsjs-path = $${directory:etc}/prefs.js
shell-path = ${dash:location}/bin/dash
tmp-path = $${xvfb-instance:tmp-path}
[xvfb-instance] [xvfb-instance]
recipe = slapos.cookbook:xvfb recipe = slapos.cookbook:xvfb
runner-path = $${directory:services}/xvfb runner-path = $${directory:services}/xvfb
......
...@@ -13,11 +13,9 @@ from selenium.webdriver.common.by import By ...@@ -13,11 +13,9 @@ from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support import expected_conditions as EC
# Put a 'firefox' executable in the path os.environ['TMPDIR'] = '$${xvfb-instance:tmp-path}'
# otherwise, WebDriver refuses to start os.environ['DISPLAY'] = ':0'
os.environ['PATH'] = '$${directory:bin}' + os.pathsep + os.environ['PATH']
FIREFOX_EXECUTABLE = '$${firefox-instance:executable}'
BASE_URL = 'http://[$${nginx-configuration:ip}]:$${nginx-configuration:port}/' BASE_URL = 'http://[$${nginx-configuration:ip}]:$${nginx-configuration:port}/'
def main(): def main():
...@@ -91,8 +89,10 @@ def main(): ...@@ -91,8 +89,10 @@ def main():
is_appium = False is_appium = False
if args.target == 'firefox': if args.target == 'firefox':
firefox_binary = webdriver.firefox.firefox_binary.FirefoxBinary(firefox_path=FIREFOX_EXECUTABLE) firefox_capabilities = webdriver.common.desired_capabilities.DesiredCapabilities.FIREFOX
browser = webdriver.Firefox(firefox_binary=firefox_binary, firefox_capabilities['marionette'] = True
firefox_capabilities['binary'] = '${firefox:location}/firefox-slapos'
browser = webdriver.Firefox(capabilities=firefox_capabilities,
executable_path='${firefox:location}/geckodriver') executable_path='${firefox:location}/geckodriver')
elif args.target in ['iOS', 'Android']: elif args.target in ['iOS', 'Android']:
# parameters for mobile emulators have different names then parameters for # parameters for mobile emulators have different names then parameters for
......
...@@ -25,7 +25,7 @@ parts = ...@@ -25,7 +25,7 @@ parts =
[instance] [instance]
recipe = slapos.recipe.template recipe = slapos.recipe.template
md5sum = 929a2b6cf6bb16e22e49984563547ca9 md5sum = 7c907db5f803b03a218b49888a3a3799
url = ${:_profile_base_location_}/instance.cfg.in url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg output = ${buildout:directory}/instance.cfg
mode = 0644 mode = 0644
...@@ -107,7 +107,7 @@ mode = 0644 ...@@ -107,7 +107,7 @@ mode = 0644
[template-runTestSuite] [template-runTestSuite]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/runTestSuite.in url = ${:_profile_base_location_}/runTestSuite.in
md5sum = 86f557c39d865a2b2a16e31fcf41d69c md5sum = fcf15b2a90340e0afe8f8b9921a4ffae
output = ${buildout:directory}/runTestSuite.in output = ${buildout:directory}/runTestSuite.in
mode = 0644 mode = 0644
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment