effective_test_bot 1.0.7 → 1.0.8

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: f43132678f4b743ae57aea8bda8d3e087098968c
4
- data.tar.gz: 6f64e5d26bdb05740901d7ee28587af5f301d90e
3
+ metadata.gz: b617dc9e92a0ca135bb0d149425160036a5fb38b
4
+ data.tar.gz: eae932d2212b4b4b7ee1e8d466886a2390627752
5
5
  SHA512:
6
- metadata.gz: 75b9ee5e765f952e0c296c93d1908c11daa6317adee68d6720e58842f3cfe0878478c43b356ea74466f0e1cf024971030827513c919f1d97fdfc6a3095097133
7
- data.tar.gz: 76e48eda6af48a3cb9ec08087ed11f1a2fcd270918807e756e89509491e0b24174c310aa8250fe7a6bcd5636fc97196a755b37294c23753a781fb6802b4d7fe4
6
+ metadata.gz: f989ddf451607d749d15d92a8b176406aa14cd2fa5fe51a4bbea8fdb77340e6c8d176c37ad8249c82b5896427001f19aef6c07abe8e6513a9989c4f75c85733e
7
+ data.tar.gz: 9dc424026be148749ed9da6787de2f184cd8209290cbfc4bc641640ea4de6c85771336fd659dcb735a1c96a8c32a6bdf4668b6ce40e450574fab6c6cb03fc78b
@@ -17,3 +17,26 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
17
17
  include Warden::Test::Helpers if defined?(Devise)
18
18
  include EffectiveTestBot::DSL
19
19
  end
20
+
21
+ # "Connection not rolling back" snippets
22
+ # These are some snippets that the internet has collected to fix test threading issues.
23
+ # They are unneeded with effective_test_bot. On my machine. But I leave them here as a reference.
24
+ # Try one or both if you are having issues passing rake test:bot:environment
25
+
26
+ # class ActiveRecord::Base
27
+ # mattr_accessor :shared_connection
28
+ # @@shared_connection = nil
29
+
30
+ # def self.connection
31
+ # @@shared_connection || retrieve_connection
32
+ # end
33
+ # end
34
+ # ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
35
+
36
+ # ActiveRecord::ConnectionAdapters::ConnectionPool.class_eval do
37
+ # def current_connection_id
38
+ # Thread.main.object_id
39
+ # end
40
+ # end
41
+
42
+
@@ -17,8 +17,7 @@ Rails.backtrace_cleaner.remove_silencers!
17
17
  Rails.backtrace_cleaner.add_silencer { |line| line =~ /minitest/ }
18
18
  #Rails.backtrace_cleaner.add_silencer { |line| line =~ /effective_test_bot/ }
19
19
 
20
- setup = ['db:schema:load', 'db:fixtures:load', 'db:seed', 'test:load_fixture_seeds'].join(' ')
21
- system("rails #{setup} RAILS_ENV=test")
20
+ # rails test:bot:seed
22
21
 
23
22
  # rails test
24
23
  # rails test:system
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '1.0.7'.freeze
2
+ VERSION = '1.0.8'.freeze
3
3
  end
@@ -1,21 +1,22 @@
1
- # rake test:bot
2
- # rake test:bot TEST=documents#new
3
- # rake test:bot TEST=documents#new,documents#show
4
- # rake test:bot TOUR=true
5
- # rake test:bot TOUR=verbose # Prints out the animated gif patch after test is run
6
- # rake test:bot TOUR=extreme # Makes a whole bunch of extra screenshots
1
+ # rails test:bot
2
+ # rails test:bot TEST=documents#new
3
+ # rails test:bot TEST=documents#new,documents#show
4
+ # rails test:bot TOUR=true
5
+ # rails test:bot TOUR=verbose # Prints out the animated gif patch after test is run
6
+ # rails test:bot TOUR=extreme # Makes a whole bunch of extra screenshots
7
7
 
8
- # rake test:bot:tour
9
- # rake test:bot:tour TEST=documents#new
8
+ # rails test:bot:tour
9
+ # rails test:bot:tour TEST=documents#new
10
10
 
11
- # rake test:bot:environment
12
- # rake test:bot:purge
11
+ # rails test:bot:seed
12
+ # rails test:bot:environment
13
+ # rails test:bot:purge
13
14
 
14
- # rake test:bot:tours
15
- # rake test:bot:tours TEST=documents
15
+ # rails test:bot:tours
16
+ # rails test:bot:tours TEST=documents
16
17
 
17
- # rake test:tour # Not the bot, just regular minitest 'rake test'
18
- # rake test:tourv
18
+ # rails test:tour # Not the bot, just regular minitest 'rails test'
19
+ # rails test:tourv
19
20
 
20
21
  namespace :test do
21
22
  desc 'Runs the effective_test_bot automated test suite'
@@ -46,6 +47,12 @@ namespace :test do
46
47
  system("rails test #{File.dirname(__FILE__)}/../../test/test_bot/system/environment_test.rb")
47
48
  end
48
49
 
50
+ desc 'Rebuilds the database from schema and runs seeds'
51
+ task :seed do
52
+ setup = ['db:schema:load', 'db:fixtures:load', 'db:seed', 'test:load_fixture_seeds'].join(' ')
53
+ system("rails #{setup} RAILS_ENV=test")
54
+ end
55
+
49
56
  desc 'Deletes all effective_test_bot temporary, failure and tour screenshots'
50
57
  task :purge do
51
58
  FileUtils.rm_rf(Rails.root + 'test/tours')
@@ -72,7 +72,7 @@ module EffectiveTestBotAssertions
72
72
  info = [
73
73
  "Encountered a 403 Access Denied",
74
74
  ("(cannot :#{exception[:action]}, #{exception[:subject]})" if exception.present?),
75
- "on #{page.current_path} as user #{user || 'no user'}.",
75
+ "on #{page.current_path} as user #{current_user || 'no user'}.",
76
76
  ("\nAdd assign_test_bot_access_denied_exception(exception) if defined?(EffectiveTestBot) to the very bottom of your ApplicationController's rescue_from block to gather more information." unless exception.present?),
77
77
  ].compact.join(' ')
78
78
 
@@ -19,7 +19,7 @@ module EffectiveTestBotFormFiller
19
19
 
20
20
  active_tab = all("li.active > a[data-toggle='tab']").first
21
21
 
22
- tab_content = if active_tab
22
+ tab_content = if active_tab && active_tab['href'].present?
23
23
  find('div' + active_tab['href']).find(:xpath, '..')
24
24
  end
25
25
 
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: 1.0.7
4
+ version: 1.0.8
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: 2018-08-13 00:00:00.000000000 Z
11
+ date: 2019-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails