effective_test_bot 1.1.32 → 1.1.33
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dae0671db7b1a7f8541f4ca3c950ec4a660367481e6651e81de83e5b93f352a6
|
4
|
+
data.tar.gz: a9311759796dac457296380f53b0842342cbd42dd923afc3813ffcb2ad2ec0e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55b346bda670b8f72f699b2bf485a4ff4aefb68d98645dcead6260b08996396ec6ef35610c1beee2d342743f38753bef525d29b0db7664c20b7b4b5edb7f9e5f
|
7
|
+
data.tar.gz: 3b722ca2cbfdfec86b07b1ac1795d3300a834a1123797d91072db785a2446f5212a28fcb73a41efdceae14466e5d96221bcfe67b18239f5620837c94db0f3030
|
@@ -217,6 +217,20 @@ module EffectiveTestBotAssertions
|
|
217
217
|
assert diff.blank?, "(assert_no_email) #{diff.length} unexpected emails delivered: #{diff}"
|
218
218
|
end
|
219
219
|
|
220
|
+
# assert_effective_log { click_on('download.txt') }
|
221
|
+
def assert_effective_log(status: nil)
|
222
|
+
raise('EffectiveLogging is not defined') unless defined?(EffectiveLogging)
|
223
|
+
raise('expected a block') unless block_given?
|
224
|
+
|
225
|
+
logs = (status.present? ? Effective::Log.where(status: status).all : Effective::Log.all)
|
226
|
+
|
227
|
+
before = logs.count
|
228
|
+
yield
|
229
|
+
after = logs.count
|
230
|
+
|
231
|
+
assert (after - before == 1), "(assert_effective_log) Expected one log to have been created"
|
232
|
+
end
|
233
|
+
|
220
234
|
# assert_email :new_user_sign_up
|
221
235
|
# assert_email :new_user_sign_up, to: 'newuser@example.com'
|
222
236
|
# assert_email from: 'admin@example.com'
|
@@ -37,7 +37,7 @@ module EffectiveTestBotFormFiller
|
|
37
37
|
save_test_bot_screenshot
|
38
38
|
|
39
39
|
tab_href = '#' + tab['href'].to_s.split('#').last
|
40
|
-
|
40
|
+
within_if('div' + tab_href) { fill_form_fields(fills) }
|
41
41
|
end
|
42
42
|
|
43
43
|
# If there is no visible submits, go back to the first tab
|
@@ -193,8 +193,23 @@ module EffectiveTestBotFormFiller
|
|
193
193
|
save_test_bot_screenshot
|
194
194
|
end
|
195
195
|
|
196
|
-
if
|
197
|
-
|
196
|
+
if value == :unselect
|
197
|
+
return close_effective_select(field)
|
198
|
+
end
|
199
|
+
|
200
|
+
if field.all('option:enabled', wait: false).length == 0
|
201
|
+
return close_effective_select(field)
|
202
|
+
end
|
203
|
+
|
204
|
+
# Must be some options
|
205
|
+
Array(value).each do |value|
|
206
|
+
option = field.all("option:enabled[value=\"#{value}\"]", wait: false).first
|
207
|
+
option ||= field.all('option:enabled', wait: false).find { |field| field.text == value }
|
208
|
+
|
209
|
+
if option.present?
|
210
|
+
option.select_option
|
211
|
+
else
|
212
|
+
# This will most likely raise an error that it cant be found
|
198
213
|
field.select(value.to_s, match: :first, disabled: false)
|
199
214
|
end
|
200
215
|
end
|
@@ -57,7 +57,7 @@ module EffectiveTestBotTestHelper
|
|
57
57
|
|
58
58
|
# Calls capybara within do .. end if selector is present and bool is true
|
59
59
|
def within_if(selector, bool = true, &block)
|
60
|
-
(selector.
|
60
|
+
(all(selector).length > 0 && bool) ? within(first(selector)) { yield } : yield
|
61
61
|
end
|
62
62
|
|
63
63
|
def within_each(selector, &block)
|
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.33
|
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: 2021-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|