-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from prashanth-sams/update
without run id
- Loading branch information
Showing
8 changed files
with
82 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'rspec' | ||
gem 'capybara' | ||
gem 'selenium-webdriver' | ||
gem 'site_prism' | ||
gem "rake" | ||
gem 'byebug' | ||
gem 'testrail-rspec' | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,21 +2,39 @@ | |
[![Gem Version](https://badge.fury.io/rb/testrail-rspec.svg)](http://badge.fury.io/rb/testrail-rspec) | ||
> Sync `Rspec` test results with your `testrail` suite. Discover an example with Capybara in this gem source. | ||
**Install gem file** | ||
``` | ||
### Features | ||
- [x] Update test results in the existing test run | ||
- [x] Create dynamic test run and update test results in it | ||
|
||
## Installation | ||
|
||
Add this line to your application's Gemfile: | ||
```ruby | ||
gem 'testrail-rspec' | ||
``` | ||
|
||
And then execute: | ||
```bash | ||
$ bundle | ||
``` | ||
|
||
Or install it yourself as: | ||
```bash | ||
$ gem install testrail-rspec | ||
``` | ||
|
||
**Import the library in your `spec_helper.rb` file** | ||
``` | ||
require 'testrail-rspec' | ||
``` | ||
|
||
**Sync Case ID in your RSpec scenario** | ||
## #Usage outline | ||
|
||
Prefix TestRail Case ID on start of your rspec scenario; say, `C860` | ||
#### Sync Case ID | ||
|
||
``` | ||
Prefix TestRail Case ID on start of your rspec scenario; say, `C845` | ||
|
||
```ruby | ||
describe 'Verify Google Home Page' do | ||
|
||
scenario 'C845 verify the Google home page' do | ||
|
@@ -27,31 +45,48 @@ Prefix TestRail Case ID on start of your rspec scenario; say, `C860` | |
expect(page).to have_content('Goo gle') | ||
end | ||
|
||
scenario 'C850 verify the Google home page to be pending' do | ||
pending | ||
end | ||
scenario 'C853 verify the Google home page to skip' do | ||
skip "skipping this test" | ||
end | ||
|
||
end | ||
``` | ||
|
||
**Config TestRail details** | ||
#### TestRail details | ||
|
||
- Create a testrail config file, `testrail_config.yml` in the project parent folder | ||
- Fill up the testrail details on right hand side of the fields (`url`, `user`, `password`, and `run_id`); `run_id` is the dynamically generated id from your testrail account (say, `run_id: 111`) | ||
Provide TestRail details by creating a config file, `testrail_config.yml` in the project parent folder | ||
|
||
``` | ||
> With existing `Test Run` | ||
- Add testrail details (`url`, `user`, `password`, and `run_id`) | ||
- `run_id` is the dynamically generated id from your testrail account (say, `run_id: 111`) | ||
|
||
```yaml | ||
testrail: | ||
url: https://your_url.testrail.io/ | ||
user: [email protected] | ||
password: ****** | ||
run_id: 111 | ||
``` | ||
**Update the results through `Hooks` on end of each test** | ||
> Create dynamic `Test Run` and update results | ||
|
||
- Add testrail details following `project_id` and `suite_id` | ||
- `project_id` and `suite_id` are the dynamically generated id from your testrail account | ||
- `run_id` is optional here; you may (or) may not have it in this case | ||
|
||
```yaml | ||
testrail: | ||
url: https://your_url.testrail.io/ | ||
user: [email protected] | ||
password: ****** | ||
project_id: 10 | ||
suite_id: 110 | ||
``` | ||
|
||
#### Hooks | ||
|
||
Update the results through `Hooks` on end of each test | ||
``` | ||
config.after(:each) do |scenario| | ||
TestrailRSpec::UpdateTestRails.new(scenario).upload_result | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module TestrailRspec | ||
VERSION = '0.1.2'.freeze | ||
VERSION = '0.1.3'.freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
lib = File.expand_path("lib", __dir__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require "testrail-rspec/version" | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "testrail-rspec" | ||
s.version = "0.1.2" | ||
s.licenses = ['MIT'] | ||
s.author = ["Prashanth Sams"] | ||
s.version = TestrailRspec::VERSION | ||
s.authors = ["Prashanth Sams"] | ||
s.email = ['[email protected]'] | ||
s.summary = "Sync Rspec test results with your testrail suite. Discover an example with Capybara in this gem source" | ||
s.homepage = "https://github.com/prashanth-sams/testrail-rspec" | ||
s.licenses = ['MIT'] | ||
s.files = ["lib/testrail-rspec.rb", "lib/testrail-rspec/api-client.rb", "lib/testrail-rspec/update-testrails.rb", "lib/testrail-rspec/version.rb"] | ||
s.require_paths = ["lib"] | ||
s.metadata = { "documentation_uri" => "https://www.rubydoc.info/github/prashanth-sams/testrail-rspec/master", "source_code_uri" => "https://github.com/prashanth-sams/testrail-rspec", "bug_tracker_uri" => "https://github.com/prashanth-sams/testrail-rspec/issues" } | ||
|
||
s.add_development_dependency "bundler" | ||
s.add_development_dependency "rake" | ||
s.add_development_dependency "rspec", "~> 3.0" | ||
s.add_development_dependency "capybara", "~> 3.0" | ||
s.add_development_dependency "selenium-webdriver", "~> 3.0" | ||
s.add_development_dependency "site_prism", "~> 3.0" | ||
s.add_development_dependency "byebug", "~> 11.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters