mini_autobot 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mini_autobot/parallel.rb +3 -0
- data/lib/mini_autobot/runner.rb +18 -1
- data/lib/mini_autobot/settings.rb +4 -0
- data/lib/mini_autobot/utils/page_object_helper.rb +12 -0
- data/lib/mini_autobot/version.rb +1 -1
- data/lib/minitest/autobot_settings_plugin.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85fd0829c123f45ea778120fc90ee5e2c04a627b
|
4
|
+
data.tar.gz: 69a62bdef541daa9348ab6d8f3876f05d444836f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3713ac9f4aafd4f19b2bb41c63446cf3cb397d77aa5dc0a96c6f31338e686e5c8c3c5cd67bc2f40af7ce8d1629f7591c8f341c5163a152a626054134271851c1
|
7
|
+
data.tar.gz: 9130a15054e3edf435825f08060647d9c6f5e4ff9addc20333a8890792854fd7112e15631cd3a864caf6b3c869dfb6f7064763ef43d139c89b09f67920e50238
|
@@ -17,6 +17,9 @@ module MiniAutobot
|
|
17
17
|
|
18
18
|
@pids = []
|
19
19
|
@static_run_command = "mini_autobot -c #{MiniAutobot.settings.connector} -e #{MiniAutobot.settings.env}"
|
20
|
+
if MiniAutobot.settings.rerun_failure
|
21
|
+
@static_run_command += " -R #{MiniAutobot.settings.rerun_failure}"
|
22
|
+
end
|
20
23
|
tap_reporter_path = MiniAutobot.gem_root.join('lib/tapout/custom_reporters/fancy_tap_reporter.rb')
|
21
24
|
@pipe_tap = "--tapy | tapout --no-color -r #{tap_reporter_path.to_s} fancytap"
|
22
25
|
end
|
data/lib/mini_autobot/runner.rb
CHANGED
@@ -3,6 +3,7 @@ module MiniAutobot
|
|
3
3
|
|
4
4
|
attr_accessor :options
|
5
5
|
@after_hooks = []
|
6
|
+
@@rerun_count = 0
|
6
7
|
|
7
8
|
def self.after_run(&blk)
|
8
9
|
@after_hooks << blk
|
@@ -21,6 +22,22 @@ module MiniAutobot
|
|
21
22
|
|
22
23
|
self.before_run
|
23
24
|
|
25
|
+
reporter = self.single_run
|
26
|
+
|
27
|
+
rerun_failure = @options[:rerun_failure]
|
28
|
+
if rerun_failure && !reporter.passed?
|
29
|
+
while @@rerun_count < rerun_failure && !reporter.passed?
|
30
|
+
reporter = self.single_run
|
31
|
+
@@rerun_count += 1
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
reporter.passed?
|
36
|
+
end
|
37
|
+
|
38
|
+
# Inialize a new reporter, run test
|
39
|
+
# Return reporter, which carrys test result
|
40
|
+
def self.single_run
|
24
41
|
reporter = Minitest::CompositeReporter.new
|
25
42
|
reporter << Minitest::SummaryReporter.new(@options[:io], @options)
|
26
43
|
reporter << Minitest::ProgressReporter.new(@options[:io], @options)
|
@@ -34,7 +51,7 @@ module MiniAutobot
|
|
34
51
|
Minitest.parallel_executor.shutdown
|
35
52
|
reporter.report
|
36
53
|
|
37
|
-
reporter
|
54
|
+
reporter
|
38
55
|
end
|
39
56
|
|
40
57
|
# before hook where you have parsed @options when loading tests
|
@@ -58,6 +58,7 @@ module MiniAutobot
|
|
58
58
|
# @return [void]
|
59
59
|
def teardown
|
60
60
|
if !passed? && !skipped? && !@driver.nil?
|
61
|
+
save_to_ever_failed if MiniAutobot.settings.rerun_failure
|
61
62
|
take_screenshot
|
62
63
|
print_sauce_link if connector_is_saucelabs?
|
63
64
|
end
|
@@ -76,6 +77,17 @@ module MiniAutobot
|
|
76
77
|
@driver.save_screenshot("logs/#{name}.png")
|
77
78
|
end
|
78
79
|
|
80
|
+
# Save test name to ever_failed_tests file only for the first time it failed
|
81
|
+
def save_to_ever_failed
|
82
|
+
ever_failed_tests = 'logs/tap_results/ever_failed_tests'
|
83
|
+
File.open(ever_failed_tests, 'a') do |f|
|
84
|
+
existing_failed_tests = File.readlines(ever_failed_tests).map do |line|
|
85
|
+
line.delete "\n"
|
86
|
+
end
|
87
|
+
f.puts name unless existing_failed_tests.include? name
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
79
91
|
# Print out a link of a saucelabs's job when a test is not passed
|
80
92
|
# Rescue to skip this step for tests like cube tracking
|
81
93
|
def print_sauce_link
|
data/lib/mini_autobot/version.rb
CHANGED
@@ -72,6 +72,12 @@ module Minitest
|
|
72
72
|
parser.on('-P', '--parallel PARALLEL', 'Run any number of tests in parallel') do |value|
|
73
73
|
options[:parallel] = value
|
74
74
|
end
|
75
|
+
|
76
|
+
options[:rerun_failure] = false
|
77
|
+
parser.on('-R', '--rerun-failure [RERUN]', 'Rerun failing test; If enabled, can set number of times to rerun') do |value|
|
78
|
+
integer_value = value.nil? ? 1 : value.to_i
|
79
|
+
options[:rerun_failure] = integer_value
|
80
|
+
end
|
75
81
|
end
|
76
82
|
|
77
83
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_autobot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ripta Pasay
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
291
|
version: '0'
|
292
292
|
requirements: []
|
293
293
|
rubyforge_project:
|
294
|
-
rubygems_version: 2.
|
294
|
+
rubygems_version: 2.4.6
|
295
295
|
signing_key:
|
296
296
|
specification_version: 4
|
297
297
|
summary: Web automation framework on minitest, selenium webdriver, and page objects.
|