How to integrate TestRail with RSpec
Every time RSpec is running on CI, it updates (or creates new) TestRail Run called by git branch.
Hey, folks!
Recently I came across some Test Case Management system, which called TestRail, and it somehow not based on Rails. Our QA staff uses this tool to write down all their test cases, etc.
But what about RSpec and other beautiful ruby tools? Well, we have specs with good coverage on our project, and I thought, why not integrate our tests with TestRail?
Let’s automate this!
Context is easy: every time RSpec is running on CI, it updates (or creates new) TestRail Run called by git branch.
What if we can just pass case id to some RSpec example?
|
|
That would be awesome, you know? Why not release it to public? Here it is: https://github.com/dmitryzuev/rspec-testrail.
How it works
Add this line to your application’s Gemfile:
|
|
And then execute:
|
|
Update your spec/spec_helper.rb
:
|
|
Before all we init our TestRail integration, and after each example it sends information to TestRail API with status updates.
It also posts comment if some case failed.
And, as I said before, you need to specify testrail_id
to each example you need to synchronise.
Now I need a little sleep, and you have a nice day or night, whatever :)
Your issues, suggestions or PR’s are welcome: https://github.com/dmitryzuev/rspec-testrail