天天看点

Day 3--robot api with yaml: Support robot optionsSupport robot optionsThe whole scriptsReferences

目录

Support robot options

parse_args

pass options into settings

outputs

Yaml example

The whole scripts

References

Support robot options

Assume you need to run the scripts with robot options, just two steps:

  • Use robot ArgumentParser.parse_args
  • pass options into settings

parse_args

Day 3--robot api with yaml: Support robot optionsSupport robot optionsThe whole scriptsReferences

pass options into settings

settings = RobotSettings(options)
suite.configure(**settings.suite_config)
           

outputs

$ python run.py --include CI -o test_output.xml -l testlog.html -r testreport.html

OperatingSystem
==============================================================================
Activate Variable
==============================================================================
Should Activate CITEST                                                | PASS |
------------------------------------------------------------------------------
Activate Variable                                                     | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output:  E:\xxxx\day3\src\test_output.xml
           

Yaml example

Day 3--robot api with yaml: Support robot optionsSupport robot optionsThe whole scriptsReferences

The whole scripts

Day 3--robot api with yaml: Support robot optionsSupport robot optionsThe whole scriptsReferences

References

  • robot api with yaml
  • Useful links
  • Suite import library

继续阅读