Robotframework Automation With Jenkins and Xray

Currently, we use Xray in Jira for test management, now we want to implement our automation as below:

  1. use Robotframework design script
  2. use Jenkins trigger automaion running
  3. return running result to xray and update execution status

Pre-Condition

  1. Create one test case, one execution, and add test case to execution, the default status as below:
  2. RF demo script:

Install and config xray jenkins plugin

Use offline way to install, download plugin here: xray-connector, and install plugin as below:

Then, we need to configure Xray plug-in to communicate with JIRA, navigate to Manage Jenkins > Configure System > Xray for Jira configuration.

Config jenkins job to run automaiton test and return report to xray

  1. Just use RF command to run demo script, config as below:
  2. Retrun results to Xray, define in Post-build actioas - “Xray: Results Import Task”.
  3. Config task with below params:
    - Import to Same Test Execution – When this option is checked, if you are importing multiple execution report files using a glob expression, the results will be imported to the same Test Execution
    - Execution Report File (file path with file name) – location and name of the Robot Framework tests output file. 
    - Project Key – key of the JIRA project. This is a required parameter
    - Test Execution Key – JIRA issue key where results will be imported. 
    - Test Plan Key – JIRA issue key of the Test Plan. 
    - Test Environments – list of Environments (separated by “,”) where tests are executed.
    
  4. Run jenkins job
  5. Back to Jira Xray, the status update from TODO to PASS automatically
  6. Go to Execution detail page to view automaion detail result

Finally

Other things we could do:

  1. Create test exceution in xray automatically after automation running
  2. Even create test case after automation running
唐胡璐 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!