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
Kwabena Antwi-Boasiako
slapos
Commits
a4126731
Commit
a4126731
authored
Jan 17, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
selenium : Assert that test result is empty at start
parent
8682f8d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
29 deletions
+31
-29
slapos/recipe/seleniumrunner/testrunner.py
slapos/recipe/seleniumrunner/testrunner.py
+31
-29
No files found.
slapos/recipe/seleniumrunner/testrunner.py
View file @
a4126731
...
...
@@ -47,36 +47,38 @@ def run(args):
# Clean old test results if any
openUrl
(
'%s/TestTool_cleanUpTestResults?__ac_name=%s&__ac_password=%s'
%
(
config
[
'base_url'
],
config
[
'user'
],
config
[
'password'
]))
# TODO assert getresult is None
os
.
environ
[
'DISPLAY'
]
=
config
[
'display'
]
xvfb
=
Xvfb
(
config
[
'etc_directory'
],
config
[
'xvfb_binary'
])
profile_dir
=
os
.
path
.
join
(
config
[
'etc_directory'
],
'profile'
)
browser
=
Firefox
(
profile_dir
,
config
[
'base_url'
],
config
[
'browser_binary'
])
try
:
start
=
time
.
time
()
xvfb
.
run
()
if
getStatus
(
config
[
'base_url'
])
is
not
''
:
print
(
"ERROR : Impossible to clean old test result(s)"
)
else
:
# Environment is ready, we launch test.
os
.
environ
[
'DISPLAY'
]
=
config
[
'display'
]
xvfb
=
Xvfb
(
config
[
'etc_directory'
],
config
[
'xvfb_binary'
])
profile_dir
=
os
.
path
.
join
(
config
[
'etc_directory'
],
'profile'
)
browser
.
run
(
test_url
,
xvfb
.
display
)
erp5_report
.
reportStart
()
while
getStatus
(
config
[
'base_url'
])
is
''
:
time
.
sleep
(
10
)
if
(
time
.
time
()
-
start
)
>
float
(
timeout
):
raise
TimeoutError
(
"Test took more them %s seconds"
%
timeout
)
except
TimeoutError
:
continue
finally
:
browser
.
quit
()
xvfb
.
quit
()
erp5_report
.
reportFinished
(
getStatus
(
config
[
'base_url'
]).
encode
(
"utf-8"
,
"replace"
))
# Clean test results for next test
openUrl
(
'%s/TestTool_cleanUpTestResults?__ac_name=%s&__ac_password=%s'
%
(
config
[
'base_url'
],
config
[
'user'
],
config
[
'password'
]))
print
(
"Test finished and report sent, sleeping."
)
browser
=
Firefox
(
profile_dir
,
config
[
'base_url'
],
config
[
'browser_binary'
])
try
:
start
=
time
.
time
()
xvfb
.
run
()
profile_dir
=
os
.
path
.
join
(
config
[
'etc_directory'
],
'profile'
)
browser
.
run
(
test_url
,
xvfb
.
display
)
erp5_report
.
reportStart
()
while
getStatus
(
config
[
'base_url'
])
is
''
:
time
.
sleep
(
10
)
if
(
time
.
time
()
-
start
)
>
float
(
timeout
):
raise
TimeoutError
(
"Test took more them %s seconds"
%
timeout
)
except
TimeoutError
:
continue
finally
:
browser
.
quit
()
xvfb
.
quit
()
erp5_report
.
reportFinished
(
getStatus
(
config
[
'base_url'
]).
encode
(
"utf-8"
,
"replace"
))
# Clean test results for next test
openUrl
(
'%s/TestTool_cleanUpTestResults?__ac_name=%s&__ac_password=%s'
%
(
config
[
'base_url'
],
config
[
'user'
],
config
[
'password'
]))
print
(
"Test finished and report sent, sleeping."
)
sleep
(
3600
)
def
openUrl
(
url
):
...
...
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