effective_test_bot 0.6.9 → 0.6.10

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
  SHA1:
3
- metadata.gz: 241328a26eabe88003d9952df8c3f52d2c8da2b9
4
- data.tar.gz: d9aaf690438a97cf0469381f8c17766270e7df80
3
+ metadata.gz: bf36cfb023e70353630f201670e7230e2cdef0c6
4
+ data.tar.gz: fdbe2c4e0cbfb833aaf3af1ae707e7cdd50f3b7c
5
5
  SHA512:
6
- metadata.gz: 04eef468622acf70afdc3c6bb2245bf2d4a442db8990a4455b09bff42e7c363a297e7962aaea61de578b634cff444c340a5e05d289a3f5af032144211fe1028a
7
- data.tar.gz: c8dbdd69aa54b95509900019e7d01d28fd830a74202363a17d00a09237f3c2d29f027a357b31200c8b5aebc17bc632ecb878d2d43bc5047a445baa9d7c24e7fc
6
+ metadata.gz: 9bf828b9d81131ea1409b98dbe3dbb2210227dfae1622a0a0d012640dfd235eaa8b99e230f2e13667c6700c2fd6f2f275c0bfaecc5f8a7fbbb3616ca1a85da56
7
+ data.tar.gz: 0cb85446450af6d0adc81a2a99c2eb794aab0f7ab0bc255906a7bf23547c359c022926b8eeb8b4c528bec65ceed2e7d4902a1e6dba1bc4c210b94d9089b9a805
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '0.6.9'.freeze
2
+ VERSION = '0.6.10'.freeze
3
3
  end
@@ -17,14 +17,14 @@ module EffectiveTestBotFormHelper
17
17
  end
18
18
 
19
19
  # This submits the form, while checking for html5 form validation errors and unpermitted params
20
- def submit_form(label = nil, last: false)
20
+ def submit_form(label = nil, last: false, debug: false)
21
21
  assert_no_html5_form_validation_errors unless test_bot_skip?(:no_html5_form_validation_errors)
22
22
  assert_jquery_ujs_disable_with(label) unless test_bot_skip?(:jquery_ujs_disable_with)
23
23
 
24
24
  if test_bot_skip?(:no_unpermitted_params)
25
- click_submit(label, last: last)
25
+ click_submit(label, last: last, debug: debug)
26
26
  else
27
- with_raised_unpermitted_params_exceptions { click_submit(label, last: last) }
27
+ with_raised_unpermitted_params_exceptions { click_submit(label, last: last, debug: debug) }
28
28
  end
29
29
 
30
30
  assert_no_unpermitted_params unless test_bot_skip?(:no_unpermitted_params)
@@ -63,12 +63,13 @@ module EffectiveTestBotFormHelper
63
63
  # This kind of sucks, as we want to simulate mouse movements with the tour
64
64
  # Instead we manually trigger submit buttons and use the data-disable-with to
65
65
  # make the 'submit form' step look nice
66
- def click_submit(label, last: false)
66
+ def click_submit(label, last: false, debug: false)
67
67
  if label.present?
68
68
  submit = find(:link_or_button, label)
69
69
  assert submit.present?, "TestBotError: Unable to find a visible submit link or button on #{page.current_path} with the label #{label}"
70
70
  else
71
- submit = all("input[type='submit'],button[type='submit']").send(last ? :last : :first)
71
+ submit = find("input[type='submit'],button[type='submit']", match: :first)
72
+ submit = all("input[type='submit'],button[type='submit']").last if last
72
73
  assert submit.present?, "TestBotError: Unable to find a visible input[type='submit'] or button[type='submit'] on #{page.current_path}"
73
74
  end
74
75
 
@@ -78,6 +79,10 @@ module EffectiveTestBotFormHelper
78
79
  page.execute_script "$('input[data-disable-with]').each(function(i) { $.rails.enableFormElement($(this)); });"
79
80
  end
80
81
 
82
+ if debug
83
+ puts "Clicking: <#{submit.tag_name} id='#{submit['id']}' class='#{submit['class']}' name='#{submit['name']}' value='#{submit['value']}' />"
84
+ end
85
+
81
86
  submit.click
82
87
  synchronize!
83
88
 
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.9
4
+ version: 0.6.10
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-19 00:00:00.000000000 Z
11
+ date: 2017-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails