effective_test_bot 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/test_helper.rb +12 -11
- data/lib/effective_test_bot/version.rb +1 -1
- data/test/support/effective_test_bot_form_filler.rb +3 -3
- data/test/test_botable/crud_test.rb +0 -2
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98ff82d111899f6b06e58b2fe1c919bd5a84fa50
|
4
|
+
data.tar.gz: 07f8530ea45f135e2cc7a94f8d6999805daf6733
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93aed79f3755265be9352fe7b1b4f831381bd9d0a7c5b59d1025858fd438fc04db156cb5757c99e875dff7d862ca16a386a5cbd87ccf834cb20e966aa75a9188
|
7
|
+
data.tar.gz: c3aaecd68a094471c26be28298b5aad53eb88e22fc0da5437627f0726d7689dc365d8f68fb03fd26f5bdcb002fb15b6d6d20a304a7628707c9bf08ea32fbf788
|
data/config/test_helper.rb
CHANGED
@@ -11,7 +11,7 @@ require 'capybara/webkit'
|
|
11
11
|
require 'capybara-screenshot/minitest'
|
12
12
|
require 'capybara/slow_finder_errors'
|
13
13
|
|
14
|
-
require 'database_cleaner'
|
14
|
+
# require 'database_cleaner'
|
15
15
|
|
16
16
|
class ActiveSupport::TestCase
|
17
17
|
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
@@ -28,16 +28,17 @@ class Capybara::Rails::TestCase
|
|
28
28
|
|
29
29
|
include EffectiveTestBot::DSL
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
31
|
+
# Needed for Rails < 5.1
|
32
|
+
# def after_setup
|
33
|
+
# super()
|
34
|
+
# DatabaseCleaner.start
|
35
|
+
# end
|
36
|
+
|
37
|
+
# def after_teardown
|
38
|
+
# super()
|
39
|
+
# DatabaseCleaner.clean
|
40
|
+
# Capybara.reset_sessions! # Some apps seem to need this to correctly reset the test_06:_capybara_can_sign_in
|
41
|
+
# end
|
41
42
|
end
|
42
43
|
|
43
44
|
Capybara.default_driver = :webkit
|
@@ -138,13 +138,13 @@ module EffectiveTestBotFormFiller
|
|
138
138
|
classes = field['class'].to_s.split(' ')
|
139
139
|
|
140
140
|
if classes.include?('date') # Let's assume this is a date input.
|
141
|
-
if attribute.include?('end') # Make sure end dates are after start dates
|
141
|
+
if attribute.include?('end') || attribute.include?('expire') # Make sure end dates are after start dates
|
142
142
|
Faker::Date.forward(365).strftime('%Y-%m-%d')
|
143
143
|
else
|
144
144
|
Faker::Date.backward(365).strftime('%Y-%m-%d')
|
145
145
|
end
|
146
146
|
elsif classes.include?('datetime')
|
147
|
-
if attribute.include?('end')
|
147
|
+
if attribute.include?('end') || attribute.include?('expire')
|
148
148
|
Faker::Date.forward(365).strftime('%Y-%m-%d %H:%m')
|
149
149
|
else
|
150
150
|
Faker::Date.backward(365).strftime('%Y-%m-%d %H:%m')
|
@@ -155,7 +155,7 @@ module EffectiveTestBotFormFiller
|
|
155
155
|
Faker::Internet.email
|
156
156
|
elsif classes.include?('price') # effective_form_inputs price
|
157
157
|
4.times.map { DIGITS.sample }.join('') + '.00'
|
158
|
-
elsif classes.include?('numeric')
|
158
|
+
elsif classes.include?('numeric') || attribute.include?('number')
|
159
159
|
min = (Float(field['min']) rescue 1)
|
160
160
|
max = (Float(field['max']) rescue 1000)
|
161
161
|
number = Random.new.rand(min..max)
|
@@ -98,7 +98,6 @@ module CrudTest
|
|
98
98
|
assert_no_assigns_errors(resource_name) unless test_bot_skip?(:no_assigns_errors)
|
99
99
|
|
100
100
|
refute_equal(before[:count], after[:count], "Expected fill_form to create a #{resource_class} object") if resource_class.respond_to?(:count)
|
101
|
-
refute_equal(before[:path], after[:path], "(path) Expected unique before and after paths") unless test_bot_skip?(:path)
|
102
101
|
end
|
103
102
|
|
104
103
|
def test_bot_show_test
|
@@ -218,7 +217,6 @@ module CrudTest
|
|
218
217
|
# So we just assert the 200 status code, and page title present manually
|
219
218
|
# Javascript errors cannot be detected
|
220
219
|
|
221
|
-
puts 'test_bot_destroy_test failed to find_or_create_rails_ujs_link_to_delete Falling back to selenium DELETE request.'
|
222
220
|
visit_delete(resource_path(resource), user)
|
223
221
|
assert_equal(200, @visit_delete_page.try(:status_code), '(page_status) Expected 200 HTTP status code') unless test_bot_skip?(:page_status)
|
224
222
|
assert((@visit_delete_page.find(:xpath, '//title', visible: false) rescue nil).present?, '(page_title) Expected page title to be present') unless test_bot_skip?(:page_title)
|
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.6.
|
4
|
+
version: 0.6.6
|
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: 2017-
|
11
|
+
date: 2017-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -178,20 +178,6 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: database_cleaner
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - ">="
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '0'
|
188
|
-
type: :runtime
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - ">="
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '0'
|
195
181
|
- !ruby/object:Gem::Dependency
|
196
182
|
name: rmagick
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|