Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
slapos
Commits
d8ad49b3
Commit
d8ad49b3
authored
Nov 23, 2018
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chromium stage change
parent
30b9888d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
9 deletions
+27
-9
software/jstestnode/instance.cfg.in
software/jstestnode/instance.cfg.in
+1
-0
software/jstestnode/runTestSuite.in
software/jstestnode/runTestSuite.in
+16
-7
software/jstestnode/software.cfg
software/jstestnode/software.cfg
+10
-2
No files found.
software/jstestnode/instance.cfg.in
View file @
d8ad49b3
...
@@ -36,6 +36,7 @@ recipe = slapos.recipe.template
...
@@ -36,6 +36,7 @@ recipe = slapos.recipe.template
url = ${template-runTestSuite:output}
url = ${template-runTestSuite:output}
output = $${directory:bin}/runTestSuite
output = $${directory:bin}/runTestSuite
buildout-directory = $${buildout:directory}
buildout-directory = $${buildout:directory}
configuration = $${instance-parameter:configuration}
mode = 0700
mode = 0700
[xvfb-instance]
[xvfb-instance]
...
...
software/jstestnode/runTestSuite.in
View file @
d8ad49b3
...
@@ -13,9 +13,11 @@ from selenium.webdriver.common.by import By
...
@@ -13,9 +13,11 @@ 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
os.environ['TMPDIR'] = '$${xvfb-instance:tmp-path}'
#
os.environ['TMPDIR'] = '$${xvfb-instance:tmp-path}'
os.environ['DISPLAY'] = ':0'
os.environ['DISPLAY'] = ':0'
# execute "Xvfb :0 -screen 0 1024x768x24 +extension RANDR &", but where?
BASE_URL = 'http://[$${nginx-configuration:ip}]:$${nginx-configuration:port}/'
BASE_URL = 'http://[$${nginx-configuration:ip}]:$${nginx-configuration:port}/'
def main():
def main():
...
@@ -49,12 +51,12 @@ def main():
...
@@ -49,12 +51,12 @@ def main():
args = parser.parse_args()
args = parser.parse_args()
import
json
import
ast
parsed_parameters = json.loads('$${instance-parameter:configuration._}')
configuration = ast.literal_eval('''$${instance-parameter:configuration}'''[4:]) # There has "!py!" prefix in here, remove it.
parsed_parameters = configuration.get('_', {})
if not getattr(args, 'target', None):
if not getattr(args, 'target', None):
args.target = parsed_parameters.get('target', '
firefox
')
args.target = parsed_parameters.get('target', '
chrome
')
if not getattr(args, 'test_suite', None):
if not getattr(args, 'test_suite', None):
args.test_suite = parsed_parameters.get('test-suite')
args.test_suite = parsed_parameters.get('test-suite')
if not getattr(args, 'target_version', None):
if not getattr(args, 'target_version', None):
...
@@ -87,8 +89,15 @@ def main():
...
@@ -87,8 +89,15 @@ def main():
##########################
##########################
is_appium = False
is_appium = False
if args.target == 'firefox':
if args.target == 'chrome':
chrome_options = webdriver.chrome.options.Options()
chrome_options.binary_location = '${chromium:location}/chrome'
chrome_args = ['--headless', '--no-sandbox', '--disable-gpu']
for arg in chrome_args:
chrome_options.add_argument(arg)
browser = webdriver.Chrome(executable_path='${chromedriver:location}/chromedriver', chrome_options=chrome_options)
elif args.target == 'firefox':
firefox_capabilities = webdriver.common.desired_capabilities.DesiredCapabilities.FIREFOX
firefox_capabilities = webdriver.common.desired_capabilities.DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True
firefox_capabilities['marionette'] = True
firefox_capabilities['binary'] = '${firefox:location}/firefox-slapos'
firefox_capabilities['binary'] = '${firefox:location}/firefox-slapos'
...
...
software/jstestnode/software.cfg
View file @
d8ad49b3
...
@@ -4,6 +4,7 @@ extends =
...
@@ -4,6 +4,7 @@ extends =
../../stack/nodejs.cfg
../../stack/nodejs.cfg
../../component/git/buildout.cfg
../../component/git/buildout.cfg
../../component/xorg/buildout.cfg
../../component/xorg/buildout.cfg
../../component/headless-chromium/buildout.cfg
../../component/firefox/buildout.cfg
../../component/firefox/buildout.cfg
../../component/dash/buildout.cfg
../../component/dash/buildout.cfg
../../component/nginx/buildout.cfg
../../component/nginx/buildout.cfg
...
@@ -15,6 +16,13 @@ parts =
...
@@ -15,6 +16,13 @@ parts =
git
git
eggs
eggs
xserver
xserver
depot_tools
chromedriver
chromium-download
chromium
gconf
scrnsaverproto
libXScrnSaver
firefox
firefox
xwd
xwd
renderjs-install
renderjs-install
...
@@ -25,7 +33,7 @@ parts =
...
@@ -25,7 +33,7 @@ parts =
[instance]
[instance]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
md5sum =
7c907db5f803b03a218b49888a3a3799
md5sum =
addf9f7f1d6d9537fca03cbd72eafe2d
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 +115,7 @@ mode = 0644
...
@@ -107,7 +115,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 =
fcf15b2a90340e0afe8f8b9921a4ffae
md5sum =
522bf77c9e3941481ace1aee7dc0b20c
output = ${buildout:directory}/runTestSuite.in
output = ${buildout:directory}/runTestSuite.in
mode = 0644
mode = 0644
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment