crab 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -2
- data/README.md +3 -5
- data/Rakefile +15 -0
- data/features/find-text-in-stories.feature +1 -1
- data/features/login-and-out-of-rally.feature +1 -1
- data/features/project-selection.feature +2 -2
- data/features/show-from-rally.feature +1 -0
- data/features/steps/rally_steps.rb +24 -4
- data/lib/crab/cucumber_scenario.rb +2 -0
- data/lib/crab/project.rb +4 -3
- data/lib/crab/scenario.rb +7 -0
- data/lib/crab/utilities.rb +2 -1
- data/lib/crab/version.rb +1 -1
- metadata +3 -3
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -85,7 +85,7 @@ There are more switches. Check out `crab update --help` to find out more.
|
|
85
85
|
Developing
|
86
86
|
----------
|
87
87
|
|
88
|
-
To develop `crab`, you are going to need [
|
88
|
+
To develop `crab`, you are going to need [Bundler][3], [Aruba][4] and a
|
89
89
|
working Rally account with a project set up where you can edit things. The
|
90
90
|
supplied `Gemfile` should take care of everything else:
|
91
91
|
|
@@ -103,20 +103,18 @@ To do
|
|
103
103
|
-----
|
104
104
|
|
105
105
|
- Add a config command + .crab/config file to hold settings like project, etc
|
106
|
-
- Remove account-specific Rally tests
|
107
106
|
- Ability to create and delete stories with all mandatory fields from the command line
|
108
107
|
- Add a `push` subcommand which parses a Cucumber feature and adds or updates it in Rally
|
109
108
|
- Add a way to create, edit and delete test cases / scenarios from the command line
|
110
109
|
- `pull` is not very smart and could detect feature files being moved from one dir to another
|
111
|
-
- Recursively look for a `.
|
112
|
-
- Encrypt password in generated `~/.
|
110
|
+
- Recursively look for a `.crab` directory like Git does with `.git`
|
111
|
+
- Encrypt password in generated `~/.crab/credentials`
|
113
112
|
- Verbose logging (especially before any change or destructive operations in Rally)
|
114
113
|
- Dry-run mode
|
115
114
|
- Figure out how to stub or simulate Rally (tests are taking way too long already)
|
116
115
|
- Error messages are still more cryptic than we'd like
|
117
116
|
- Add a `move` subcommand which moves the story from one state to the next (potentially, `move --back`)
|
118
117
|
- Add a Cucumber Formatter that updates Test Runs in Rally with results from CI
|
119
|
-
- Add `@manual` tags to Test Cases marked as such
|
120
118
|
- Investigate use of other fields like Priority and Risk in Rally Test Cases
|
121
119
|
- Support i18n Cucumber Features
|
122
120
|
- Make it possible to associate defects with Features (essentially treating defects like stories)
|
data/Rakefile
CHANGED
@@ -7,3 +7,18 @@ end
|
|
7
7
|
|
8
8
|
task :default => :features
|
9
9
|
|
10
|
+
namespace :cucumber do
|
11
|
+
|
12
|
+
desc "Basic test suite set-up"
|
13
|
+
task :setup do
|
14
|
+
require 'highline/import'
|
15
|
+
test_project = ask("Name of the project in Rally to be used for tests: ")
|
16
|
+
|
17
|
+
dot_crab = File.expand_path("~/.crab")
|
18
|
+
FileUtils.mkdir_p dot_crab
|
19
|
+
File.open(File.join(dot_crab, 'test_project'), 'w') do |file|
|
20
|
+
file.puts test_project
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -10,5 +10,5 @@ Feature: Log In and Out of Rally
|
|
10
10
|
And I type my username
|
11
11
|
And I type my password
|
12
12
|
Then the exit status should be 0
|
13
|
-
And the user's home directory should have a file named ".
|
13
|
+
And the user's home directory should have a file named ".crab/credentials"
|
14
14
|
|
@@ -13,11 +13,11 @@ Feature: Project Selection
|
|
13
13
|
When I run `crab project`
|
14
14
|
Then the output should contain "No project currently selected."
|
15
15
|
|
16
|
-
When I
|
16
|
+
When I select my test project
|
17
17
|
Then the exit status should be 0
|
18
18
|
|
19
19
|
When I run `crab project`
|
20
|
-
Then the output should
|
20
|
+
Then the output should be the name of my test project
|
21
21
|
|
22
22
|
Scenario: Selecting an Invalid Project
|
23
23
|
When I run `crab project "invalid"`
|
@@ -19,6 +19,7 @@ Sample Description
|
|
19
19
|
Scenario: Show Story With Test Cases
|
20
20
|
When I run `crab show US5000`
|
21
21
|
Then the output should contain "Feature: [US5000] Sample Crab Parent Story"
|
22
|
+
And the output should contain "@manual @functional"
|
22
23
|
And the output should contain "Scenario: [TC10388] Sample Testcase"
|
23
24
|
And the output should contain " Given Rally behaves"
|
24
25
|
And the output should contain " When I look at the test case steps"
|
@@ -14,7 +14,7 @@ Then /^the user's home directory should have a file named "([^"]*)"$/ do |file|
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def get_rally_credentials
|
17
|
-
username, password = File.read(File.join(File.dirname(__FILE__), '..', '..', '.
|
17
|
+
username, password = File.read(File.join(File.dirname(__FILE__), '..', '..', '.crab', 'credentials')).split(/\n/)
|
18
18
|
[ username, password ]
|
19
19
|
end
|
20
20
|
|
@@ -75,12 +75,12 @@ Then /^the story ([A-Z]{2}\d+) should have ([A-Z]{2}\d+) as its parent$/ do |chi
|
|
75
75
|
end
|
76
76
|
|
77
77
|
Given /^no project is selected$/ do
|
78
|
-
Given 'I run `rm -rf ".
|
78
|
+
Given 'I run `rm -rf ".crab/project"`'
|
79
79
|
end
|
80
80
|
|
81
81
|
def get_project
|
82
|
-
if File.exists? ".
|
83
|
-
File.read(".
|
82
|
+
if File.exists? ".crab/project"
|
83
|
+
File.read(".crab/project").strip
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
@@ -92,3 +92,23 @@ Given /^I have selected the project "([^"]*)"$/ do |project|
|
|
92
92
|
}
|
93
93
|
end
|
94
94
|
end
|
95
|
+
|
96
|
+
def get_test_project
|
97
|
+
begin
|
98
|
+
test_project = File.read(File.expand_path("~/.crab/test_project"))
|
99
|
+
rescue
|
100
|
+
raise "Looks like your test project isn't set up. Please run 'rake cucumber:setup'"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
Given /^I have selected my test project$/ do
|
105
|
+
When %Q{I run `crab project "#{get_test_project}"`}
|
106
|
+
end
|
107
|
+
|
108
|
+
When /^I select my test project$/ do
|
109
|
+
When %Q{I run `crab project "#{get_test_project}"`}
|
110
|
+
end
|
111
|
+
|
112
|
+
Then /^the output should be the name of my test project$/ do
|
113
|
+
Then %Q{the output should contain "#{get_test_project}"}
|
114
|
+
end
|
@@ -1,8 +1,10 @@
|
|
1
1
|
module Crab
|
2
2
|
class CucumberScenario
|
3
3
|
def generate_from(scenario)
|
4
|
+
tags = [scenario.method, scenario.test_type]
|
4
5
|
return <<-SCENARIO
|
5
6
|
|
7
|
+
#{tags.map {|t| " @" + t.strip }.join}
|
6
8
|
Scenario: [#{scenario.formatted_id}] #{scenario.name}
|
7
9
|
#{scenario.steps.join("\n ")}
|
8
10
|
SCENARIO
|
data/lib/crab/project.rb
CHANGED
@@ -2,8 +2,8 @@ module Crab
|
|
2
2
|
class Project
|
3
3
|
|
4
4
|
def self.current_project_name
|
5
|
-
if File.exists? ".
|
6
|
-
File.read(".
|
5
|
+
if File.exists? ".crab/project"
|
6
|
+
File.read(".crab/project").strip
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
@@ -30,7 +30,8 @@ module Crab
|
|
30
30
|
project = @rally.find_project name
|
31
31
|
Trollop::die "#{name.inspect} is not a valid project" if project.nil?
|
32
32
|
|
33
|
-
|
33
|
+
FileUtils.mkdir_p ".crab"
|
34
|
+
File.open(".crab/project", "w") do |file|
|
34
35
|
file.puts project.name
|
35
36
|
end
|
36
37
|
end
|
data/lib/crab/scenario.rb
CHANGED
data/lib/crab/utilities.rb
CHANGED
data/lib/crab/version.rb
CHANGED
metadata
CHANGED