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
e3e335dc
Commit
e3e335dc
authored
Sep 05, 2018
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
run-zelenium-test: save current test result event error raised
parent
c4099132
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
36 deletions
+47
-36
stack/erp5/template/run-zelenium-test.py.in
stack/erp5/template/run-zelenium-test.py.in
+47
-36
No files found.
stack/erp5/template/run-zelenium-test.py.in
View file @
e3e335dc
...
@@ -149,6 +149,18 @@ def main():
...
@@ -149,6 +149,18 @@ def main():
WebDriverWait(browser, args.max_duration).until(EC.presence_of_element_located((
WebDriverWait(browser, args.max_duration).until(EC.presence_of_element_located((
By.XPATH, '//td[@id="testRuns" and contains(text(), "%i")]' % test_count
By.XPATH, '//td[@id="testRuns" and contains(text(), "%i")]' % test_count
)))
)))
except:
test_line_dict['UnexpectedException'] = {
'test_count': 1,
'error_count': 0,
'failure_count': 1,
'skip_count': 0,
'duration': 1,
'command': url,
'stdout': agent,
'stderr': traceback.format_exc()
}
finally:
execution_duration = round(time.time() - start_time, 2)
execution_duration = round(time.time() - start_time, 2)
if test_count:
if test_count:
test_execution_duration = execution_duration / test_count
test_execution_duration = execution_duration / test_count
...
@@ -175,46 +187,45 @@ def main():
...
@@ -175,46 +187,45 @@ def main():
for tr in tbody[1:]:
for tr in tbody[1:]:
# First td is the main title
# First td is the main title
test_name = tr[0][0].text
test_name = tr[0][0].text
if len(tr) == 1:
skip_count = success_count = error_count = 0
test_line_dict[test_name] = {
'test_count': 1,
test_table = tr[1].xpath('.//table')[0]
'error_count': 0,
test_tbody = tr[1].xpath('.//tbody')[0]
'failure_count': 1,
'skip_count': 0,
tr_count = len(test_tbody)
'duration': 0,
for tr in test_tbody:
# print etree.tostring(tr).split('\n')[0]
status = tr.attrib.get('class')
if status is None or 'status_done' in status:
skip_count += 1
elif 'status_passed' in status:
success_count += 1
elif 'status_failed' in status:
error_count += 1
test_line_dict[test_name] = {
'test_count': tr_count,
'error_count': error_count,
'failure_count': tr_count - (skip_count + success_count + error_count),
'skip_count': skip_count,
'duration': test_execution_duration,
'command': url,
'command': url,
'stdout': agent,
'stdout': agent,
'stderr': '',
'stderr': '',
'html_test_result':
etree.tostring(test_table)
'html_test_result':
'Not Executed due to saucelabs related error'
}
}
except:
else:
test_line_dict['UnexpectedException'] = {
skip_count = success_count = error_count = 0
'test_count': 1,
test_table = tr[1].xpath('.//table')[0]
'error_count': 0,
test_tbody = tr[1].xpath('.//tbody')[0]
'failure_count': 1,
'skip_count': 0,
tr_count = len(test_tbody)
'duration': 1,
for tr in test_tbody:
'command': url,
# print etree.tostring(tr).split('\n')[0]
'stdout': agent,
status = tr.attrib.get('class')
'stderr': traceback.format_exc()
if status is None or 'status_done' in status:
}
skip_count += 1
finally:
elif 'status_passed' in status:
success_count += 1
elif 'status_failed' in status:
error_count += 1
test_line_dict[test_name] = {
'test_count': tr_count,
'error_count': error_count,
'failure_count': tr_count - (skip_count + success_count + error_count),
'skip_count': skip_count,
'duration': test_execution_duration,
'command': url,
'stdout': agent,
'stderr': '',
'html_test_result': etree.tostring(test_table)
}
browser.quit()
browser.quit()
try:
try:
...
...
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