effective_test_bot 1.1.27 → 1.1.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61daa7418bb988a24be8c3b3eaac146f74ca9c3ccad737c056b7103680715619
4
- data.tar.gz: 36b02168ad6e92e2bb0b89f1414c9d2cc4a08f61d218a867736524b6bf657b99
3
+ metadata.gz: 5590f0c1b7be5d9eae672f585d6171c64bc9a49a809b7deb63c3cb77c6d26180
4
+ data.tar.gz: bb8d8cea77300a83004d96d206a8f8ed8a11f96b7ddad4b71b71da7179f11f5b
5
5
  SHA512:
6
- metadata.gz: b71181686ea723417243389ba2a87675013bf151a540104b11d6df43f43bf06b1c65b8b347ca6d53d09a31491e69a5d6bd73224ceb83da3f30f6b15eef6d8f45
7
- data.tar.gz: a548eff59b99ad0b3968bd3225a85f3bf5b2e587fc8ab827782092669e521a9f0b3105db006b26d6075838dd43684ebe546048728fd359724ef763d388461845
6
+ metadata.gz: ebe2ca7bff109d9d3a844e734ab1d29112e0c88aca0c9bc7d0efc3324fb2a7c04a3947d90bb160195379d24a9f828aa9bf2483d7f2b8d6744a2da058841023b8
7
+ data.tar.gz: '09d8abd2735e66d95ece47b509022cfed74372faaca8543d7c202eaa602407eb69528ed5dad2178ee5aff2bcc6bca54797897b81395cbf918f823c4c3d721cc4'
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '1.1.27'.freeze
2
+ VERSION = '1.1.28'.freeze
3
3
  end
@@ -126,6 +126,9 @@ module EffectiveTestBotFormFaker
126
126
  when 'textarea', 'textarea_textarea'
127
127
  Faker::Lorem.paragraph
128
128
 
129
+ when 'input_hidden'
130
+ Faker::Lorem.paragraph
131
+
129
132
  when 'input_submit', 'input_search', 'input_button'
130
133
  nil
131
134
 
@@ -115,6 +115,8 @@ module EffectiveTestBotFormFiller
115
115
  fill_input_file(field, value)
116
116
  when 'input_submit', 'input_search', 'input_button'
117
117
  skip_field_screenshot = true # Do nothing
118
+ when 'input_hidden'
119
+ fill_action_text_input(field, value)
118
120
  else
119
121
  raise "unsupported field type #{field_name}"
120
122
  end
@@ -176,6 +178,15 @@ module EffectiveTestBotFormFiller
176
178
  end
177
179
  end
178
180
 
181
+ def fill_action_text_input(field, value)
182
+ return unless action_text_input?(field)
183
+
184
+ trix_id = field['id'].to_s.split('_trix_input_form').first
185
+ return unless trix_id.present?
186
+
187
+ try_script "document.querySelector(\"##{trix_id}\").editor.insertString(\"#{value}\")"
188
+ end
189
+
179
190
  def fill_input_select(field, value)
180
191
  if EffectiveTestBot.tour_mode_extreme? && select2_input?(field)
181
192
  try_script "$('select##{field['id']}').select2('open')"
@@ -276,6 +287,10 @@ module EffectiveTestBotFormFiller
276
287
  (field['class'].to_s.include?('ckeditor') || all("span[id='cke_#{field['id']}']", wait: false).present?)
277
288
  end
278
289
 
290
+ def action_text_input?(field)
291
+ field.tag_name == 'input' && field['type'] == 'hidden' && field['id'].to_s.include?('trix_input_form')
292
+ end
293
+
279
294
  def custom_control_input?(field) # Bootstrap 4 radios and checks
280
295
  field['class'].to_s.include?('custom-control-input')
281
296
  end
@@ -294,16 +309,25 @@ module EffectiveTestBotFormFiller
294
309
 
295
310
  def skip_form_field?(field)
296
311
  field.reload # Handle a field changing visibility/disabled state from previous form field manipulations
297
-
298
312
  field_id = field['id'].to_s
299
313
 
300
- field_id.start_with?('datatable_') ||
301
- field_id.start_with?('filters_scope_') ||
302
- field_id.start_with?('filters_') && field['name'].blank? ||
303
- (field.disabled? rescue true) || # Selenium::WebDriver::Error::StaleElementReferenceError: stale element reference: element is not attached to the page document
304
- (!field.visible? && !ckeditor_text_area?(field) && !custom_control_input?(field) && !file_input?(field)) ||
305
- ['true', true, 1].include?(field['data-test-bot-skip']) ||
306
- (@test_bot_excluded_fields_xpath.present? && field.path.include?(@test_bot_excluded_fields_xpath))
314
+ return true if field_id.start_with?('datatable_')
315
+ return true if field_id.start_with?('filters_scope_')
316
+ return true if field_id.start_with?('filters_') && field['name'].blank?
317
+ return true if field['type'] == 'button'
318
+ return true if (field.disabled? rescue true) # Selenium::WebDriver::Error::StaleElementReferenceError: stale element reference: element is not attached to the page document
319
+ return true if ['true', true, 1].include?(field['data-test-bot-skip'])
320
+ return true if @test_bot_excluded_fields_xpath.present? && field.path.include?(@test_bot_excluded_fields_xpath)
321
+
322
+ if !field.visible?
323
+ return false if ckeditor_text_area?(field)
324
+ return false if custom_control_input?(field)
325
+ return false if file_input?(field)
326
+ return false if action_text_input?(field)
327
+ return true
328
+ end
329
+
330
+ false
307
331
  end
308
332
 
309
333
  def field_key(field)
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.27
4
+ version: 1.1.28
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: 2020-09-21 00:00:00.000000000 Z
11
+ date: 2020-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails