effective_test_bot 1.2.11 → 1.3.0

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: 5a5962e48f7f15a1f1462eb0c29e1feb6b451557b627190c5d789cfe7bfaaab5
4
- data.tar.gz: 0d0745d6d9fa469179d579f24f5bdb0699dd814ed1980e024090b3c8c46535f8
3
+ metadata.gz: 26e683262e1566595e1354fb38ab178e36763c50edf3a6f5d9bca647bd8df76e
4
+ data.tar.gz: 52edb3cf280a5f1ae143e34394ded8fdf5aab19e021ba4bb8c1f2a41d53ffcbf
5
5
  SHA512:
6
- metadata.gz: be710ed13d9985b0b82afe9aa47d51926d8de1468d425929882dd6be0718f74747c178a878f42a98189f2aadaa2bb4c56ac3f9364f0cc1fc9782b080104d30fd
7
- data.tar.gz: b63467149981fde04d4f49ceb8e0d861f88b25815993fbae433ce2a7b305d0cccc695b1452340783a0a3bafd37e762ec796512d7db766c32fe70e1c702661036
6
+ metadata.gz: a68273a9574c1fa18e73a73af64988a1e42889599f6b3389919ea2789d226357def3aa77090cbd87ff2db6650052bc872ac5665f300d942c18628501c425c876
7
+ data.tar.gz: 45a472ed4d6750c0c00d968927a4d864365468e0934062caa4e5c041b3da2209779f320601169f4926ce02c1d3dbb00e08d746862d6112ee68ca6eca9f7f350e
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '1.2.11'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
@@ -84,6 +84,14 @@ module EffectiveTestBotAssertions
84
84
  end
85
85
  end
86
86
 
87
+ def assert_current_path_changed(&block)
88
+ raise('expected a block') unless block_given?
89
+
90
+ before_path = page.current_path
91
+ yield
92
+ assert_no_current_path(before_path)
93
+ end
94
+
87
95
  def assert_page_status(status = 200, message: '(page_status) Expected :status: HTTP status code')
88
96
  return if response_code == nil # This doesn't work well in some drivers
89
97
  assert_equal status, response_code, message.sub(':status:', status.to_s)
@@ -18,16 +18,21 @@ module EffectiveTestBotFormHelper
18
18
  end
19
19
 
20
20
  # This submits the form, while checking for html5 form validation errors and unpermitted params
21
- def submit_form(label = nil, last: false, debug: false)
21
+ def submit_form(label = nil, last: false, assert_path_changed: true, debug: false)
22
22
  assert_no_html5_form_validation_errors unless test_bot_skip?(:no_html5_form_validation_errors)
23
23
  assert_jquery_ujs_disable_with(label) unless test_bot_skip?(:jquery_ujs_disable_with)
24
24
 
25
+ before_path = page.current_path
26
+
25
27
  if test_bot_skip?(:no_unpermitted_params)
26
28
  click_submit(label, last: last, debug: debug)
27
29
  else
28
30
  with_raised_unpermitted_params_exceptions { click_submit(label, last: last, debug: debug) }
29
31
  end
30
32
 
33
+ # This is a blocking selector that will wait until the page has changed url
34
+ assert_no_current_path(before_path) if assert_path_changed
35
+
31
36
  assert_no_assigns_errors unless test_bot_skip?(:no_assigns_errors)
32
37
  assert_no_exceptions unless test_bot_skip?(:exceptions)
33
38
  assert_authorization unless test_bot_skip?(:authorization)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_test_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.11
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect