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
Valentin Benozillo
slapos
Commits
19ee4509
Commit
19ee4509
authored
Sep 02, 2011
by
Vivien Alger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored recipe so that everything is in one wrapper
parent
166975d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
32 deletions
+20
-32
slapos/recipe/selenium/__init__.py
slapos/recipe/selenium/__init__.py
+20
-32
No files found.
slapos/recipe/selenium/__init__.py
View file @
19ee4509
...
@@ -46,47 +46,31 @@ class Recipe(BaseSlapRecipe):
...
@@ -46,47 +46,31 @@ class Recipe(BaseSlapRecipe):
self
.
path_list
=
[]
self
.
path_list
=
[]
self
.
requirements
,
self
.
ws
=
self
.
egg
.
working_set
()
self
.
requirements
,
self
.
ws
=
self
.
egg
.
working_set
()
xvfb_conf
=
self
.
instaciateXvfb
()
self
.
instanciateTestRunner
(
xvfb_conf
[
'display'
]
)
self
.
instanciateTestRunner
(
self
.
getDisplay
()
)
self
.
linkBinary
()
self
.
linkBinary
()
self
.
computer_partition_setConnectionDict
()
return
self
.
path_list
return
self
.
path_list
def
instanciateXvfb
(
self
):
def
getDisplay
(
self
):
"""
"""
C
reate Xvfb configuration dictionnary and instanciate a wrapper for it
C
hoose a display for the instance
Parameters : None
Parameters : None
Returns :
Dictionnary xvfb_conf
Returns :
display
"""
"""
xvfb_conf
=
{}
xvfb_conf
[
'xvfb_binary'
]
=
self
.
options
[
'xvfb_binary'
]
display_list
=
[
":%s"
%
i
for
i
in
range
(
123
,
144
)]
display_list
=
[
":%s"
%
i
for
i
in
range
(
123
,
144
)]
for
display_try
in
display_list
:
for
display_try
in
display_list
:
lock_filepath
=
'/tmp/.X%s-lock'
%
display_try
.
replace
(
":"
,
""
)
lock_filepath
=
'/tmp/.X%s-lock'
%
display_try
.
replace
(
":"
,
""
)
if
not
os
.
path
.
exists
(
lock_filepath
):
if
not
os
.
path
.
exists
(
lock_filepath
):
xvfb_conf
[
'display'
]
=
display_try
display
=
display_try
break
break
xvfb_template_location
=
pkg_resources
.
resource_filename
(
return
display
__name__
,
os
.
path
.
join
(
'template'
,
'xvfb_run.in'
))
xvfb_runner_path
=
self
.
createRunningWrapper
(
"Xvfb"
,
self
.
substituteTemplate
(
xvfb_template_location
,
xvfb_conf
))
self
.
path_list
.
append
(
xvfb_runner_path
)
return
xvfb_conf
def
instanciateTestRunner
(
self
,
display
):
def
instanciateTestRunner
(
self
,
display
):
"""
"""
...
@@ -97,17 +81,21 @@ class Recipe(BaseSlapRecipe):
...
@@ -97,17 +81,21 @@ class Recipe(BaseSlapRecipe):
Returns : None
Returns : None
"""
"""
self
.
path_list
.
extend
(
zc
.
buildout
.
easy_install
.
scripts
([(
if
self
.
parameter_dict
[
'browser'
]
==
'chrome'
or
self
.
parameter_dict
[
'browser'
]
==
'chromium'
:
'selenium'
,
__name__
+
'.testrunner'
,
'run'
)],
self
.
ws
,
self
.
path_list
.
extend
(
zc
.
buildout
.
easy_install
.
scripts
([(
'testrunner'
,
__name__
+
'.testrunner'
,
'run'
)],
self
.
ws
,
sys
.
executable
,
self
.
wrapper_directory
,
arguments
=
[
sys
.
executable
,
self
.
wrapper_directory
,
arguments
=
[
dict
(
dict
(
browser_binary
=
self
.
options
[
'chromium_binary'
],
browser_binary
=
self
.
options
[
'chromium_binary'
],
display
=
display
,
xvfb_binary
=
self
.
options
[
'xvfb_binary'
],
option
=
"--ignore-certificate-errors --disable-translate --disable-web-security"
,
display
=
display
,
suite_name
=
self
.
parameter_dict
[
'suite_name'
],
option_ssl
=
'--ignore-certificate-errors'
,
base_url
=
self
.
parameter_dict
[
'url'
],
option_translate
=
'--disable-translate'
,
user
=
self
.
parameter_dict
[
'user'
],
option_security
=
'--disable-web-security'
,
password
=
self
.
paramer_dict
[
'password'
]
suite_name
=
self
.
parameter_dict
[
'suite_name'
],
base_url
=
self
.
parameter_dict
[
'url'
],
user
=
self
.
parameter_dict
[
'user'
],
password
=
self
.
parameter_dict
[
'password'
]
)]))
)]))
def
linkBinary
(
self
):
def
linkBinary
(
self
):
...
...
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