chemistrykit 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ branches:
5
+ only:
6
+ - master
7
+ - develop
8
+ notifications:
9
+ hipchat: 2a07784c1aeed1b6efa332242d3fc3@Regulation Station
data/CHANGELOG.md CHANGED
@@ -1,5 +1,78 @@
1
- v0.1.1
2
- ======
1
+ #1.3.0 (2013-06-22)
2
+ - Added explicit recursive file loading process for formulas
3
+ - Cleaned up documentation
4
+ - Updated tests
5
+ - Cleaned up logging
6
+
7
+ #1.2.1 (2013-06-21)
8
+ - Bumping version number and adding Jason Fox as an author
9
+ - Making it so symbol values as tags in beakers will default to true if no value is set to them
10
+ - Pulled out the log value setter from shared_context and rolled this up into selenium-connect instead. Bumped to new version of selenium-connect to get this functionality
11
+ - Reworked the status check and exit logic order and implemented it as a ternary (effectively regressing back to what was there way back when). A better band-aid fix for now.
12
+ - added small tweak to catch the {} returned by calling ckit, which was giving an hash to integer conversion error
13
+ - Bumped version and removed the un-used spec dir
14
+ - Fixes #59. Will need to revisit the approach since it is a workaround given difficulties in getting Thor's self.exit_on_failure?; true; end to work properly Re: https://github.com/erikhuda/thor/issues/244
15
+ - Added a test to capture the exit status issue
16
+ - Updated the spec and moved it up a dir
17
+ - removed symlinking of historical log files and cleaned up the logging system to output the junit xml and the server log to the evidence directory. Added a bit of test for that.
18
+ - updated git ignore for build directory and changed the new feature to a different name to prevent conflicts
19
+ - removed non running spec
20
+ - added a few rake tasks and switched to standard build directory
21
+ #1.1.1 (2013-06-09)
22
+ - Bumping selenium-connect version to account for sauce gem breaking changes
23
+
24
+ #1.1.0 (2013-06-09)
25
+ - Added the ability to pass in environment variables with ckit brew --params=THING1:value THING2:value
26
+
27
+ #1.0.0 (2013-06-05)
28
+ - Removed a hard-coded exit code checker from the ckit binary, also adjusted the requires in it to use the top level chemistrykit file in lib. Had to rework that file as well. Also updated the readme
29
+ - Looks like my previous commit didn't include the cleanup of old files. Here you go! Also, updated the readme slightly
30
+ - Wired up selenium-connect and gladly gutted a heap of code that it replaced. Also, updated the readme and updated the gemspec.
31
+ - Readded the new commmand since someone got a little code clippy. Wired up the assertion in the "new" test so it actually works. And made the tmp directory listing explicit.
32
+ - Adding tmp directory to gitignore
33
+ - Updating gitignore for rvmrc
34
+ - Added string interpolation for doc strings with erb and consolidated the brew feature into a single scenario outline with an examples table
35
+ - Simplified ckit generate with a proper subcommand
36
+ - Tested on local branch, tests passing. Removed puts.
37
+ - Add the requires back to the method, not happy about it, but necessary for now
38
+ - Didn't comment out all of one scenario: fixed
39
+ - Disabled sauce with chrome scenario, without a way to check sauce to see if chrome is being used, it's the same as sauce with firefox
40
+ - All four scenarios working. Sacuelabs credentials needed in order for tests to run.
41
+ - Wait only 15 seconds intead of 30 seconds
42
+ - Passing selenium-webdriver and local selenium server scenarios
43
+ - Disabled new.feature, updated brew.feature with 4 types of scenarios
44
+ - Removed usage title, it already has a good title
45
+ - Brew cmd not default, updated documentation to reflect change
46
+ - Removed a duplicate if statement, added a lot of puts to see what's happening
47
+ - Added before(:all) hook to fix #48, refactored more logic out of before(:each)
48
+ - Condensed to methods for driver into one
49
+ - Updated the generated beaker with a formula to use the let incantation.
50
+ - Required formula in generator
51
+ - changelog updated to v0.1.1
52
+ - Added rake back to the gemspec becuase we are using it
53
+ - remove more self's
54
+ - You don't need to reference self so much, it will figure it out
55
+ - You don't need to initialize instance methods unless you want to set their value
56
+ - Passing variables from module Sauce to Ckit in a safer way, fixed bug where executor was being called twice per test
57
+ - Extracted sauce actions into a module
58
+ - Refactored logic out of after:each into methods
59
+ - Case statement for symlinking, added notes about they whys
60
+ - seperated rspec configuration from tagging logic
61
+ - log_timestamp was being called twice and creating two different values - fixed
62
+ - Removal of if statement, using ln_sf forces the creation of a symlink if one already exists
63
+ - Refactored logic for brew command into protected methods
64
+ - Added code climate badge
65
+ - Corrected version #
66
+ - Adding a tag for testing the testing of aruba
67
+ - Added a passing brew commit command and modified support.rb to env.rb like the docs say
68
+ - More updates to make it less overhead
69
+ - Simplified the new cli feature file, I think I'm starting to get aruba
70
+ - Told git to ignore the files that aruba is creating and updated new feature
71
+ - Cucumber spec for ckit new command
72
+ - Removed rake because we're not using it, added aruba and cucumber because living docs for the Cli is cool
73
+ - Please load aruba when you run feature files
74
+
75
+ #0.1.1 (2013-02-02)
3
76
 
