effective_test_bot 0.5.6 → 0.5.7

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: cc1ac662d4557b9818bec29117d6abc40cb11f96
4
- data.tar.gz: 618b01ed2c8c6e6496917361a78e01f3b6a2e7c6
3
+ metadata.gz: e0878a09914b62c7063ae8e279fcb7c2b91ef822
4
+ data.tar.gz: 4c10586dd8a4c97330eacc8a3836fd4f1d31f0d4
5
5
  SHA512:
6
- metadata.gz: fd55d7c1210338f1075cba3e763c935cf31171656a72e96a5a58c22f0091693085cb134ff40896a44c849b70833b9afc368ba4c95aa10a95d074110a19be5196
7
- data.tar.gz: 538c9f722ca137ec5ab14fb255a12ab6440d998a08fd738bdc73f845028291e810d02292273c832196766043ee21bb7e58ced10074703fa736d16956496afb45
6
+ metadata.gz: b7ba39abeac4d13ae878850bdd99c8d51e5e2618e3d27ee04222135f9d01847ef53a7d5de71fdf2eeb4feaa45dcfe8129feef19df486541cf1e8767ec403367b
7
+ data.tar.gz: dcb2104def4ffee449bf9071af765f771b850dd6fc204419ca8d407bfbce2951c23d94936b8d46197be6f72a4a16080190bea78b463f6afd4a1f3ce0a3f5526b
@@ -22,7 +22,7 @@ module EffectiveTestBot
22
22
  end
23
23
 
24
24
  def save(exception)
25
- lines = [exception.message] + exception.backtrace.first(8)
25
+ lines = [exception.message] + exception.backtrace.first(12)
26
26
 
27
27
  dir = File.join(Dir.pwd, 'tmp', 'test_bot')
28
28
  file = File.join(dir, 'exception.txt')
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '0.5.6'.freeze
2
+ VERSION = '0.5.7'.freeze
3
3
  end
@@ -25,6 +25,10 @@ class ActionDispatch::IntegrationTest
25
25
  include Capybara::Assertions
26
26
  include Capybara::Screenshot::MiniTestPlugin
27
27
  include Warden::Test::Helpers if defined?(Devise)
28
+
29
+ def after_teardown # Some apps seem to need this to correctly reset the test_06:_capybara_can_sign_in
30
+ super(); Capybara.reset_sessions!
31
+ end
28
32
  end
29
33
 
30
34
  Capybara.default_driver = :webkit
@@ -91,9 +91,10 @@ namespace :test do
91
91
  Rake::Task['test:bot'].invoke
92
92
  end
93
93
 
94
- desc 'Runs effective_test_bot while skipping all previously passed tests'
94
+ desc 'Runs effective_test_bot while skipping all previously passed tests upto the first failure'
95
95
  task :fail do
96
96
  ENV['FAILS'] ||= 'true'
97
+ ENV['FAIL_FAST'] ||= 'true'
97
98
  Rake::Task['test:bot'].invoke
98
99
  end
99
100
 
@@ -25,7 +25,7 @@ module TestBotable
25
25
  end
26
26
 
27
27
  # Instance Methods - Call me from within a test
28
- def redirect_action_test(from:, to:, user: _test_bot_user(), options: {})
28
+ def redirect_action_test(from:, to:, user: _test_bot_user(), **options)
29
29
  begin
30
30
  assign_test_bot_lets!(options.reverse_merge!(from: from, to: to, user: user))
31
31
  rescue => e
@@ -17,8 +17,11 @@ module EffectiveTestBotFormFiller
17
17
  # Then we start at the first, and go left-to-right through all the tabs
18
18
  # clicking each one and filling any form fields found within
19
19
 
20
- active_tab = find("li.active > a[data-toggle='tab']")
21
- tab_content = find('div' + active_tab['href']).find(:xpath, '..')
20
+ active_tab = all("li.active > a[data-toggle='tab']").first
21
+
22
+ tab_content = if active_tab
23
+ find('div' + active_tab['href']).find(:xpath, '..')
24
+ end
22
25
 
23
26
  excluding_fields_with_parent(tab_content) { fill_form_fields(fills) }
24
27
 
@@ -365,7 +368,7 @@ module EffectiveTestBotFormFiller
365
368
 
366
369
  # Takes a capybara element
367
370
  def excluding_fields_with_parent(element, &block)
368
- @test_bot_excluded_fields_xpath = element.path
371
+ @test_bot_excluded_fields_xpath = element.try(:path)
369
372
  yield
370
373
  @test_bot_excluded_fields_xpath = nil
371
374
  end
@@ -5,12 +5,12 @@ module RedirectTest
5
5
  protected
6
6
 
7
7
  def test_bot_redirect_test
8
- sign_in(user) and visit(from_path)
8
+ sign_in(user) and visit(from)
9
9
 
10
- assert_redirect(from_path, to_path)
10
+ assert_redirect(from, to)
11
11
  assert_page_normal
12
12
 
13
- #page.save_screenshot("#{from_path.parameterize}.png")
13
+ #page.save_screenshot("#{from.parameterize}.png")
14
14
  end
15
15
 
16
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_test_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-06 00:00:00.000000000 Z
11
+ date: 2016-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails