effective_test_bot 1.1.1 → 1.1.2
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/lib/effective_test_bot/version.rb +1 -1
- data/test/support/effective_test_bot_assertions.rb +1 -1
- data/test/support/effective_test_bot_form_faker.rb +1 -1
- data/test/support/effective_test_bot_form_filler.rb +1 -1
- data/test/support/effective_test_bot_form_helper.rb +6 -1
- data/test/support/effective_test_bot_test_helper.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a36dd85a7f66b33cf3fdc0508b65b1770a1422e3a13d894b514adedaec140aa
|
4
|
+
data.tar.gz: 8a0c3fbad9e4e215daeeb8c9dd3e0218a645b4cc279b8ebaf198d3c5f6ac8c3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b650ba5b81172e4a22fc8cc41d195fa909abe04cdf2ccb2488956563f797d16dee3a935e88375302af9d8794867f023bde921672f590b915978dd8b50d68122d
|
7
|
+
data.tar.gz: 77a754437f4d2d614bcf1219eb8de8602b90e695d702a22c58ffe11305304e7581bae115257637876c5fb53e44a1cc36a93ef3acf3d9f39f9294f80568c28618
|
@@ -117,7 +117,7 @@ module EffectiveTestBotAssertions
|
|
117
117
|
end
|
118
118
|
|
119
119
|
def assert_no_js_errors(message: nil, strict: false)
|
120
|
-
error = page.driver.browser.manage.logs.get(:browser).first # headless_chrome
|
120
|
+
error = (page.driver.browser.manage.logs.get(:browser).first rescue '') # headless_chrome
|
121
121
|
|
122
122
|
if strict == false
|
123
123
|
return if error.to_s.include?('Failed to load resource')
|
@@ -45,7 +45,7 @@ module EffectiveTestBotFormFaker
|
|
45
45
|
Faker::Internet.email
|
46
46
|
elsif classes.include?('price') # effective_form_inputs price
|
47
47
|
4.times.map { DIGITS.sample }.join('') + '.00'
|
48
|
-
elsif classes.include?('numeric') || attribute.include?('number')
|
48
|
+
elsif classes.include?('numeric') || classes.include?('effective_number_text') || classes.include?('effective_integer') || attribute.include?('number')
|
49
49
|
min = (Float(field['min']) rescue 1)
|
50
50
|
max = (Float(field['max']) rescue 1000)
|
51
51
|
number = Random.new.rand(min..max)
|
@@ -178,7 +178,7 @@ module EffectiveTestBotFormFiller
|
|
178
178
|
|
179
179
|
if field.all('option:enabled').length > 0 && value != :unselect
|
180
180
|
Array(value).each do |value|
|
181
|
-
field.select(value, match: :first, disabled: false)
|
181
|
+
field.select(value.to_s, match: :first, disabled: false)
|
182
182
|
end
|
183
183
|
end
|
184
184
|
|
@@ -102,6 +102,11 @@ module EffectiveTestBotFormHelper
|
|
102
102
|
end
|
103
103
|
|
104
104
|
submit.click
|
105
|
+
|
106
|
+
if submit['data-confirm']
|
107
|
+
effective_bootstrap_custom_data_confirm? ? submit.click : page.accept_alert
|
108
|
+
end
|
109
|
+
|
105
110
|
synchronize!
|
106
111
|
|
107
112
|
save_test_bot_screenshot if EffectiveTestBot.screenshots? && page.current_path.present?
|
@@ -124,7 +129,7 @@ module EffectiveTestBotFormHelper
|
|
124
129
|
|
125
130
|
assert submit.present?, "TestBotError: Unable to find a visible submit link or button on #{page.current_path} with the label #{label}"
|
126
131
|
else
|
127
|
-
submit = find("input[type='submit'],button[type='submit']", match: :first)
|
132
|
+
submit = (find("input[type='submit'],button[type='submit']", match: :first) rescue nil)
|
128
133
|
submit = all("input[type='submit'],button[type='submit']").last if last
|
129
134
|
assert submit.present?, "TestBotError: Unable to find a visible input[type='submit'] or button[type='submit'] on #{page.current_path}"
|
130
135
|
end
|
@@ -64,10 +64,18 @@ module EffectiveTestBotTestHelper
|
|
64
64
|
all(selector).each { |field| within(field) { yield } }
|
65
65
|
end
|
66
66
|
|
67
|
+
def within_first(selector, &block)
|
68
|
+
Array(all(selector).first).each { |field| within(field) { yield } }
|
69
|
+
end
|
70
|
+
|
67
71
|
def click_first(label)
|
68
72
|
click_link(label, match: :first)
|
69
73
|
end
|
70
74
|
|
75
|
+
def effective_bootstrap_custom_data_confirm?
|
76
|
+
(page.evaluate_script('$.rails.effective_bootstrap_custom_data_confirm') rescue nil) == true
|
77
|
+
end
|
78
|
+
|
71
79
|
# EffectiveTestBot includes an after_filter on ApplicationController to set an http header
|
72
80
|
# These values are 'from the last page submit or refresh'
|
73
81
|
def response_code
|
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.1.
|
4
|
+
version: 1.1.2
|
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: 2019-
|
11
|
+
date: 2019-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|