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 +4 -4
- data/config/application_system_test_case.rb +23 -0
- data/config/test_helper.rb +1 -2
- data/lib/effective_test_bot/version.rb +1 -1
- data/lib/tasks/effective_test_bot_tasks.rake +21 -14
- data/test/support/effective_test_bot_assertions.rb +1 -1
- data/test/support/effective_test_bot_form_filler.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b617dc9e92a0ca135bb0d149425160036a5fb38b
|
4
|
+
data.tar.gz: eae932d2212b4b4b7ee1e8d466886a2390627752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
|
data/config/test_helper.rb
CHANGED
@@ -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
|
-
|
21
|
-
system("rails #{setup} RAILS_ENV=test")
|
20
|
+
# rails test:bot:seed
|
22
21
|
|
23
22
|
# rails test
|
24
23
|
# rails test:system
|
@@ -1,21 +1,22 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
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
|
-
#
|
9
|
-
#
|
8
|
+
# rails test:bot:tour
|
9
|
+
# rails test:bot:tour TEST=documents#new
|
10
10
|
|
11
|
-
#
|
12
|
-
#
|
11
|
+
# rails test:bot:seed
|
12
|
+
# rails test:bot:environment
|
13
|
+
# rails test:bot:purge
|
13
14
|
|
14
|
-
#
|
15
|
-
#
|
15
|
+
# rails test:bot:tours
|
16
|
+
# rails test:bot:tours TEST=documents
|
16
17
|
|
17
|
-
#
|
18
|
-
#
|
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 #{
|
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
|
|
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.
|
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:
|
11
|
+
date: 2019-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|