cucumber-repeat 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +22 -0
  3. data/README.md +2 -0
  4. data/lib/cucumber-repeat.rb +47 -0
  5. metadata +74 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 526b6805f9c8d36bd6804dec4730413878d4e1b1
4
+ data.tar.gz: 9739aa448d4895bfa6a4f75320a9603144c10850
5
+ SHA512:
6
+ metadata.gz: a84782ac82b9929a3b7b432e4eda2c37612c2e37c61ec2ee6e004089d0c408abf3e829c668243d18ea383841d5a82b124cdb1fbc3af7d2686eba8b06605cf875
7
+ data.tar.gz: 174b603bc73725bde26427cdb870561cd399ae00dc99aa8687282799de9460ab7931ff26df1b7aad1f7e61f150d31f2950355b15855370daeb44a33d2269fb54
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Andrew Moore
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,2 @@
1
+ cucumber-performance-generator
2
+ ==============================
@@ -0,0 +1,47 @@
1
+ require 'colorize'
2
+
3
+ After('@repeat') do | scenario |
4
+
5
+ if (scenario.failed?)
6
+ scenario.steps.each do |step_details|
7
+ step_details.status!(:passed)
8
+ end
9
+ $stdout.puts " Test Failed, Retrying test".blue
10
+ run_scenario(scenario)
11
+ end
12
+ if (scenario.failed?)
13
+ scenario.steps.each do |step_details|
14
+ step_details.status!(:passed)
15
+ end
16
+ $stdout.puts " Test Failed, Retrying test".blue
17
+ run_scenario(scenario)
18
+ end
19
+ end
20
+
21
+
22
+ def run_scenario(scenario)
23
+ scenario.steps.each do |step_details|
24
+ if (!scenario.failed?)
25
+ begin
26
+ step step_details.name.to_s, step_details.multiline_arg
27
+ $stdout.puts " " + step_details.name.strip.green
28
+ if (!step_details.multiline_arg.to_s.empty?) then
29
+ $stdout.puts " " + step_details.multiline_arg.to_s.gsub(/\e\[(\d+)m/, '').strip.green
30
+ end
31
+ step_details.status!(:passed)
32
+ rescue Exception => e
33
+ $stdout.puts " " + step_details.name.strip.red
34
+ if (!step_details.multiline_arg.to_s.empty?) then
35
+ $stdout.puts " " + step_details.multiline_arg.to_s.gsub(/\e\[(\d+)m/, '').strip.red
36
+ end
37
+ $stdout.puts e.to_s.red
38
+ step_details.status!(:failed)
39
+ end
40
+ else
41
+ $stdout.puts " " + step_details.name.strip.yellow
42
+ if (!step_details.multiline_arg.to_s.empty?) then
43
+ $stdout.puts " " + step_details.multiline_arg.to_s.gsub(/\e\[(\d+)m/, '').strip.yellow
44
+ end
45
+ end
46
+ end
47
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cucumber-repeat
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Moore
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cucumber
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.3.17
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.3.17
27
+ - !ruby/object:Gem::Dependency
28
+ name: colorize
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.7.3
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.7.3
41
+ description: This gem will auto repeat a scenario if it fails up to 2 additional times
42
+ email: mooreandrew@gmail.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - lib/cucumber-repeat.rb
48
+ - LICENSE
49
+ - README.md
50
+ homepage: https://github.com/mooreandrew/cucumber-repeat
51
+ licenses:
52
+ - MIT
53
+ metadata: {}
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubyforge_project:
70
+ rubygems_version: 2.0.14
71
+ signing_key:
72
+ specification_version: 4
73
+ summary: ''
74
+ test_files: []