def create_jsdata(outxml, target):
    settings = RebotSettings({
        'name':
        '<Suite.Name>',
        'critical': ['i?'],
        'noncritical': ['*kek*kone*'],
        'tagstatlink': [
            'force:http://google.com:<kuukkeli&gt;',
            '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 <&lt; 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 _verify_log_level(self, input, level=None, default=None):
     level = level or input
     default = default or level
     self._verify_log_levels(RobotSettings({'loglevel': input}), level,
                             default)
     self._verify_log_levels(RebotSettings({'loglevel': input}), level,
                             default)
Example #3
0
 def test_robot_and_rebot_settings_are_independent_2(self):
     # https://github.com/robotframework/robotframework/pull/2438
     rebot = RebotSettings()
     assert_equal(rebot['TestNames'], [])
     robot = RobotSettings()
     robot['TestNames'].extend(['test1', 'test2'])
     assert_equal(rebot['TestNames'], [])
Example #4
0
def create_jsdata(outxml, target):
    settings = RebotSettings({
        'name': '<Suite.Name>',
        'critical': ['i?'],
        'noncritical': ['*kek*kone*'],
        'tagstatlink': ['force:http://google.com:<kuukkeli&gt;',
                        '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 <&lt; 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'))
Example #5
0
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)
 def test_default_log_level(self):
     self._verify_log_levels(RobotSettings(), 'INFO')
     self._verify_log_levels(RebotSettings(), 'TRACE')
 def test_multi_options_as_single_string(self):
     assert_equals(RobotSettings({'test': 'one'})['TestNames'], ['one'])
     assert_equals(RebotSettings({'exclude': 'two'})['Exclude'], ['two'])
 def test_robot_and_rebot_settings_are_independent(self):
     # https://github.com/robotframework/robotframework/issues/881
     orig_opts = RobotSettings()._opts
     RebotSettings()
     assert_equals(RobotSettings()._opts, orig_opts)
Example #9
0
 def test_get_rebot_settings_returns_only_rebot_settings(self):
     expected = RebotSettings()
     for opt in RobotSettings().get_rebot_settings()._opts:
         assert_true(opt in expected, opt)
Example #10
0
 def test_robot_and_rebot_settings_are_independent(self):
     # http://code.google.com/p/robotframework/issues/detail?id=881
     orig_opts = RobotSettings()._opts
     RebotSettings()
     assert_equals(RobotSettings()._opts, orig_opts)