4
77
  * `ckit new` generates a chemistrykit project
5
78
  * Execute tests in SauceLabs Ondemand
data/CONTRIBUTORS.md CHANGED
@@ -1,5 +1,5 @@
1
1
  In alphabetical order:
2
2
 
3
+ * Jason Fox (@jasonrobertfox)
3
4
  * Adam Goucher (@adamgoucher)
4
5
  * Dave Haeffner (@tourdedave)
5
- * Jason Wieringa (@jwieringa)
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/chemistrykit.png)](http://badge.fury.io/rb/chemistrykit)
2
2
  [![Code Climate](https://codeclimate.com/github/arrgyle/chemistrykit.png)](https://codeclimate.com/github/arrgyle/chemistrykit)
3
3
 
4
+ Master branch: [![Build Status](https://travis-ci.org/arrgyle/chemistrykit.png?branch=master)](https://travis-ci.org/jrobertfox/chef-broiler-platter)
5
+
6
+ Develop branch: [![Build Status](https://travis-ci.org/arrgyle/chemistrykit.png?branch=develop)](https://travis-ci.org/jrobertfox/chef-broiler-platter)
7
+
4
8
  ChemistryKit
5
9
  ============================================================
6
10
 
@@ -28,8 +32,18 @@ This will run ckit and execute your beakers. By default it will run the tests lo
28
32
 
29
33
 
30
34
  ## Contributing
35
+ This project conforms to the [neverstopbuilding/craftsmanship](https://github.com/neverstopbuilding/craftsmanship) guidelines. Please see them for details on:
36
+ - Branching theory
37
+ - Documentation expectations
38
+ - Release process
39
+
40
+ ###It's simple
41
+
42
+ 1. Create a feature branch from develop: `git checkout -b feature/myfeature develop` or `git flow feature start myfeature`
43
+ 2. Do something awesome.
44
+ 3. Submit a pull request.
31
45
 
32
- This project conforms to the [neverstopbuilding/craftsmanship](https://github.com/neverstopbuilding/craftsmanship) guidelines. Please see them for details.
46
+ All issues and questions related to this project should be logged using the [github issues](https://github.com/arrgyle/chemistrykit/issues) feature.
33
47
 
34
48
  ### Install Dependencies
35
49
 
@@ -41,4 +55,4 @@ This project conforms to the [neverstopbuilding/craftsmanship](https://github.co
41
55
 
42
56
  ### Run the local version of the executable:
43
57
 
44
- bin/ckit
58
+ ckit
data/Rakefile CHANGED
@@ -3,14 +3,21 @@ require "cucumber"
3
3
  require "cucumber/rake/task"
4
4
  require 'rspec/core/rake_task'
5
5
 
6
- task :default => [:build]
6
+ task :default => [:build_ci]
7
7
 
8
8
  desc 'Runs standard build activities.'
9
- task :build => [:clean, :spec, :cucumber]
9
+ task :build => [:clean, :prepare, :spec, :cucumber]
10
+
11
+ desc 'Runs standard build activities for ci server.'
12
+ task :build_ci => [:clean, :prepare, :spec]
10
13
 
11
14
  desc 'Removes the build directory.'
12
15
  task :clean do
13
- FileUtils.rm_rf('build');
16
+ FileUtils.rm_rf('build')
17
+ end
18
+ desc 'Adds the build tmp directory for test kit creation.'
19
+ task :prepare do
20
+ FileUtils.mkdir_p('build/tmp')
14
21
  end
15
22
 
16
23
  RSpec::Core::RakeTask.new(:spec)
data/chemistrykit.gemspec CHANGED
@@ -1,12 +1,12 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "chemistrykit"
3
- s.version = "1.2.1"
3
+ s.version = "1.3.0"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ["Dave Haeffner", "Jason Fox"]
6
6
  s.email = ["dave@arrgyle.com", "jason@arrgyle.com"]
7
7
  s.homepage = "https://github.com/arrgyle/chemistrykit"
8
8
  s.summary = "A simple and opinionated web testing framework for Selenium that follows convention over configuration."
9
- s.description = "Fixing the exit codes better, and addressing a bug with logging."
9
+ s.description = "Updated file loading, documentation and tests."
10
10
  s.license = 'MIT'
11
11
 
12
12
  s.files = `git ls-files`.split($/)
@@ -37,6 +37,7 @@ Feature: Brewing a ChemistryKit project
37
37
  Scenario Outline: Run All Configurations
38
38
  When I overwrite _config.yaml with:
39
39
  """
40
+ log: 'evidence'
40
41
  host: '<%= <hostname> %>'
41
42
  sauce_username: 'testing_arrgyle'
42
43
  sauce_api_key: 'ab7a6e17-16df-42d2-9ef6-c8d2539cc38a'
@@ -51,3 +52,5 @@ Feature: Brewing a ChemistryKit project
51
52
  | hostname |
52
53
  | "localhost" |
53
54
  # | "saucelabs" |
55
+
56
+
@@ -0,0 +1,47 @@
1
+ Feature: Load Page Objects
2
+ Formulas should be loaded in the correct order with thier dependencies
3
+
4
+ Scenario: Load the libs first
5
+ Given I run `ckit new big-project`
6
+ And I cd to "big-project"
7
+ And a file named "formulas/big.rb" with:
8
+ """
9
+ module Formulas
10
+ class BigProject < Formula
11
+
12
+ def open(url)
13
+ helper_open(url)
14
+ end
15
+
16
+ end
17
+ end
18
+ """
19
+
20
+ And a file named "formulas/lib/formula.rb" with:
21
+ """
22
+ module Formulas
23
+ class Formula
24
+ def initialize(driver)
25
+ @driver = driver
26
+ end
27
+
28
+ def helper_open(url)
29
+ @driver.get url
30
+ end
31
+ end
32
+ end
33
+ """
34
+
35
+ And a file named "beaker/big_beaker.rb" with:
36
+ """
37
+ describe "Big", :depth => 'shallow' do
38
+ let(:book) { Formulas::BigProject.new(@driver) }
39
+
40
+ it "loads an external web page" do
41
+ book.open "http://www.google.com"
42
+ end
43
+ end
44
+ """
45
+
46
+ When I run `ckit brew`
47
+ Then the stdout should contain "1 example, 0 failures"
@@ -4,6 +4,7 @@ require 'ci/reporter/rake/rspec_loader'
4
4
  require 'chemistrykit/cli/new'
5
5
  require 'chemistrykit/cli/formula'
6
6
  require 'chemistrykit/cli/beaker'
7
+ require 'chemistrykit/cli/helpers/formula_loader'
7
8
 
8
9
  module ChemistryKit
9
10
  module CLI
@@ -45,7 +46,8 @@ module ChemistryKit
45
46
  end
46
47
 
47
48
  def load_page_objects
48
- Dir["#{Dir.getwd}/formulas/*.rb"].each {|file| require file }
49
+ loader = ChemistryKit::CLI::Helpers::FormulaLoader.new
50
+ loader.get_formulas(File.join(Dir.getwd, 'formulas')).each {|file| require file }
49
51
  end
50
52
 
51
53
  def set_logs_dir
@@ -0,0 +1,46 @@
1
+ module ChemistryKit
2
+ module CLI
3
+ module Helpers
4
+ class FormulaLoader
5
+ #this loader returns the formulas found in a path according to these rules:
6
+ #- directories loaded in alpha order
7
+ #- children directories loaded before parents
8
+ #- files loaded in alpha order
9
+ #- lib directories are loaded before any other
10
+ #- rules stack
11
+
12
+ def initialize
13
+ @formulas = Array.new
14
+ end
15
+
16
+ def get_formulas(path)
17
+ gather(path)
18
+ @formulas
19
+ end
20
+
21
+ private
22
+ def gather(path)
23
+ #get all the directories for path
24
+ directories = Dir.entries(path).select {|entry| File.directory? File.join(path,entry) and !(entry =='.' || entry == '..') }
25
+ if directories.empty?
26
+ #if there are no directories is empty just get all the files and add it to the instance variable
27
+ @formulas.concat Dir.glob(File.join(path, "*.rb")).sort
28
+ else
29
+ #otherwise for each of them recurse into it
30
+ directories.sort!
31
+ if directories.include? 'lib'
32
+ #if there is a lib directory, put that at the front
33
+ directories.delete('lib')
34
+ directories.unshift('lib')
35
+ end
36
+ directories.each do |directory|
37
+ gather(File.join(path, directory))
38
+ end
39
+ #and then after add the files in the original parent
40
+ @formulas.concat Dir.glob(File.join(path, "*.rb")).sort
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,87 @@
1
+ require 'spec_helper'
2
+ #might be able to use something like this: https://github.com/alexeypetrushin/class_loader
3
+
4
+ describe ChemistryKit::CLI::Helpers::FormulaLoader do
5
+
6
+ before(:each) do
7
+ @loader = ChemistryKit::CLI::Helpers::FormulaLoader.new
8
+ Dir.mkdir(File.join(TEST_TMP_PATH, 'formula'))
9
+ end
10
+
11
+ it 'should return a new instance of the loader' do
12
+ @loader.should be_an_instance_of ChemistryKit::CLI::Helpers::FormulaLoader
13
+ end
14
+
15
+ it 'should return ruby files in alphabetical order' do
16
+ #create some test files
17
+ d = File.join(TEST_TMP_PATH, 'formula', 'd.rb')
18
+ a = File.join(TEST_TMP_PATH, 'formula', 'a.rb')
19
+ b = File.join(TEST_TMP_PATH, 'formula', 'b.rb')
20
+ FileUtils.touch(d)
21
+ FileUtils.touch(a)
22
+ FileUtils.touch(b)
23
+
24
+ #ensure the result
25
+ @loader.get_formulas(File.join(TEST_TMP_PATH, 'formula')).should eq [a, b, d]
26
+
27
+ end
28
+
29
+ it 'should order files in child directories before parent directories' do
30
+ Dir.mkdir(File.join(TEST_TMP_PATH, 'formula', 'child'))
31
+ d = File.join(TEST_TMP_PATH, 'formula', 'child' ,'d.rb')
32
+ b = File.join(TEST_TMP_PATH, 'formula', 'child' ,'b.rb')
33
+ a = File.join(TEST_TMP_PATH, 'formula', 'a.rb')
34
+ c = File.join(TEST_TMP_PATH, 'formula', 'c.rb')
35
+ FileUtils.touch(d)
36
+ FileUtils.touch(b)
37
+ FileUtils.touch(a)
38
+ FileUtils.touch(c)
39
+
40
+ @loader.get_formulas(File.join(TEST_TMP_PATH, 'formula')).should eq [b, d, a, c]
41
+ end
42
+
43
+ it 'should load directories in alphabetical order' do
44
+ Dir.mkdir(File.join(TEST_TMP_PATH, 'formula', 'abby'))
45
+ Dir.mkdir(File.join(TEST_TMP_PATH, 'formula', 'road'))
46
+ d = File.join(TEST_TMP_PATH, 'formula', 'abby' ,'d.rb')
47
+ b = File.join(TEST_TMP_PATH, 'formula', 'road' ,'b.rb')
48
+ FileUtils.touch(d)
49
+ FileUtils.touch(b)
50
+ @loader.get_formulas(File.join(TEST_TMP_PATH, 'formula')).should eq [d, b]
51
+ end
52
+
53
+ it 'should load any lib directory before any other' do
54
+ Dir.mkdir(File.join(TEST_TMP_PATH, 'formula', 'lib'))
55
+ Dir.mkdir(File.join(TEST_TMP_PATH, 'formula', 'abby'))
56
+ d = File.join(TEST_TMP_PATH, 'formula', 'lib' ,'d.rb')
57
+ b = File.join(TEST_TMP_PATH, 'formula', 'abby' ,'b.rb')
58
+ FileUtils.touch(d)
59
+ FileUtils.touch(b)
60
+ @loader.get_formulas(File.join(TEST_TMP_PATH, 'formula')).should eq [d, b]
61
+ end
62
+
63
+ it 'should apply stack these rules deeply' do
64
+ Dir.mkdir(File.join(TEST_TMP_PATH, 'formula', 'lib'))
65
+ Dir.mkdir(File.join(TEST_TMP_PATH, 'formula', 'abby'))
66
+ Dir.mkdir(File.join(TEST_TMP_PATH, 'formula', 'abby', 'lib'))
67
+ Dir.mkdir(File.join(TEST_TMP_PATH, 'formula', 'abby', 'road'))
68
+
69
+ a = File.join(TEST_TMP_PATH, 'formula', 'lib' ,'a.rb')
70
+ c = File.join(TEST_TMP_PATH, 'formula', 'abby' ,'c.rb')
71
+ b = File.join(TEST_TMP_PATH, 'formula', 'b.rb')
72
+ d = File.join(TEST_TMP_PATH, 'formula', 'abby' , 'lib', 'd.rb')
73
+ e = File.join(TEST_TMP_PATH, 'formula', 'abby' , 'road', 'e.rb')
74
+
75
+ FileUtils.touch(a)
76
+ FileUtils.touch(b)
77
+ FileUtils.touch(c)
78
+ FileUtils.touch(d)
79
+ FileUtils.touch(e)
80
+
81
+ @loader.get_formulas(File.join(TEST_TMP_PATH, 'formula')).should eq [a, d, e, c, b]
82
+ end
83
+
84
+ after(:each) do
85
+ FileUtils.rm_rf(File.join(TEST_TMP_PATH, 'formula'))
86
+ end
87
+ end
data/spec/spec_helper.rb CHANGED
@@ -4,6 +4,15 @@
4
4
  # loaded once.
5
5
  #
6
6
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
+ #
8
+ require 'rubygems'
9
+ require 'bundler/setup'
10
+ require 'fileutils'
11
+ #not sure it this is the right way to include all the files under test.
12
+ require_relative '../lib/chemistrykit/cli/helpers/formula_loader'
13
+
14
+ TEST_TMP_PATH = File.join(Dir.pwd, 'build', 'tmp')
15
+
7
16
  RSpec.configure do |config|
8
17
  config.treat_symbols_as_metadata_keys_with_true_values = true
9
18
  config.run_all_when_everything_filtered = true
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: 1.2.1
4
+ version: 1.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -172,7 +172,7 @@ dependencies:
172
172
  - - ~>
173
173
  - !ruby/object:Gem::Version
174
174
  version: 10.0.3
175
- description: Fixing the exit codes better, and addressing a bug with logging.
175
+ description: Updated file loading, documentation and tests.
176
176
  email:
177
177
  - dave@arrgyle.com
178
178
  - jason@arrgyle.com
@@ -184,6 +184,7 @@ extra_rdoc_files: []
184
184
  files:
185
185
  - .gitignore
186
186
  - .rspec
187
+ - .travis.yml
187
188
  - CHANGELOG.md
188
189
  - CONTRIBUTORS.md
189
190
  - Gemfile
@@ -196,6 +197,7 @@ files:
196
197
  - ext/mkrf_conf.rb
197
198
  - features/brew.feature
198
199
  - features/exit_status.feature
200
+ - features/load_page_objects.feature
199
201
  - features/new.feature
200
202
  - features/step_definitions/steps.rb
201
203
  - features/support/env.rb
@@ -203,7 +205,7 @@ files:
203
205
  - lib/chemistrykit/cli/beaker.rb
204
206
  - lib/chemistrykit/cli/cli.rb
205
207
  - lib/chemistrykit/cli/formula.rb
206
- - lib/chemistrykit/cli/generators.rb
208
+ - lib/chemistrykit/cli/helpers/formula_loader.rb
207
209
  - lib/chemistrykit/cli/new.rb
208
210
  - lib/chemistrykit/shared_context.rb
209
211
  - lib/templates/beaker.tt
@@ -214,8 +216,7 @@ files:
214
216
  - lib/templates/chemistrykit/evidence/.gitkeep
215
217
  - lib/templates/chemistrykit/formulas/.gitkeep
216
218
  - lib/templates/formula.tt
217
- - readme2.md
218
- - spec/chemistrykit/cli_spec.rb
219
+ - spec/chemistrykit/cli/helpers/formula_loader_spec.rb
219
220
  - spec/spec_helper.rb
220
221
  homepage: https://github.com/arrgyle/chemistrykit
221
222
  licenses:
@@ -238,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
239
  version: '0'
239
240
  requirements: []
240
241
  rubyforge_project:
241
- rubygems_version: 1.8.24
242
+ rubygems_version: 1.8.25
242
243
  signing_key:
243
244
  specification_version: 3
244
245
  summary: A simple and opinionated web testing framework for Selenium that follows
@@ -246,8 +247,9 @@ summary: A simple and opinionated web testing framework for Selenium that follow
246
247
  test_files:
247
248
  - features/brew.feature
248
249
  - features/exit_status.feature
250
+ - features/load_page_objects.feature
249
251
  - features/new.feature
250
252
  - features/step_definitions/steps.rb
251
253
  - features/support/env.rb
252
- - spec/chemistrykit/cli_spec.rb
254
+ - spec/chemistrykit/cli/helpers/formula_loader_spec.rb
253
255
  - spec/spec_helper.rb
@@ -1,12 +0,0 @@
1
- require 'thor'
2
- require 'chemistrykit/cli/formula'
3
- require 'chemistrykit/cli/beaker'
4
-
5
- module ChemistryKit
6
- module CLI
7
- class Generate < Thor
8
- register(ChemistryKit::CLI::PageObjectGenerator, 'formula', 'formula [NAME]', 'generates a page object')
9
- register(ChemistryKit::CLI::BeakerGenerator, 'beaker', 'beaker [NAME]', 'generates a beaker')
10
- end
11
- end
12
- end
data/readme2.md DELETED
@@ -1,78 +0,0 @@
1
- Spec Discovery
2
- --------------
3
-
4
- ChemistryKit is built on top of RSpec. All specs are in the _beaker_ directory and end in _beaker.rb. Rather than being discovered via class or file name as some systems they are by identified by tag.
5
-
6
- ```ruby
7
- it 'with invalid credentials', :depth => 'shallow' do
8
-
9
- end
10
-
11
- it 'with invalid credentials', :depth => 'deep' do
12
-
13
- end
14
- ````
15
- All specs should have at least a :depth tag. The depth should either be 'shallow' or 'deep'. Shallow specs are the ones that are the absolute-must-pass ones. And there will only be a few of them typically. Deep ones are everything else.
16
-
17
- You can add multiple tags as well.
18
-
19
- ```ruby
20
- it 'with invalid credentials', :depth => 'shallow', :authentication => true do
21
-
22
- end
23
- ````
24
-
25
- By default ChemistryKit will discover and run the _:depth => 'shallow'_ scripts. To run different ones you use the --tag option.
26
-
27
- ckit brew --tag authentication
28
-
29
- ckit brew --tag depth:shallow --tag authentication
30
-
31
- To exlude a tag, put a ~ in front of it.
32
-
33
- ckit brew --tag depth:shallow --tag ~authentication
34
-
35
- A useful trick when developing a script is to use a custom tag.
36
-
37
- ```ruby
38
- it 'with invalid credentials', :depth => 'shallow', :flyingmonkeybutt => true do
39
-
40
- end
41
- ````
42
-
43
- Execution Order
44
- ---------------
45
-
46
- Chemistry Kit executes specs in a random order. This is intentional. Knowing the order a spec will be executed in allows for dependencies between them to creep in. Sometimes unintentionally. By having them go in a random order parallelization becomes a much easier.
47
-
48
- Facade all the Things!
49
- ----------------------
50
-
51
- Chemistry Kit injects itself between you and WebDriver and various other future components. You should also inject something between your project and Chemistry Kit. Chemistry Kit has started this for you in the following ways:
52
-
53
- - _config/requires.rb: @driver inside your scripts comes from the first line in this file
54
-
55
- Configuration
56
- -------------
57
-
58
- Configuration should not be in your script. Nor should it be commit to version control.
59
-
60
- Before and After
61
- ----------------
62
-
63
- Chemistry Kit uses the 4-phase model for scripts with a chunk of code that gets run before and after each method. By default, it does nothing more than launch a browser instance that your configuration says you want. If you want to do something more than that, just add it to your spec.
64
-
65
- ```ruby
66
- before(:each) do
67
- # something here
68
- end
69
- ```
70
-
71
- You can even nest them inside different describe/context blocks and they will get executed from the outside-in.
72
-
73
- Logs and CI Integration
74
- -----------------------
75
-
76
- Each run of Chemistry Kit creates a timestamped directory inside the _evidence_ directory. And in there will be the full set of JUnit Ant XML files. You don't point your CI server at this timestamped directory. Instead you want to point at the _latest_ directory which is a symlink to the latest timestamp directory.
77
-
78
-
File without changes