Commit 18db2316 authored by Xiaowu Zhang's avatar Xiaowu Zhang

jstestnode: add remote-access-url instance parameter

this parameter is used for external service like saucelab to access test url
parent 58ce9622
...@@ -120,10 +120,15 @@ def main(): ...@@ -120,10 +120,15 @@ def main():
appium_url = "http://%s@ondemand.saucelabs.com/wd/hub" % (args.appium_server_auth) appium_url = "http://%s@ondemand.saucelabs.com/wd/hub" % (args.appium_server_auth)
browser = webdriver.Remote(appium_url, capabilities) browser = webdriver.Remote(appium_url, capabilities)
# adjust make path to testnode's frontend # adjust path for remote test url
full_path = '$${runTestSuite-instance:buildout-directory}/software_release/parts/%s' % parsed_parameters['test-url'] remote_access_url = parsed_parameters.get('remote-access-url', None)
full_path = full_path.split('srv')[-1] if remote_access_url:
url = "%s%s" % (args.frontend_url, full_path) if ('jio' in test_suite):
url = os.path.join(remote_access_url, 'jio/test/tests.html')
else:
url = os.path.join(remote_access_url, 'renderjs/test/')
else:
raise ValueError('remote-access-url is not defined in instance parameter')
is_browser_running = True is_browser_running = True
agent = browser.execute_script("return navigator.userAgent") agent = browser.execute_script("return navigator.userAgent")
......
...@@ -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 = ff66d13f73982e8257eb5535cdb541c7 md5sum = 0a918eb070d28abfd33e0fcca26569ff
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