jasmine_selenium_runner 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71c49524cded239d450de93167e2e595e783d265
4
- data.tar.gz: 61c45501e41dbda1c35b7fbc8f07f881c6a956c1
3
+ metadata.gz: 8c72efde02f61e3edfbd9b908dbc9b61bf7d31ea
4
+ data.tar.gz: cb60cac460be62c9563be2ab87ab802393a42788
5
5
  SHA512:
6
- metadata.gz: f5e1c6a43f07697730c1309809aca6da84d9552df5e9224a6251ef1c86d3d0625a1b75b428ace67a64b7379708ed1c6258fd21869b4f846f41a343f250fd2b2b
7
- data.tar.gz: 314d392cdc9071ceab94f0a5c5ef02769d1dc52ac40640f6f30ff450ccdc853f33caf0511f066cce74d725cf188c57d95bd5ff53ffe554ee918e5ecbd2ae8698
6
+ metadata.gz: f119b0c6d31d03918b9bc59a6e6c037dac94ee4732d80c4a4d4c80d84b243f0fcf6a51190d6636006ad18e01bfd688dfeab30ecf13219be6696312a4845bf9cd
7
+ data.tar.gz: de2708d84c3159b4362e3d6a883e39e99933ca6fd86a6daa175f7d79c7fe631a4d70c426e8b7163b7f1ae896f99347569d12c06501c4c3e2904844167c28fc93
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency 'rspec'
24
24
  spec.add_development_dependency 'rails', '> 3.0'
25
- spec.add_dependency 'jasmine', '~> 2.0.0.alpha'
25
+ spec.add_dependency 'jasmine', '~> 2.0'
26
26
  spec.add_dependency 'selenium-webdriver', '~> 2.35'
27
27
  spec.add_dependency 'sauce-connect'
28
28
  end
@@ -50,23 +50,33 @@ module Jasmine
50
50
  def get_results
51
51
  index = 0
52
52
  spec_results = []
53
+ failed_suite_results = []
53
54
 
54
55
  loop do
55
- slice = results_without_circular_references(index)
56
+ slice = results_without_circular_references('spec', index)
56
57
  spec_results << slice
57
58
  index += result_batch_size
58
59
  break if slice.size < result_batch_size
59
60
  end
60
- spec_results.flatten
61
+
62
+ index = 0
63
+ loop do
64
+ slice = results_without_circular_references('suite', index)
65
+ failed_suite_results << slice.select(&:failed?)
66
+ index += result_batch_size
67
+ break if slice.size < result_batch_size
68
+ end
69
+
70
+ spec_results.flatten + failed_suite_results.flatten
61
71
  end
62
72
 
63
- def results_without_circular_references(starting_index)
73
+ def results_without_circular_references(result_type, starting_index)
64
74
  slice = driver.execute_script(<<-JS)
