chemistrykit 3.6.0 → 3.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +12 -0
- data/README.md +10 -2
- data/chemistrykit.gemspec +4 -4
- data/features/brew.feature +53 -5
- data/features/concurrency.feature +1 -1
- data/features/logging.feature +2 -2
- data/features/multi-config.feature +4 -5
- data/lib/chemistrykit/cli/cli.rb +14 -5
- data/lib/chemistrykit/configuration.rb +3 -1
- data/lib/chemistrykit/j_unit.rb +121 -0
- data/lib/templates/chemistrykit/config.yaml.tt +6 -7
- data/spec/unit/lib/chemistrykit/configuration_spec.rb +10 -1
- metadata +12 -11
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
#3.7.0 (2013-07-24)
|
2
|
+
updated evidence to put in test based folders and added configuration for the retry functionality
|
3
|
+
|
4
|
+
- Bumped version to 3.7.0 to prepare for release.
|
5
|
+
- updated integration tests for new evidence directory format
|
6
|
+
- updated config template and made some tests pass
|
7
|
+
- updated readme to add usergroup link
|
8
|
+
- added folder hierachy for evidence and slug formatter, fixed code quality issues
|
9
|
+
- added slugification to junit formatter to support attachment plugin
|
10
|
+
- added retry to configuration file and run time parameters updated docs and tests
|
11
|
+
- updated sc version
|
12
|
+
|
1
13
|
#3.6.0 (2013-07-20)
|
2
14
|
Added the ability for tests to be retried on failure. A single retry will be attempted by default and the output will be verbose.
|
3
15
|
|
data/README.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
#ChemistryKit 3.
|
1
|
+
#ChemistryKit 3.7.0 (2013-07-24)
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/chemistrykit.png)](http://badge.fury.io/rb/chemistrykit) [![Build Status](https://travis-ci.org/arrgyle/chemistrykit.png?branch=develop)](https://travis-ci.org/jrobertfox/chef-broiler-platter) [![Code Climate](https://codeclimate.com/github/arrgyle/chemistrykit.png)](https://codeclimate.com/github/arrgyle/chemistrykit) [![Coverage Status](https://coveralls.io/repos/arrgyle/chemistrykit/badge.png?branch=develop)](https://coveralls.io/r/arrgyle/chemistrykit?branch=develop)
|
4
4
|
|
5
5
|
### A simple and opinionated web testing framework for Selenium WebDriver
|
6
6
|
|
7
|
-
This framework was designed to help you get started with Selenium WebDriver quickly, to grow as needed, and to avoid common pitfalls by following convention over configuration.
|
7
|
+
This framework was designed to help you get started with Selenium WebDriver quickly, to grow as needed, and to avoid common pitfalls by following convention over configuration. To checkout the user group go [here](https://groups.google.com/forum/#!forum/chemistrykit-users).
|
8
|
+
|
8
9
|
|
9
10
|
ChemistryKit's inspiration comes from the Saunter Selenium framework which is available in Python and PHP. You can find more about it [here](http://element34.ca/products/saunter).
|
10
11
|
|
@@ -107,6 +108,8 @@ ChemistryKit is configured by default with a `config.yaml` file that is created
|
|
107
108
|
|
108
109
|
`base_url:` The base url of your app, stored to the ENV for access in your beakers and formulas.
|
109
110
|
|
111
|
+
`retries_on_failure:` Defaults to 1, set the number of times a test should be retried on failure
|
112
|
+
|
110
113
|
`concurrency:` You may override the default concurrency of 1 to run the tests in parallel
|
111
114
|
|
112
115
|
`log: path:` You may override the default log path 'evidence'
|
@@ -143,6 +146,7 @@ Available options for the `brew` command:
|
|
143
146
|
-r, --results_file [NAME] Specify the name of your results file.
|
144
147
|
--tag [TAGS] Specify a list of tags to run or exclude.
|
145
148
|
--params [HASH] Send a list of "key:value" parameters to the ENV.
|
149
|
+
-x, --retry [INT] How many times should a failing test be retried.
|
146
150
|
```
|
147
151
|
|
148
152
|
###generate forumla
|
@@ -168,11 +172,15 @@ Usage:
|
|
168
172
|
ckit tags
|
169
173
|
|
170
174
|
##Contribution Guidelines
|
175
|
+
|
171
176
|
This project conforms to the [neverstopbuilding/craftsmanship](https://github.com/neverstopbuilding/craftsmanship) guidelines. Please see them for details on:
|
172
177
|
- Branching theory
|
173
178
|
- Documentation expectations
|
174
179
|
- Release process
|
175
180
|
|
181
|
+
###Check out the user group!
|
182
|
+
[https://groups.google.com/forum/#!forum/chemistrykit-users](https://groups.google.com/forum/#!forum/chemistrykit-users)
|
183
|
+
|
176
184
|
###It's simple
|
177
185
|
|
178
186
|
1. Create a feature branch from develop: `git checkout -b feature/myfeature develop` or `git flow feature start myfeature`
|
data/chemistrykit.gemspec
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'chemistrykit'
|
5
|
-
s.version = '3.
|
5
|
+
s.version = '3.7.0'
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.authors = ['Dave Haeffner', 'Jason Fox']
|
8
8
|
s.email = ['dave@arrgyle.com', 'jason@arrgyle.com']
|
9
9
|
s.homepage = 'https://github.com/arrgyle/chemistrykit'
|
10
10
|
s.summary = 'A simple and opinionated web testing framework for Selenium that follows convention over configuration.'
|
11
|
-
s.description = '
|
11
|
+
s.description = 'updated evidence to put in test based folders and added configuration for the retry functionality'
|
12
12
|
s.license = 'MIT'
|
13
13
|
|
14
14
|
s.files = `git ls-files`.split($/)
|
@@ -21,10 +21,10 @@ Gem::Specification.new do |s|
|
|
21
21
|
|
22
22
|
s.add_dependency 'thor', '~> 0.17.0'
|
23
23
|
s.add_dependency 'rspec', '~> 2.14.1'
|
24
|
-
s.add_dependency '
|
24
|
+
s.add_dependency 'builder', '~> 3.2.2'
|
25
25
|
s.add_dependency 'selenium-webdriver', '~> 2.29.0'
|
26
26
|
s.add_dependency 'rest-client', '~> 1.6.7'
|
27
|
-
s.add_dependency 'selenium-connect', '~> 3.
|
27
|
+
s.add_dependency 'selenium-connect', '~> 3.3.1'
|
28
28
|
s.add_dependency 'parallel_tests', '~> 0.15.0'
|
29
29
|
s.add_dependency 'parallel', '~> 0.7.0'
|
30
30
|
s.add_dependency 'rspec-retry', '~> 0.2.1'
|
data/features/brew.feature
CHANGED
@@ -40,8 +40,8 @@ Feature: Brewing a ChemistryKit project
|
|
40
40
|
When I run `ckit brew`
|
41
41
|
Then the stdout should contain "1 example, 0 failures"
|
42
42
|
And the following files should exist:
|
43
|
-
| evidence/results_junit.xml
|
44
|
-
| evidence/bookie/server.log
|
43
|
+
| evidence/results_junit.xml |
|
44
|
+
| evidence/bookie/bookie_loads_an_external_web_page/server.log |
|
45
45
|
|
46
46
|
Scenario: Brew a single beaker
|
47
47
|
Given a file named "config.yaml" with:
|
@@ -108,6 +108,54 @@ Feature: Brewing a ChemistryKit project
|
|
108
108
|
"""
|
109
109
|
When I run `ckit brew --beakers=beakers/failure.rb`
|
110
110
|
Then the stdout should contain "1 example, 1 failure"
|
111
|
-
And there should be "
|
112
|
-
And there should be "
|
113
|
-
And there should be "
|
111
|
+
And there should be "1" "failed image" log files in "evidence/failing_beaker/failing_beaker_loads_an_external_web_page"
|
112
|
+
And there should be "1" "report" log files in "evidence/failing_beaker/failing_beaker_loads_an_external_web_page"
|
113
|
+
And there should be "1" "sauce log" log files in "evidence/failing_beaker/failing_beaker_loads_an_external_web_page"
|
114
|
+
|
115
|
+
Scenario: Retry a test on failure based on config file
|
116
|
+
Given a file named "config.yaml" with:
|
117
|
+
"""
|
118
|
+
retries_on_failure: 3
|
119
|
+
selenium_connect:
|
120
|
+
log: 'evidence'
|
121
|
+
host: 'localhost'
|
122
|
+
"""
|
123
|
+
And a file named "beakers/other_beaker.rb" with:
|
124
|
+
"""
|
125
|
+
describe "Other" do
|
126
|
+
let(:book) { Formulas::Bookie.new(@driver) }
|
127
|
+
|
128
|
+
it "loads an external web page" do
|
129
|
+
book.open "http://www.google.com"
|
130
|
+
@driver.title.should_not include("Google")
|
131
|
+
end
|
132
|
+
end
|
133
|
+
"""
|
134
|
+
When I run `ckit brew --beakers=beakers/other_beaker.rb`
|
135
|
+
Then the stdout should contain "RSpec::Retry: 2nd try"
|
136
|
+
Then the stdout should contain "RSpec::Retry: 3rd try"
|
137
|
+
|
138
|
+
Scenario: Retry a test on failure based on run time parameter
|
139
|
+
Given a file named "config.yaml" with:
|
140
|
+
"""
|
141
|
+
retries_on_failure: 2
|
142
|
+
selenium_connect:
|
143
|
+
log: 'evidence'
|
144
|
+
host: 'localhost'
|
145
|
+
"""
|
146
|
+
And a file named "beakers/other_beaker.rb" with:
|
147
|
+
"""
|
148
|
+
describe "Other" do
|
149
|
+
let(:book) { Formulas::Bookie.new(@driver) }
|
150
|
+
|
151
|
+
it "loads an external web page" do
|
152
|
+
book.open "http://www.google.com"
|
153
|
+
@driver.title.should_not include("Google")
|
154
|
+
end
|
155
|
+
end
|
156
|
+
"""
|
157
|
+
When I run `ckit brew --beakers=beakers/other_beaker.rb --retry=3`
|
158
|
+
Then the stdout should contain "RSpec::Retry: 2nd try"
|
159
|
+
Then the stdout should contain "RSpec::Retry: 3rd try"
|
160
|
+
|
161
|
+
|
@@ -97,4 +97,4 @@ Feature: Support for concurency
|
|
97
97
|
Then the stdout should not contain "All examples were filtered out"
|
98
98
|
And the stdout should not contain "0 examples, 0 failures"
|
99
99
|
And there should be "4" unique results files in the "evidence" directory
|
100
|
-
And there should be "2" "report" log files in "evidence/cheese"
|
100
|
+
And there should be "2" "report" log files in "evidence/cheese/cheese_loads_an_external_web_page"
|
data/features/logging.feature
CHANGED
@@ -84,8 +84,8 @@ Feature: Log handling
|
|
84
84
|
Then the stdout should contain "2 examples, 0 failures"
|
85
85
|
And the following files should exist:
|
86
86
|
| my_evidence/results_junit.xml |
|
87
|
-
| my_evidence/first/server.log |
|
88
|
-
| my_evidence/second/server.log |
|
87
|
+
| my_evidence/first/first_loads_an_external_web_page/server.log |
|
88
|
+
| my_evidence/second/second_loads_an_external_web_page/server.log |
|
89
89
|
|
90
90
|
Scenario: I can runtime override the results output file name
|
91
91
|
When I run `ckit brew --results_file results_junit_01.xml`
|
@@ -26,7 +26,7 @@ Feature: Support for multiple configuration files
|
|
26
26
|
When I run `ckit brew`
|
27
27
|
Then the stdout should contain "1 example, 0 failures"
|
28
28
|
And the following files should exist:
|
29
|
-
| evidence_config/cheese/server.log
|
29
|
+
| evidence_config/cheese/cheese_loads_an_external_web_page/server.log |
|
30
30
|
|
31
31
|
Scenario: I can specifiy an alternative configuration with --config
|
32
32
|
Given a directory named "evidence_alternate"
|
@@ -39,7 +39,7 @@ Feature: Support for multiple configuration files
|
|
39
39
|
When I run `ckit brew --config alternate.yaml`
|
40
40
|
Then the stdout should contain "1 example, 0 failures"
|
41
41
|
And the following files should exist:
|
42
|
-
| evidence_alternate/cheese/server.log
|
42
|
+
| evidence_alternate/cheese/cheese_loads_an_external_web_page/server.log |
|
43
43
|
|
44
44
|
Scenario: I can specifiy an alternative configuration with -c
|
45
45
|
Given a directory named "evidence_alternate"
|
@@ -52,8 +52,7 @@ Feature: Support for multiple configuration files
|
|
52
52
|
When I run `ckit brew -c alternate.yaml`
|
53
53
|
Then the stdout should contain "1 example, 0 failures"
|
54
54
|
And the following files should exist:
|
55
|
-
|
56
|
-
|
55
|
+
| evidence_alternate/cheese/cheese_loads_an_external_web_page/server.log |
|
57
56
|
Scenario: I can specifiy an alternative configuration with --config with concurrency
|
58
57
|
Given a directory named "evidence_alternate"
|
59
58
|
And a file named "alternate.yaml" with:
|
@@ -68,4 +67,4 @@ Feature: Support for multiple configuration files
|
|
68
67
|
Then the stdout should contain "1 example, 0 failures"
|
69
68
|
And there should be "1" unique results files in the "evidence_alternate" directory
|
70
69
|
And the following files should exist:
|
71
|
-
|
70
|
+
| evidence_alternate/cheese/cheese_loads_an_external_web_page/server.log |
|
data/lib/chemistrykit/cli/cli.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
require 'thor'
|
4
4
|
require 'rspec'
|
5
5
|
require 'rspec/retry'
|
6
|
-
require 'yarjuf'
|
7
6
|
require 'chemistrykit/cli/new'
|
8
7
|
require 'chemistrykit/cli/formula'
|
9
8
|
require 'chemistrykit/cli/beaker'
|
@@ -14,6 +13,7 @@ require 'selenium_connect'
|
|
14
13
|
require 'chemistrykit/configuration'
|
15
14
|
require 'parallel_tests'
|
16
15
|
require 'chemistrykit/parallel_tests_mods'
|
16
|
+
require 'chemistrykit/j_unit'
|
17
17
|
|
18
18
|
module ChemistryKit
|
19
19
|
module CLI
|
@@ -66,6 +66,7 @@ module ChemistryKit
|
|
66
66
|
method_option :parallel, default: false
|
67
67
|
method_option :results_file, aliases: '-r', default: false, desc: 'Specifiy the name of your results file.'
|
68
68
|
method_option :all, default: false, aliases: '-a', desc: 'Run every beaker.', type: :boolean
|
69
|
+
method_option :retry, default: false, aliases: '-x', desc: 'How many times should a failing test be retried.'
|
69
70
|
|
70
71
|
def brew
|
71
72
|
config = load_config options['config']
|
@@ -119,6 +120,9 @@ module ChemistryKit
|
|
119
120
|
if options['results_file']
|
120
121
|
config.log.results_file = options['results_file']
|
121
122
|
end
|
123
|
+
if options['retry']
|
124
|
+
config.retries_on_failure = options['retry'].to_i
|
125
|
+
end
|
122
126
|
config
|
123
127
|
end
|
124
128
|
|
@@ -168,17 +172,22 @@ module ChemistryKit
|
|
168
172
|
c.around(:each) do |example|
|
169
173
|
# create the beaker name from the example data
|
170
174
|
beaker_name = example.metadata[:example_group][:description_args].first.downcase.strip.gsub(' ', '_').gsub(/[^\w-]/, '')
|
175
|
+
test_name = example.metadata[:full_description].downcase.strip.gsub(' ', '_').gsub(/[^\w-]/, '')
|
176
|
+
|
171
177
|
# override log path with be beaker sub path
|
172
178
|
sc_config = @config.selenium_connect.dup
|
173
179
|
sc_config[:log] += "/#{beaker_name}"
|
174
|
-
|
175
|
-
Dir.mkdir
|
180
|
+
beaker_path = File.join(Dir.getwd, sc_config[:log])
|
181
|
+
Dir.mkdir beaker_path unless File.exists?(beaker_path)
|
182
|
+
sc_config[:log] += "/#{test_name}"
|
183
|
+
test_path = File.join(Dir.getwd, sc_config[:log])
|
184
|
+
Dir.mkdir test_path unless File.exists?(test_path)
|
176
185
|
|
177
186
|
# configure and start sc
|
178
187
|
configuration = SeleniumConnect::Configuration.new sc_config
|
179
188
|
@sc = SeleniumConnect.start configuration
|
180
189
|
@job = @sc.create_job # create a new job
|
181
|
-
@driver = @job.start name:
|
190
|
+
@driver = @job.start name: test_name
|
182
191
|
example.run
|
183
192
|
end
|
184
193
|
c.after(:each) do
|
@@ -197,7 +206,7 @@ module ChemistryKit
|
|
197
206
|
|
198
207
|
# for rspec-retry
|
199
208
|
c.verbose_retry = true # for rspec-retry
|
200
|
-
c.default_retry_count =
|
209
|
+
c.default_retry_count = config.retries_on_failure
|
201
210
|
|
202
211
|
if config.concurrency == 1 || options['parallel']
|
203
212
|
c.add_formatter(config.log.format, File.join(Dir.getwd, config.log.path, config.log.results_file))
|
@@ -9,7 +9,8 @@ module ChemistryKit
|
|
9
9
|
|
10
10
|
attr_accessor :base_url,
|
11
11
|
:concurrency,
|
12
|
-
:screenshot_on_fail
|
12
|
+
:screenshot_on_fail,
|
13
|
+
:retries_on_failure
|
13
14
|
|
14
15
|
attr_reader :log
|
15
16
|
|
@@ -18,6 +19,7 @@ module ChemistryKit
|
|
18
19
|
def initialize(hash)
|
19
20
|
# set defaults
|
20
21
|
@concurrency = 1
|
22
|
+
@retries_on_failure = 1
|
21
23
|
@selenium_connect = {}
|
22
24
|
@screenshot_on_fail = false
|
23
25
|
@log = OpenStruct.new
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
|
3
|
+
require 'time'
|
4
|
+
require 'builder'
|
5
|
+
require 'rspec/core/formatters/base_formatter'
|
6
|
+
|
7
|
+
# An RSpec formatter for generating results in JUnit format
|
8
|
+
# updated from https://github.com/natritmeyer/yarjuf
|
9
|
+
class JUnit < RSpec::Core::Formatters::BaseFormatter
|
10
|
+
|
11
|
+
# rspec formatter methods we care about
|
12
|
+
|
13
|
+
def initialize(output)
|
14
|
+
super output
|
15
|
+
@test_suite_results = {}
|
16
|
+
@builder = Builder::XmlMarkup.new indent: 2
|
17
|
+
end
|
18
|
+
|
19
|
+
def example_passed(example)
|
20
|
+
add_to_test_suite_results example
|
21
|
+
end
|
22
|
+
|
23
|
+
def example_failed(example)
|
24
|
+
add_to_test_suite_results example
|
25
|
+
end
|
26
|
+
|
27
|
+
def example_pending(example)
|
28
|
+
add_to_test_suite_results example
|
29
|
+
end
|
30
|
+
|
31
|
+
def dump_summary(duration, example_count, failure_count, pending_count)
|
32
|
+
build_results duration, example_count, failure_count, pending_count
|
33
|
+
output.puts @builder.target!
|
34
|
+
end
|
35
|
+
|
36
|
+
protected
|
37
|
+
|
38
|
+
def add_to_test_suite_results(example)
|
39
|
+
suite_name = JUnit.root_group_name_for(example)
|
40
|
+
@test_suite_results[suite_name] = [] unless @test_suite_results.keys.include? suite_name
|
41
|
+
@test_suite_results[suite_name] << example
|
42
|
+
end
|
43
|
+
|
44
|
+
def failure_details_for(example)
|
45
|
+
exception = example.metadata[:execution_result][:exception]
|
46
|
+
exception.nil? ? '' : "#{exception.message}\n#{format_backtrace(exception.backtrace, example).join("\n")}"
|
47
|
+
end
|
48
|
+
|
49
|
+
# utility methods
|
50
|
+
|
51
|
+
def self.count_in_suite_of_type(suite, test_case_result_type)
|
52
|
+
suite.select { |example| example.metadata[:execution_result][:status] == test_case_result_type }.size
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.root_group_name_for(example)
|
56
|
+
group_hierarchy = []
|
57
|
+
current_example_group = example.metadata[:example_group]
|
58
|
+
until current_example_group.nil?
|
59
|
+
group_hierarchy.unshift current_example_group
|
60
|
+
current_example_group = current_example_group[:example_group]
|
61
|
+
end
|
62
|
+
JUnit.slugify group_hierarchy.first[:description]
|
63
|
+
end
|
64
|
+
|
65
|
+
# methods to build the xml for test suites and individual tests
|
66
|
+
|
67
|
+
def build_results(duration, example_count, failure_count, pending_count)
|
68
|
+
@builder.instruct! :xml, version: '1.0', encoding: 'UTF-8'
|
69
|
+
@builder.testsuites errors: 0, failures: failure_count, skipped: pending_count, tests: example_count, time: duration, timestamp: Time.now.iso8601 do
|
70
|
+
build_all_suites
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def build_all_suites
|
75
|
+
@test_suite_results.each do |suite_name, tests|
|
76
|
+
build_test_suite suite_name, tests
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def build_test_suite(suite_name, tests)
|
81
|
+
failure_count = JUnit.count_in_suite_of_type tests, 'failed'
|
82
|
+
skipped_count = JUnit.count_in_suite_of_type tests, 'pending'
|
83
|
+
|
84
|
+
@builder.testsuite name: suite_name, tests: tests.size, errors: 0, failures: failure_count, skipped: skipped_count do
|
85
|
+
@builder.properties
|
86
|
+
build_all_tests tests
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def build_all_tests(tests)
|
91
|
+
tests.each do |test|
|
92
|
+
build_test test
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def build_test(test)
|
97
|
+
test_name = JUnit.slugify test.metadata[:full_description]
|
98
|
+
execution_time = test.metadata[:execution_result][:run_time]
|
99
|
+
test_status = test.metadata[:execution_result][:status]
|
100
|
+
|
101
|
+
@builder.testcase name: test_name, time: execution_time do
|
102
|
+
case test_status
|
103
|
+
when 'pending' then @builder.skipped
|
104
|
+
when 'failed' then build_failed_test test
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def build_failed_test(test)
|
110
|
+
failure_message = "failed #{test.metadata[:full_description]}"
|
111
|
+
|
112
|
+
@builder.failure message: failure_message, type: 'failed' do
|
113
|
+
@builder.cdata! failure_details_for test
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def self.slugify(string)
|
118
|
+
string.downcase.strip.gsub(' ', '_').gsub(/[^\w-]/, '')
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# Default Chemisty Kit Configuration File
|
2
2
|
|
3
3
|
base_url: http://google.com
|
4
|
+
retries_on_failure: 1 #defaults to 1, set the number of times a test should be retried on failure
|
4
5
|
concurrency: 1
|
5
6
|
log:
|
6
7
|
path: #you may override the default log path 'evidence'
|
@@ -9,24 +10,22 @@ log:
|
|
9
10
|
selenium_connect:
|
10
11
|
#Setup & Debugging
|
11
12
|
jar:
|
12
|
-
log:
|
13
|
-
|
14
13
|
|
15
14
|
#Where to run your tests
|
16
15
|
host: 'localhost'
|
17
16
|
port: #set to 4444 by default
|
18
17
|
|
19
|
-
|
20
18
|
#Browser & Host
|
21
19
|
browser: 'firefox'
|
22
20
|
browser_path:
|
23
21
|
profile_path:
|
24
22
|
profile_name:
|
25
23
|
|
26
|
-
|
27
24
|
#Saucelabs
|
28
|
-
os:
|
29
25
|
sauce_username:
|
30
26
|
sauce_api_key:
|
31
|
-
|
32
|
-
|
27
|
+
api_timeout:
|
28
|
+
sauce_opts:
|
29
|
+
os:
|
30
|
+
browser_version:
|
31
|
+
job_name:
|
@@ -6,6 +6,7 @@ describe ChemistryKit::Configuration do
|
|
6
6
|
|
7
7
|
VALID_BASE_URL = 'http://google.com'
|
8
8
|
VALID_CONCURRENCY = 1
|
9
|
+
VALID_RETRIES_ON_FAILURE = 1
|
9
10
|
VALID_CONFIG_FILE = 'config.yaml'
|
10
11
|
VALID_LOG_PATH = 'evidence'
|
11
12
|
VALID_JUNIT = 'results_junit.xml'
|
@@ -19,13 +20,15 @@ describe ChemistryKit::Configuration do
|
|
19
20
|
base_url: VALID_BASE_URL,
|
20
21
|
concurrency: VALID_CONCURRENCY,
|
21
22
|
selenium_connect: @valid_selenium_connect_hash,
|
22
|
-
log: @valid_log_hash
|
23
|
+
log: @valid_log_hash,
|
24
|
+
retries_on_failure: VALID_RETRIES_ON_FAILURE
|
23
25
|
}
|
24
26
|
end
|
25
27
|
|
26
28
|
def validate_config(config)
|
27
29
|
config.screenshot_on_fail.should eq false
|
28
30
|
config.concurrency.should eq VALID_CONCURRENCY
|
31
|
+
config.retries_on_failure.should eq VALID_RETRIES_ON_FAILURE
|
29
32
|
config.base_url.should eq VALID_BASE_URL
|
30
33
|
config.log.path.should eq VALID_LOG_PATH
|
31
34
|
config.log.results_file.should eq VALID_JUNIT
|
@@ -36,6 +39,7 @@ describe ChemistryKit::Configuration do
|
|
36
39
|
it 'should initialize with sane defaults' do
|
37
40
|
config = ChemistryKit::Configuration.new({})
|
38
41
|
config.concurrency.should eq VALID_CONCURRENCY
|
42
|
+
config.retries_on_failure.should eq VALID_RETRIES_ON_FAILURE
|
39
43
|
config.log.path.should eq VALID_LOG_PATH
|
40
44
|
config.log.results_file.should eq VALID_JUNIT
|
41
45
|
config.log.format.should eq VALID_JUNIT_FORMAT_OUT
|
@@ -71,4 +75,9 @@ describe ChemistryKit::Configuration do
|
|
71
75
|
config = ChemistryKit::Configuration.new({ log: { path: 'main-path' }, selenium_connect: { log: 'sc-log' } })
|
72
76
|
config.selenium_connect.should eq({ log: 'sc-log' })
|
73
77
|
end
|
78
|
+
|
79
|
+
it 'should allow pass through of sauce options' do
|
80
|
+
config = ChemistryKit::Configuration.new selenium_connect: { log: 'sc-log', sauce_opts: { job_name: 'test' } }
|
81
|
+
config.selenium_connect.should eq log: 'sc-log', sauce_opts: { job_name: 'test' }
|
82
|
+
end
|
74
83
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chemistrykit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-07-
|
13
|
+
date: 2013-07-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
@@ -45,13 +45,13 @@ dependencies:
|
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 2.14.1
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
48
|
+
name: builder
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 3.2.2
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
62
|
+
version: 3.2.2
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: selenium-webdriver
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
@@ -99,7 +99,7 @@ dependencies:
|
|
99
99
|
requirements:
|
100
100
|
- - ~>
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 3.
|
102
|
+
version: 3.3.1
|
103
103
|
type: :runtime
|
104
104
|
prerelease: false
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -107,7 +107,7 @@ dependencies:
|
|
107
107
|
requirements:
|
108
108
|
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 3.
|
110
|
+
version: 3.3.1
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: parallel_tests
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -268,8 +268,8 @@ dependencies:
|
|
268
268
|
- - ~>
|
269
269
|
- !ruby/object:Gem::Version
|
270
270
|
version: 0.6.7
|
271
|
-
description:
|
272
|
-
|
271
|
+
description: updated evidence to put in test based folders and added configuration
|
272
|
+
for the retry functionality
|
273
273
|
email:
|
274
274
|
- dave@arrgyle.com
|
275
275
|
- jason@arrgyle.com
|
@@ -316,6 +316,7 @@ files:
|
|
316
316
|
- lib/chemistrykit/cli/new.rb
|
317
317
|
- lib/chemistrykit/configuration.rb
|
318
318
|
- lib/chemistrykit/formula/base.rb
|
319
|
+
- lib/chemistrykit/j_unit.rb
|
319
320
|
- lib/chemistrykit/parallel_tests_mods.rb
|
320
321
|
- lib/templates/beaker.tt
|
321
322
|
- lib/templates/beaker_with_formula.tt
|
@@ -354,10 +355,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
354
355
|
version: '0'
|
355
356
|
segments:
|
356
357
|
- 0
|
357
|
-
hash: -
|
358
|
+
hash: -324108040210892536
|
358
359
|
requirements: []
|
359
360
|
rubyforge_project:
|
360
|
-
rubygems_version: 1.8.
|
361
|
+
rubygems_version: 1.8.25
|
361
362
|
signing_key:
|
362
363
|
specification_version: 3
|
363
364
|
summary: A simple and opinionated web testing framework for Selenium that follows
|