effective_test_bot 1.2.11 → 1.3.0
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: 26e683262e1566595e1354fb38ab178e36763c50edf3a6f5d9bca647bd8df76e
|
4
|
+
data.tar.gz: 52edb3cf280a5f1ae143e34394ded8fdf5aab19e021ba4bb8c1f2a41d53ffcbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a68273a9574c1fa18e73a73af64988a1e42889599f6b3389919ea2789d226357def3aa77090cbd87ff2db6650052bc872ac5665f300d942c18628501c425c876
|
7
|
+
data.tar.gz: 45a472ed4d6750c0c00d968927a4d864365468e0934062caa4e5c041b3da2209779f320601169f4926ce02c1d3dbb00e08d746862d6112ee68ca6eca9f7f350e
|
@@ -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)
|