def get_lines(suite=(), strings=(), basemillis=100, start_block='', end_block='', split_threshold=9999, min_level='INFO'): output = StringIO() data = JsExecutionResult(suite, None, None, strings, basemillis, min_level=min_level) writer = JsResultWriter(output, start_block, end_block, split_threshold) writer.write(data, settings={}) return output.getvalue().splitlines()
def create_jsdata(outxml, target): settings = RebotSettings({ 'name': '<Suite.Name>', 'critical': ['i?'], 'noncritical': ['*kek*kone*'], 'tagstatlink': [ 'force:http://google.com:<kuukkeli>', 'i*:http://%1/:Title of i%1', '?1:http://%1/:Title', '</script>:<url>:<title>' ], 'tagdoc': [ 'test:this_is_*my_bold*_test', 'IX:*Combined* and escaped << tag doc', 'i*:Me, myself, and I.', '</script>:<doc>' ], 'tagstatcombine': ['fooANDi*:No Match', 'i?:IX', '<*>:<any>'] }) result = Results(outxml, settings).js_result config = { 'logURL': 'log.html', 'minLevel': 'DEBUG', 'defaultLevel': 'DEBUG', 'reportURL': 'report.html', 'background': { 'fail': 'DeepPink' } } with utf8open(target, 'w') as output: writer = JsResultWriter(output, start_block='', end_block='') writer.write(result, config) print 'Log: ', normpath(join(BASEDIR, '..', 'rebot', 'log.html')) print 'Report: ', normpath(join(BASEDIR, '..', 'rebot', 'report.html'))
def create_jsdata(outxml, target): settings = RebotSettings({ 'name': '<Suite.Name>', 'critical': ['i?'], 'noncritical': ['*kek*kone*'], 'tagstatlink': ['force:http://google.com:<kuukkeli>', 'i*:http://%1/?foo=bar&zap=%1:Title of i%1', '?1:http://%1/<&>:Title', '</script>:<url>:<title>'], 'tagdoc': ['test:this_is_*my_bold*_test', 'IX:*Combined* and escaped << tag doc', 'i*:Me, myself, and I.', '</script>:<doc>'], 'tagstatcombine': ['fooANDi*:No Match', 'long1ORcollections', 'i?:IX', '<*>:<any>'] }) result = Results(settings, outxml).js_result config = {'logURL': 'log.html', 'title': 'This is a long long title. A very long title indeed. ' 'And it even contains some stuff to <esc&ape>. ' 'Yet it should still look good.', 'minLevel': 'DEBUG', 'defaultLevel': 'DEBUG', 'reportURL': 'report.html', 'background': {'fail': 'DeepPink'}} with open(target, 'wb') as output: writer = JsResultWriter(output, start_block='', end_block='') writer.write(result, config) print 'Log: ', normpath(join(BASEDIR, '..', 'rebot', 'log.html')) print 'Report: ', normpath(join(BASEDIR, '..', 'rebot', 'report.html'))
def create_jsdata(outxml, target): settings = RebotSettings({ 'name': '<Suite.Name>', 'critical': ['i?'], 'noncritical': ['*kek*kone*'], 'tagstatlink': ['force:http://google.com:<kuukkeli>', 'i*:http://%1/:Title of i%1', '?1:http://%1/:Title', '</script>:<url>:<title>'], 'tagdoc': ['test:this_is_*my_bold*_test', 'IX:*Combined* and escaped << tag doc', 'i*:Me, myself, and I.', '</script>:<doc>'], 'tagstatcombine': ['fooANDi*:No Match', 'i?:IX', '<*>:<any>'] }) result = Results(outxml, settings).js_result config = {'logURL': 'log.html', 'minLevel': 'DEBUG', 'defaultLevel': 'DEBUG', 'reportURL': 'report.html', 'background': {'fail': 'DeepPink'}} with utf8open(target, 'w') as output: writer = JsResultWriter(output, start_block='', end_block='') writer.write(result, config) print 'Log: ', normpath(join(BASEDIR, '..', 'rebot', 'log.html')) print 'Report: ', normpath(join(BASEDIR, '..', 'rebot', 'report.html'))
def get_lines(suite=(), strings=(), basemillis=100, start_block='', end_block='', split_threshold=9999, min_level='INFO'): output = StringIO() data = JsExecutionResult(suite, None, None, strings, basemillis, min_level=min_level) writer = JsResultWriter(output, start_block, end_block, split_threshold) writer.write(data, settings={}) return output.getvalue().splitlines()
def create_jsdata(outxml, target): settings = RebotSettings({ 'critical': ['i?'], 'noncritical': ['*kek*kone*'], 'tagstatlink': ['force:http://google.com:<kuukkeli>', 'i*:http://%1/:Title of i%1'], 'tagdoc': ['test:this_is_*my_bold*_test', 'IX:*Combined* & escaped << tag doc'], 'tagstatcombine': ['fooANDi*:No Match', 'i?:IX'] }) result = Results(outxml, settings).js_result config = {'logURL': 'log.html', 'reportURL': 'report.html', 'background': {'fail': 'DeepPink'}} with codecs.open(target, 'w', 'UTF-8') as output: writer = JsResultWriter(output, start_block='', end_block='') writer.write(result, config) print 'Log: ', normpath(join(BASEDIR, '..', 'log.html')) print 'Report: ', normpath(join(BASEDIR, '..', 'report.html'))
def create_jsdata(outxml, target): settings = RebotSettings( { "name": "<Suite.Name>", "critical": ["i?"], "noncritical": ["*kek*kone*"], "tagstatlink": [ "force:http://google.com:<kuukkeli>", "i*:http://%1/:Title of i%1", "?1:http://%1/:Title", "</script>:<url>:<title>", ], "tagdoc": [ "test:this_is_*my_bold*_test", "IX:*Combined* and escaped << tag doc", "i*:Me, myself, and I.", "</script>:<doc>", ], "tagstatcombine": ["fooANDi*:No Match", "i?:IX", "<*>:<any>"], } ) result = Results(outxml, settings).js_result config = { "logURL": "log.html", "title": "This is a long long title. A very long title indeed. " "And it even contains some stuff to <esc&ape>. " "Yet it should still look good.", "minLevel": "DEBUG", "defaultLevel": "DEBUG", "reportURL": "report.html", "background": {"fail": "DeepPink"}, } with utf8open(target, "w") as output: writer = JsResultWriter(output, start_block="", end_block="") writer.write(result, config) print "Log: ", normpath(join(BASEDIR, "..", "rebot", "log.html")) print "Report: ", normpath(join(BASEDIR, "..", "rebot", "report.html"))
def create_jsdata(target, split_log, outxml=OUTPUT): result = Results(RebotSettings({'splitlog': split_log}), outxml).js_result config = { 'logURL': 'log.html', 'reportURL': 'report.html', 'background': { 'fail': 'DeepPink' } } with open(target, 'w') as output: JsResultWriter(output, start_block='', end_block='\n').write(result, config) writer = JsonWriter(output) for index, (keywords, strings) in enumerate(result.split_results): writer.write_json('window.outputKeywords%d = ' % index, keywords) writer.write_json('window.outputStrings%d = ' % index, strings)