effective_test_bot 0.6.7 → 0.6.8
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: addba6a7997e4a369e13125bc2a58ee7daef0e60
|
4
|
+
data.tar.gz: 29f2ed1a40d36625bfb8a010e1a5653abece76f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad4ffb7d07438ce61c84212f199c0539ca027d66f1ffc4a4176e07cbe0276b5b4038b8bdf2befcccd088d551b3d0520a4e9d2afa6039136ed647c4527770426a
|
7
|
+
data.tar.gz: b40772c6a5989f299db717109fa0fe35b402ba7f38dbbcc56bef3c299a6f0f107d14ab0dee887042b7b2324d514592ba6e32cc1f5311a250b7b6930ee9a25d17
|
@@ -78,12 +78,14 @@ module EffectiveTestBotFormFiller
|
|
78
78
|
value = value_for_field(field, fills)
|
79
79
|
ckeditor_text_area?(field) ? fill_ckeditor_text_area(field, value) : field.set(value)
|
80
80
|
when 'select'
|
81
|
+
value = value_for_field(field, fills)
|
82
|
+
|
81
83
|
if EffectiveTestBot.tour_mode_extreme? && field['class'].to_s.include?('select2') # select2
|
82
84
|
page.execute_script("try { $('select##{field['id']}').select2('open'); } catch(e) {};")
|
83
85
|
save_test_bot_screenshot
|
84
86
|
end
|
85
87
|
|
86
|
-
field.select(
|
88
|
+
field.select(value, match: :first) unless value == :unselect
|
87
89
|
|
88
90
|
if EffectiveTestBot.tour_mode_extreme? && field['class'].to_s.include?('select2')
|
89
91
|
page.execute_script("try { $('select##{field['id']}').select2('close'); } catch(e) {};")
|
@@ -101,6 +103,8 @@ module EffectiveTestBotFormFiller
|
|
101
103
|
raise "unsupported field type #{[field.tag_name, field['type']].compact.join('_')}"
|
102
104
|
end
|
103
105
|
|
106
|
+
wait_for_ajax
|
107
|
+
|
104
108
|
if EffectiveTestBot.tour_mode_extreme?
|
105
109
|
save_test_bot_screenshot unless skip_field_screenshot
|
106
110
|
end
|
@@ -125,7 +129,7 @@ module EffectiveTestBotFormFiller
|
|
125
129
|
attributes = field['name'].to_s.gsub(']', '').split('[') # user[something_attributes][last_name] => ['user', 'something_attributes', 'last_name']
|
126
130
|
attribute = attributes.last.to_s
|
127
131
|
|
128
|
-
fill_value = fill_value_for_field(fills, attributes, field['value'])
|
132
|
+
fill_value = fill_value_for_field(fills, attributes, field['value'], field_name)
|
129
133
|
|
130
134
|
# If there is a predefined fill value for this field return it now
|
131
135
|
# except for select, checkbox and radio fields which we want to match by value or label
|
@@ -219,6 +223,8 @@ module EffectiveTestBotFormFiller
|
|
219
223
|
value_for_input_radio_field(field, fill_value)
|
220
224
|
|
221
225
|
when 'select'
|
226
|
+
return fill_value if fill_value == :unselect
|
227
|
+
|
222
228
|
if fill_value.present? # accept a value or text
|
223
229
|
field.all('option:enabled').each do |option|
|
224
230
|
if (option.text == fill_value || option.value.to_s == fill_value)
|
@@ -388,12 +394,14 @@ module EffectiveTestBotFormFiller
|
|
388
394
|
|
389
395
|
private
|
390
396
|
|
391
|
-
def fill_value_for_field(fills, attributes, value)
|
397
|
+
def fill_value_for_field(fills, attributes, value, field_name)
|
392
398
|
return if fills.blank? || (attributes.blank? && value.blank?)
|
393
399
|
|
394
400
|
key = nil
|
395
401
|
attributes.reverse_each do |name| # match last_name, then something_attributes.last_name, then user.something_attributes.last_name
|
396
402
|
key = (key.present? ? "#{name}.#{key}" : name) # builds up the string as we go along
|
403
|
+
|
404
|
+
return :unselect if field_name == 'select' && fills.key?(key) && [nil, ''].include?(fills[key])
|
397
405
|
return fills[key].to_s if fills.key?(key)
|
398
406
|
end
|
399
407
|
|
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.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: 2017-10-
|
11
|
+
date: 2017-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|