65
- var specResults = jsApiReporter.specResults(#{starting_index}, #{result_batch_size})
66
- for (var i = 0; i < specResults.length; i++) {
67
- var expectations = specResults[i].failedExpectations;
68
- if (specResults[i].passedExpectations) {
69
- expectations = expectations.concat(specResults[i].passedExpectations);
75
+ var results = jsApiReporter.#{result_type}Results(#{starting_index}, #{result_batch_size})
76
+ for (var i = 0; i < results.length; i++) {
77
+ var expectations = results[i].failedExpectations;
78
+ if (results[i].passedExpectations) {
79
+ expectations = expectations.concat(results[i].passedExpectations);
70
80
  }
71
81
  for (var j = 0; j < expectations.length; j++) {
72
82
  var expectation = expectations[j];
@@ -74,7 +84,7 @@ module Jasmine
74
84
  try { JSON.stringify(expectation.actual); } catch (e) { expectation.actual = '<circular actual>'; }
75
85
  }
76
86
  }
77
- return specResults;
87
+ return results;
78
88
  JS
79
89
  Jasmine::Result.map_raw_results(slice)
80
90
  end
@@ -1,7 +1,7 @@
1
1
  module Jasmine
2
2
  module Runners
3
3
  class Selenium
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,9 @@
1
+ describe('failing afterAll', function() {
2
+ afterAll(function() {
3
+ throw 'afterAll go boom';
4
+ });
5
+
6
+ it('is fine otherwise', function() {
7
+ });
8
+ });
9
+
@@ -13,6 +13,7 @@ describe Jasmine::Runners::Selenium do
13
13
  source 'https://rubygems.org'
14
14
  gem 'jasmine_selenium_runner', :path => '#{project_root}'
15
15
  gem 'jasmine', :git => 'https://github.com/pivotal/jasmine-gem.git'
16
+ gem 'jasmine-core', :git => 'https://github.com/pivotal/jasmine.git'
16
17
  GEMFILE
17
18
  end
18
19
  Bundler.with_clean_env do
@@ -33,6 +34,7 @@ GEMFILE
33
34
  source 'https://rubygems.org'
34
35
  gem 'jasmine_selenium_runner', :path => '#{project_root}'
35
36
  gem 'jasmine', :git => 'https://github.com/pivotal/jasmine-gem.git'
37
+ gem 'jasmine-core', :git => 'https://github.com/pivotal/jasmine.git'
36
38
  GEMFILE
37
39
  end
38
40
  Bundler.with_clean_env do
@@ -46,6 +48,28 @@ GEMFILE
46
48
  end
47
49
  end
48
50
 
51
+ it "reports failures in afterAll" do
52
+ in_temp_dir do |dir, project_root|
53
+ File.open(File.join(dir, 'Gemfile'), 'w') do |file|
54
+ file.write <<-GEMFILE
55
+ source 'https://rubygems.org'
56
+ gem 'jasmine_selenium_runner', :path => '#{project_root}'
57
+ gem 'jasmine', :git => 'https://github.com/pivotal/jasmine-gem.git'
58
+ gem 'jasmine-core', :git => 'https://github.com/pivotal/jasmine.git'
59
+ GEMFILE
60
+ end
61
+ Bundler.with_clean_env do
62
+ `bundle`
63
+ `bundle exec jasmine init`
64
+ `bundle exec jasmine examples`
65
+ FileUtils.cp(File.join(project_root, 'spec', 'fixtures', 'after_all_failure_spec.js'), File.join(dir, 'spec', 'javascripts'))
66
+ ci_output = `bundle exec rake -E "require 'jasmine_selenium_runner'" --trace jasmine:ci`
67
+ expect(ci_output).to match(/afterAll go boom/)
68
+ expect(ci_output).to match(/[1-9][0-9]* specs, 1 failure/)
69
+ end
70
+ end
71
+ end
72
+
49
73
  it "permits rake jasmine:ci task to be run using Sauce", :sauce => true do
50
74
  in_temp_dir do |dir, project_root|
51
75
  File.open(File.join(dir, 'Gemfile'), 'w') do |file|
@@ -53,6 +77,7 @@ GEMFILE
53
77
  source 'https://rubygems.org'
54
78
  gem 'jasmine_selenium_runner', :path => '#{project_root}'
55
79
  gem 'jasmine', :git => 'https://github.com/pivotal/jasmine-gem.git'
80
+ gem 'jasmine-core', :git => 'https://github.com/pivotal/jasmine.git'
56
81
  GEMFILE
57
82
  end
58
83
  Bundler.with_clean_env do
@@ -118,6 +143,7 @@ YAML
118
143
  Dir.chdir File.join(dir, 'rails-test')
119
144
  File.open('Gemfile', 'a') { |f|
120
145
  f.puts "gem 'jasmine', :git => 'https://github.com/pivotal/jasmine-gem.git'"
146
+ f.puts "gem 'jasmine-core', :git => 'https://github.com/pivotal/jasmine.git'"
121
147
  f.puts "gem 'jasmine_selenium_runner', :path => '#{project_root}'"
122
148
  }
123
149
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jasmine_selenium_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajan Agaskar
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-18 00:00:00.000000000 Z
12
+ date: 2014-11-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -73,14 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - ~>
75
75
  - !ruby/object:Gem::Version
76
- version: 2.0.0.alpha
76
+ version: '2.0'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - ~>
82
82
  - !ruby/object:Gem::Version
83
- version: 2.0.0.alpha
83
+ version: '2.0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: selenium-webdriver
86
86
  requirement: !ruby/object:Gem::Requirement
@@ -134,6 +134,7 @@ files:
134
134
  - lib/jasmine_selenium_runner/firebug/firebug.rb
135
135
  - lib/jasmine_selenium_runner/railtie.rb
136
136
  - lib/jasmine_selenium_runner/tasks/jasmine_selenium_runner.rake
137
+ - spec/fixtures/after_all_failure_spec.js
137
138
  - spec/fixtures/contains_circular_references_spec.js
138
139
  - spec/fixtures/is_in_firefox_spec.js
139
140
  - spec/fixtures/is_in_ie_spec.js
@@ -165,6 +166,7 @@ signing_key:
165
166
  specification_version: 4
166
167
  summary: Run your jasmine tests in a real live browser!
167
168
  test_files:
169
+ - spec/fixtures/after_all_failure_spec.js
168
170
  - spec/fixtures/contains_circular_references_spec.js
169
171
  - spec/fixtures/is_in_firefox_spec.js
170
172
  - spec/fixtures/is_in_ie_spec.js