def write(self): self._create_suite_xmls() self._combine_suite_xmls() writer = ResultWriter(path.join(self.config['outputdir'], 'output.xml')) writer.write_results( suitestatlevel=self.config['suite_stat_level'], outputdir=self.config['outputdir'], )
def write(self): self._gather_device_xmls() self._combine_all_devices() writer = ResultWriter(path.join(self.config['outputdir'], 'devices.xml')) writer.write_results( suitestatlevel=self.config['suite_stat_level'], outputdir=self.config['outputdir'], log='devices.html', report=None )
def run(): """ Run generated test case. Write generated test case to robot file """ with open("robotfile.robot", "w") as testsuite: testsuite.write("\n".join(robotfile)) testsuite.write("\n") result = suite.run(output="robot_aal.xml") writer = ResultWriter(result) writer.write_results(report="aal_robot.html", log=None) return result.return_code
#!/usr/bin/env python """Script to parse, modify and and run tests programmatically. Usage: %s path/to/tests.robot """ import sys from robot.api import TestSuiteBuilder, ResultWriter if len(sys.argv) != 2: sys.exit(__doc__ % sys.argv[0]) path = sys.argv[1] suite = TestSuiteBuilder().build(path) suite.name = 'Example' test = suite.tests.create(name='Created', tags=['example']) test.keywords.create(name='Log', args=['Hello, world!']) result = suite.run(dotted=True, output='output.xml') writer = ResultWriter('output.xml') writer.write_results(log='log.html', report='report.html') sys.exit(result.return_code)