当前位置: 移动技术网 > IT编程>脚本编程>Python > Day 4--robot api with yaml: Use your python scripts as robot keywords

Day 4--robot api with yaml: Use your python scripts as robot keywords

2020年07月30日  | 移动技术网IT编程  | 我要评论

目录

 

Write yourself keywords

Prepare

Prepare keywords files

Modify yaml

Modify python scripts

Add function to foreach python file by given path

Change the code for creating test keywords into functions

outputs

Whole python scripts

References


Write yourself keywords

This article is about using python scripts as robot keywords.

  • Task one: import one python file
  • Task two: import path which contain python files

Prepare

  • create one file which contain keywords
  • copy file to new files and put into one path
  • modify yaml

Prepare keywords files

Modify yaml

Modify python scripts

  • add function to foreach python file by given path
  • change the code for creating test keywords into functions

Add function to foreach python file by given path

Change the code for creating test keywords into functions

outputs

If config assertions into yaml file will be better
If config assertions into yaml file will be better
If config assertions into yaml file will be better
==============================================================================
Activate Variable                                                             
==============================================================================
Should Activate Skynet                                                | PASS |
------------------------------------------------------------------------------
Test self keyword                                                     | FAIL |
1 != 2
------------------------------------------------------------------------------
Test one keyword by path                                              | FAIL |
1 != 2
------------------------------------------------------------------------------
Test other keywords by path                                           | FAIL |
1 != 2
------------------------------------------------------------------------------
Activate Variable                                                     | FAIL |
4 critical tests, 1 passed, 3 failed
4 tests total, 1 passed, 3 failed
==============================================================================
Output:  C:\make-your-robot-rest-api\day4\src\reports\skynet-output.xml
[Finished in 0.7s]

Whole python scripts

References

本文地址:https://blog.csdn.net/keithsoul/article/details/107653705

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网