def main(self, datasources, **options): settings = RobotSettings(options) LOGGER.register_console_logger(**settings.console_output_config) LOGGER.info('Settings:\n%s' % unic(settings)) builder = TestSuiteBuilder(settings['SuiteNames'], extension=settings.extension, rpa=settings.rpa) suite = builder.build(*datasources) settings.rpa = builder.rpa suite.configure(**settings.suite_config) if settings.pre_run_modifiers: suite.visit( ModelModifier(settings.pre_run_modifiers, settings.run_empty_suite, LOGGER)) with pyloggingconf.robot_handler_enabled(settings.log_level): old_max_error_lines = text.MAX_ERROR_LINES text.MAX_ERROR_LINES = settings.max_error_lines try: result = suite.run(settings) finally: text.MAX_ERROR_LINES = old_max_error_lines LOGGER.info("Tests execution ended. Statistics:\n%s" % result.suite.stat_message) if settings.log or settings.report or settings.xunit: writer = ResultWriter( settings.output if settings.log else result) writer.write_results(settings.get_rebot_settings()) return result.return_code
def main(self, datasources, **options): settings = RobotSettings(options) LOGGER.register_console_logger(**settings.console_output_config) LOGGER.info('Settings:\n%s' % unic(settings)) builder = TestSuiteBuilder(settings['SuiteNames'], extension=settings.extension, rpa=settings.rpa) suite = builder.build(*datasources) settings.rpa = builder.rpa suite.configure(**settings.suite_config) if settings.pre_run_modifiers: suite.visit(ModelModifier(settings.pre_run_modifiers, settings.run_empty_suite, LOGGER)) with pyloggingconf.robot_handler_enabled(settings.log_level): old_max_error_lines = text.MAX_ERROR_LINES text.MAX_ERROR_LINES = settings.max_error_lines try: result = suite.run(settings) finally: text.MAX_ERROR_LINES = old_max_error_lines LOGGER.info("Tests execution ended. Statistics:\n%s" % result.suite.stat_message) if settings.log or settings.report or settings.xunit: writer = ResultWriter(settings.output if settings.log else result) writer.write_results(settings.get_rebot_settings()) return result.return_code
def TestSuiteFactory(datasources, **options): settings = RobotSettings(options) if is_string(datasources): datasources = [datasources] suite = TestSuiteBuilder().build(*datasources) suite.configure(**settings.suite_config) return suite
def main(self, datasources, **options): settings = RobotSettings(options) LOGGER.register_console_logger(**settings.console_output_config) LOGGER.info('Settings:\n%s' % unicode(settings)) suite = TestSuiteBuilder(settings['SuiteNames'], settings['WarnOnSkipped']).build(*datasources) suite.configure(**settings.suite_config) if settings.pre_run_modifiers: suite.visit(ModelModifier(settings.pre_run_modifiers, settings.run_empty_suite, LOGGER)) with pyloggingconf.robot_handler_enabled(settings.log_level): result = suite.run(settings) LOGGER.info("Tests execution ended. Statistics:\n%s" % result.suite.stat_message) if settings.log or settings.report or settings.xunit: writer = ResultWriter(settings.output if settings.log else result) writer.write_results(settings.get_rebot_settings()) return result.return_code