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
Iliya Manolov
slapos
Commits
583c7978
Commit
583c7978
authored
Oct 28, 2011
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to factor code with ERP5 if needed
parent
98008e8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
slapos/recipe/seleniumrunner/ERP5TypeFunctionalTestCase.py
slapos/recipe/seleniumrunner/ERP5TypeFunctionalTestCase.py
+4
-2
slapos/recipe/seleniumrunner/testrunner.py
slapos/recipe/seleniumrunner/testrunner.py
+2
-2
No files found.
slapos/recipe/seleniumrunner/ERP5TypeFunctionalTestCase.py
View file @
583c7978
...
@@ -69,7 +69,7 @@ class TimeoutError(Exception):
...
@@ -69,7 +69,7 @@ class TimeoutError(Exception):
pass
pass
class Xvfb:
class Xvfb:
def __init__(self,
xvfb_location, fbdir
):
def __init__(self,
fbdir, xvfb_location="Xvfb"
):
self.display_list = [":%s" % i for i in range(123, 144)]
self.display_list = [":%s" % i for i in range(123, 144)]
self.display = None
self.display = None
self.fbdir = fbdir
self.fbdir = fbdir
...
@@ -115,7 +115,7 @@ class Xvfb:
...
@@ -115,7 +115,7 @@ class Xvfb:
class Browser:
class Browser:
use_xvfb = 1
use_xvfb = 1
def __init__(self,
bin_location, profile_dir, host
):
def __init__(self,
profile_dir, host, bin_location=None
):
self.bin_location = bin_location
self.bin_location = bin_location
self.profile_dir = profile_dir
self.profile_dir = profile_dir
self.host = host
self.host = host
...
@@ -175,6 +175,8 @@ class Firefox(Browser):
...
@@ -175,6 +175,8 @@ class Firefox(Browser):
def _run(self, url):
def _run(self, url):
# Prepare to run
# Prepare to run
if not self.bin_location:
self.bin_location = "firefox"
self._createFile('
prefs
.
js
', self.getPrefJs())
self._createFile('
prefs
.
js
', self.getPrefJs())
self._runCommand((self.bin_location, "firefox", "-no-remote",
self._runCommand((self.bin_location, "firefox", "-no-remote",
"-profile", self.profile_dir, url))
"-profile", self.profile_dir, url))
...
...
slapos/recipe/seleniumrunner/testrunner.py
View file @
583c7978
...
@@ -67,9 +67,9 @@ def run(args):
...
@@ -67,9 +67,9 @@ def run(args):
# sleep(10)
# sleep(10)
os
.
environ
[
'DISPLAY'
]
=
config
[
'display'
]
os
.
environ
[
'DISPLAY'
]
=
config
[
'display'
]
xvfb
=
Xvfb
(
config
[
'
xvfb_binary'
],
config
[
'etc_directo
ry'
])
xvfb
=
Xvfb
(
config
[
'
etc_directory'
],
config
[
'xvfb_bina
ry'
])
profile_dir
=
os
.
path
.
join
(
config
[
'etc_directory'
],
'profile'
)
profile_dir
=
os
.
path
.
join
(
config
[
'etc_directory'
],
'profile'
)
browser
=
Firefox
(
config
[
'browser_binary'
],
profile_dir
,
config
[
'base_url
'
])
browser
=
Firefox
(
profile_dir
,
config
[
'base_url'
],
config
[
'browser_binary
'
])
try
:
try
:
start
=
time
.
time
()
start
=
time
.
time
()
xvfb
.
run
()
xvfb
.
run
()
...
...
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