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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos
Commits
1afa9c32
Commit
1afa9c32
authored
Sep 02, 2011
by
Vivien Alger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commented out report and status part, and clean after xvfb terminate
parent
19ee4509
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
16 deletions
+32
-16
slapos/recipe/selenium/testrunner.py
slapos/recipe/selenium/testrunner.py
+32
-16
No files found.
slapos/recipe/selenium/testrunner.py
View file @
1afa9c32
...
@@ -25,35 +25,44 @@
...
@@ -25,35 +25,44 @@
#
#
#############################################################################
#############################################################################
from
slapos.recipe.testnode.erp5
testreporthandler
import
ERP5TestReportHandler
from
erp5functional
testreporthandler
import
ERP5TestReportHandler
from
time
import
sleep
from
time
import
sleep
from
os
import
environ
import
os
from
subprocess
import
Popen
,
PIPE
from
subprocess
import
Popen
,
PIPE
from
re
import
search
import
urllib2
import
urllib2
def
run
(
args
):
def
run
(
args
):
config
=
args
[
0
]
config
=
args
[
0
]
environ
[
'DISPLAY'
]
=
config
[
'display'
]
test_url
=
assembleTestUrl
(
config
[
'base_url'
],
config
[
'user'
],
config
[
'password'
])
test_url
=
assembleTestUrl
(
config
[
'base_url'
],
config
[
'user'
],
config
[
'password'
])
while
True
:
while
True
:
erp5_report
=
ERP5TestReportHandler
(
test_url
,
config
[
'suite_name'
])
erp5_report
=
ERP5TestReportHandler
(
test_url
,
config
[
'suite_name'
])
try
:
xvfb
=
Popen
([
config
[
'xvfb_binary'
],
config
[
'display'
]],
stdout
=
PIPE
)
chromium
=
Popen
([
config
[
'browser_binary'
],
config
[
'option'
],
config
[
'test_url'
]],
stdout
=
PIPE
)
os
.
environ
[
'DISPLAY'
]
=
config
[
'display'
]
erp5_report
.
reportStart
()
sleep
(
10
)
while
getStatus
(
config
[
'base_url'
])
is
None
:
command
=
[]
sleep
(
10
)
command
.
append
(
config
[
'browser_binary'
])
command
.
append
(
config
[
'option_ssl'
])
command
.
append
(
config
[
'option_translate'
])
command
.
append
(
config
[
'option_security'
])
command
.
append
(
test_url
)
erp5_report
.
reportFinished
()
chromium
=
Popen
(
command
,
stdout
=
PIPE
)
erp5_report
.
reportStart
()
sleep
(
10
)
#while getStatus(config['base_url']) is None:
# sleep(10)
except
Exception
:
#erp5_report.reportFinished(getStatus(config['base_url']).encode("utf-8", "replace"))
pass
chromium
.
kill
()
chromium
.
terminate
(
)
terminateXvfb
(
xvfb
,
config
[
'display'
]
)
sleep
(
60
0
)
sleep
(
1
0
)
def
openUrl
(
url
):
def
openUrl
(
url
):
# Send Accept-Charset headers to activate the UnicodeConflictResolver
# Send Accept-Charset headers to activate the UnicodeConflictResolver
...
@@ -85,6 +94,13 @@ def assembleTestUrl(base_url, user, password):
...
@@ -85,6 +94,13 @@ def assembleTestUrl(base_url, user, password):
Create the full url to the testrunner
Create the full url to the testrunner
"""
"""
test_url
=
"%s/core/TestRunner.html?test=../test_suite_html&
auto=on&resultsUrl=%s/postResults
&__ac_name=%s&__ac_password=%s"
%
(
base_url
,
base_url
,
user
,
password
)
test_url
=
"%s/core/TestRunner.html?test=../test_suite_html&
resultsUrl=%s/postResults&auto=on
&__ac_name=%s&__ac_password=%s"
%
(
base_url
,
base_url
,
user
,
password
)
return
test_url
return
test_url
def
terminateXvfb
(
process
,
display
):
process
.
kill
()
lock_filepath
=
'/tmp/.X%s-lock'
%
display
.
replace
(
":"
,
""
)
if
os
.
path
.
exists
(
lock_filepath
):
os
.
system
(
'rm %s'
%
lock_filepath
)
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