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
Gwenaël Samain
slapos
Commits
e46cbf75
Commit
e46cbf75
authored
Apr 04, 2017
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
c85bbc21
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
11 deletions
+29
-11
component/headless-chromium/buildout.cfg
component/headless-chromium/buildout.cfg
+2
-2
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.
component/headless-chromium/buildout.cfg
View file @
e46cbf75
...
...
@@ -64,8 +64,8 @@ command =
# and at some point the next command (gclient) would break.
# ...
# This command only could work in an empty dir.
fetch --nohooks chromium
gclient sync --revision ${:revision} --with_branch_heads
#
fetch --nohooks chromium
#
gclient sync --revision ${:revision} --with_branch_heads
stop-on-error = true
[chromium]
...
...
software/jstestnode/instance.cfg.in
View file @
e46cbf75
...
...
@@ -36,6 +36,7 @@ recipe = slapos.recipe.template
url = ${template-runTestSuite:output}
output = $${directory:bin}/runTestSuite
buildout-directory = $${buildout:directory}
configuration = $${instance-parameter:configuration}
mode = 0700
[xvfb-instance]
...
...
software/jstestnode/runTestSuite.in
View file @
e46cbf75
...
...
@@ -13,9 +13,11 @@ from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
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'
# execute "Xvfb :0 -screen 0 1024x768x24 +extension RANDR &", but where?
BASE_URL = 'http://[$${nginx-configuration:ip}]:$${nginx-configuration:port}/'
def main():
...
...
@@ -49,12 +51,12 @@ def main():
args = parser.parse_args()
import
json
parsed_parameters = json.loads('$${instance-parameter:configuration._}')
import
ast
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):
args.target = parsed_parameters.get('target', '
firefox
')
args.target = parsed_parameters.get('target', '
chrome
')
if not getattr(args, 'test_suite', None):
args.test_suite = parsed_parameters.get('test-suite')
if not getattr(args, 'target_version', None):
...
...
@@ -88,7 +90,14 @@ def main():
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['marionette'] = True
firefox_capabilities['binary'] = '${firefox:location}/firefox-slapos'
...
...
software/jstestnode/software.cfg
View file @
e46cbf75
...
...
@@ -4,6 +4,7 @@ extends =
../../stack/nodejs.cfg
../../component/git/buildout.cfg
../../component/xorg/buildout.cfg
../../component/headless-chromium/buildout.cfg
../../component/firefox/buildout.cfg
../../component/dash/buildout.cfg
../../component/nginx/buildout.cfg
...
...
@@ -15,6 +16,13 @@ parts =
git
eggs
xserver
depot_tools
chromedriver
chromium-download
chromium
gconf
scrnsaverproto
libXScrnSaver
firefox
xwd
renderjs-install
...
...
@@ -25,7 +33,7 @@ parts =
[instance]
recipe = slapos.recipe.template
md5sum =
7c907db5f803b03a218b49888a3a3799
md5sum =
addf9f7f1d6d9537fca03cbd72eafe2d
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg
mode = 0644
...
...
@@ -107,7 +115,7 @@ mode = 0644
[template-runTestSuite]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/runTestSuite.in
md5sum =
fcf15b2a90340e0afe8f8b9921a4ffae
md5sum =
522bf77c9e3941481ace1aee7dc0b20c
output = ${buildout:directory}/runTestSuite.in
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