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 +4 -4
- data/lib/effective_test_bot/middleware.rb +1 -1
- data/lib/effective_test_bot/version.rb +1 -1
- data/lib/generators/templates/test_helper.rb +4 -0
- data/lib/tasks/effective_test_bot_tasks.rake +2 -1
- data/test/concerns/test_botable/redirect_dsl.rb +1 -1
- data/test/support/effective_test_bot_form_filler.rb +6 -3
- data/test/test_botable/redirect_test.rb +3 -3
- 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: e0878a09914b62c7063ae8e279fcb7c2b91ef822
|
4
|
+
data.tar.gz: 4c10586dd8a4c97330eacc8a3836fd4f1d31f0d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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')
|
@@ -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 =
|
21
|
-
|
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(
|
8
|
+
sign_in(user) and visit(from)
|
9
9
|
|
10
|
-
assert_redirect(
|
10
|
+
assert_redirect(from, to)
|
11
11
|
assert_page_normal
|
12
12
|
|
13
|
-
#page.save_screenshot("#{
|
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.
|
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-
|
11
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|