-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebugrobot.py
More file actions
executable file
·47 lines (36 loc) · 1.21 KB
/
debugrobot.py
File metadata and controls
executable file
·47 lines (36 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import inspect
from robot.run import RobotFramework
path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
sys.path.append(path)
PYTHONPATH = os.path.realpath('%s/../' % path)
sys.path.append(PYTHONPATH)
__author__ = 'huaiyuan.gu@gmail.com'
"""
debug robot test case
"""
if __name__ == '__main__':
import os
import sys
import inspect
base_path = os.path.realpath(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
test_path = report_path = base_path
sys.path.append(base_path)
sys.path.append(test_path)
root = base_path
rb = os.path.join(test_path, 'smoketest.robot')
xmlfile = os.path.join(report_path, 'output.xml')
logfile = os.path.join(report_path, 'log.html')
rptfile = os.path.join(report_path, 'report.html')
bot = RobotFramework()
bot.main([rb], output=xmlfile, log=None, report=None, include=['debug'])
from robot.rebot import Rebot
bot = Rebot()
try:
bot.main([xmlfile], log=logfile, report=rptfile, include=['debug'])
except Exception as e:
print ('=' * 10 + ' Robot report exception %s' % '=' * 10)
print (e)