spreewald 4.3.2 → 4.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/spreewald_support/field_errors.rb +1 -1
- data/lib/spreewald_support/version.rb +1 -1
- data/tests/rails-6_capybara-3/Gemfile.lock +1 -1
- data/tests/rails-6_capybara-3/features/step_definitions/field_error_steps.rb +12 -0
- data/tests/shared/app/controllers/forms_controller.rb +3 -0
- data/tests/shared/app/views/forms/invalid_custom_form.html.haml +19 -0
- data/tests/shared/config/routes.rb +1 -0
- data/tests/shared/features/shared/web_steps.feature +27 -2
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 154442a339318c7f74e490bd7e8783e8abb24820d564b7c52fe6072bfd5cdb2d
|
4
|
+
data.tar.gz: 2351555ffdd10b049ccf1e06e50b5eee41206d15bf716354337c4effb8464d38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b4534235a684eaeb0f19b08fd207254c4d3bbf87a2a78cbb34bf04414a5addef88624127abfe3b426a5415d3a517a556be569743248aa098b46c69b7013a59e
|
7
|
+
data.tar.gz: fe86089babc5374da459a9305097292a5d47943cd0cabf6932bd88768d7447e8e7424fff7b9c4c0de2ebc00c82cc83e54fa89636f120c89e612a6dddf5a8c4d6
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
5
5
|
|
6
|
+
## 4.3.3
|
7
|
+
- Fixes that the `Spreewald.field_error_class` configuration
|
8
|
+
did not find the correct elements
|
9
|
+
|
6
10
|
## 4.3.2
|
7
11
|
- Added built-in support for Rails and Bootstrap (3-5) error classes to the steps
|
8
12
|
- `The ... field should have the error ...`
|
@@ -32,7 +32,7 @@ module Spreewald
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def custom_error?
|
35
|
-
Spreewald.field_error_class && @element.has_xpath?("ancestor-or-self
|
35
|
+
Spreewald.field_error_class && @element.has_xpath?("ancestor-or-self::div[contains(@class, \"#{Spreewald.field_error_class}\")]")
|
36
36
|
end
|
37
37
|
|
38
38
|
def bootstrap3_error?
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Then /^I set the custom field error class to "([^"]+)"$/ do |error_class|
|
2
|
+
Spreewald.field_error_class = error_class
|
3
|
+
end
|
4
|
+
|
5
|
+
Then /^I set the custom error message xpath to "(.+)"$/ do |error_message_xpath|
|
6
|
+
Spreewald.error_message_xpath_selector = error_message_xpath
|
7
|
+
end
|
8
|
+
|
9
|
+
After('@field_errors') do
|
10
|
+
Spreewald.field_error_class = nil
|
11
|
+
Spreewald.error_message_xpath_selector = nil
|
12
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
= form_tag do
|
2
|
+
.form-group.my-error
|
3
|
+
= label_tag 'text_control', 'A'
|
4
|
+
= text_field_tag 'text_control', 'Text control value'
|
5
|
+
%p.my-error-description
|
6
|
+
A is invalid
|
7
|
+
.form-group.my-error
|
8
|
+
= label_tag 'textarea_control_1', 'B'
|
9
|
+
= text_area_tag 'textarea_control_1', "Textarea control line 1\nTextarea control line 2\n"
|
10
|
+
%p.my-error-description
|
11
|
+
B is invalid
|
12
|
+
.form-group.my-error
|
13
|
+
= label_tag 'disabled_control', 'Disabled'
|
14
|
+
= text_field_tag 'disabled_control', "Disabled control value", disabled: true
|
15
|
+
%p.my-error-description
|
16
|
+
Disabled is invalid
|
17
|
+
.form-group
|
18
|
+
= label_tag 'textarea_control_2', 'C'
|
19
|
+
= text_area_tag 'textarea_control_2', "Textarea control line 1\nTextarea control line 2\n"
|
@@ -26,6 +26,7 @@ Rails.application.routes.draw do
|
|
26
26
|
get '/forms/invalid_rails_form', to: 'forms#invalid_rails_form'
|
27
27
|
get '/forms/invalid_bootstrap3_form', to: 'forms#invalid_bootstrap3_form'
|
28
28
|
get '/forms/invalid_bootstrap4_form', to: 'forms#invalid_bootstrap4_form'
|
29
|
+
get '/forms/invalid_custom_form', to: 'forms#invalid_custom_form'
|
29
30
|
|
30
31
|
get '/iframes/iframe_1_content', to: 'iframes#iframe_1_content'
|
31
32
|
get '/iframes/iframe_2_content', to: 'iframes#iframe_2_content'
|
@@ -31,7 +31,7 @@ Feature: Web steps
|
|
31
31
|
"""
|
32
32
|
"""
|
33
33
|
|
34
|
-
@javascript
|
34
|
+
@javascript @field_errors
|
35
35
|
Scenario: /^the "([^\"]*)" field should( not)? have an error$/
|
36
36
|
When I go to "/forms/invalid_rails_form"
|
37
37
|
Then the "A" field should have an error
|
@@ -39,8 +39,27 @@ Feature: Web steps
|
|
39
39
|
Then the "Disabled" field should have an error
|
40
40
|
Then the "C" field should not have an error
|
41
41
|
|
42
|
+
When I go to "/forms/invalid_bootstrap3_form"
|
43
|
+
Then the "A" field should have an error
|
44
|
+
Then the "B" field should have an error
|
45
|
+
Then the "Disabled" field should have an error
|
46
|
+
Then the "C" field should not have an error
|
42
47
|
|
43
|
-
|
48
|
+
When I go to "/forms/invalid_bootstrap4_form"
|
49
|
+
Then the "A" field should have an error
|
50
|
+
Then the "B" field should have an error
|
51
|
+
Then the "Disabled" field should have an error
|
52
|
+
Then the "C" field should not have an error
|
53
|
+
|
54
|
+
When I set the custom field error class to "my-error"
|
55
|
+
And I go to "/forms/invalid_custom_form"
|
56
|
+
Then the "A" field should have an error
|
57
|
+
Then the "B" field should have an error
|
58
|
+
Then the "Disabled" field should have an error
|
59
|
+
Then the "C" field should not have an error
|
60
|
+
|
61
|
+
|
62
|
+
@javascript @field_errors
|
44
63
|
Scenario: /^the "([^"]*)" field should have the error "([^"]*)"$/
|
45
64
|
When I go to "/forms/invalid_rails_form"
|
46
65
|
Then the "A" field should have the error "is invalid"
|
@@ -57,6 +76,12 @@ Feature: Web steps
|
|
57
76
|
Then the "B" field should have the error "is invalid"
|
58
77
|
Then the "Disabled" field should have the error "is invalid"
|
59
78
|
|
79
|
+
When I set the custom field error class to "my-error"
|
80
|
+
And I set the custom error message xpath to "parent::*/child::*[contains(@class, "my-error-description")]"
|
81
|
+
And I go to "/forms/invalid_custom_form"
|
82
|
+
Then the "A" field should have the error "is invalid"
|
83
|
+
Then the "B" field should have the error "is invalid"
|
84
|
+
Then the "Disabled" field should have the error "is invalid"
|
60
85
|
|
61
86
|
Scenario: /^I should see a form with the following values:$/
|
62
87
|
When I go to "/forms/form1"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreewald
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Kraze
|
@@ -232,6 +232,7 @@ files:
|
|
232
232
|
- tests/rails-6_capybara-3/features/overriding.feature
|
233
233
|
- tests/rails-6_capybara-3/features/session_steps.feature
|
234
234
|
- tests/rails-6_capybara-3/features/step_definitions/.gitkeep
|
235
|
+
- tests/rails-6_capybara-3/features/step_definitions/field_error_steps.rb
|
235
236
|
- tests/rails-6_capybara-3/features/step_definitions/overriding_steps.rb
|
236
237
|
- tests/rails-6_capybara-3/features/step_definitions/test_steps.rb
|
237
238
|
- tests/rails-6_capybara-3/features/support/env.rb
|
@@ -265,6 +266,7 @@ files:
|
|
265
266
|
- tests/shared/app/views/forms/form2.html.haml
|
266
267
|
- tests/shared/app/views/forms/invalid_bootstrap3_form.html.haml
|
267
268
|
- tests/shared/app/views/forms/invalid_bootstrap4_form.html.haml
|
269
|
+
- tests/shared/app/views/forms/invalid_custom_form.html.haml
|
268
270
|
- tests/shared/app/views/forms/invalid_rails_form.html.haml
|
269
271
|
- tests/shared/app/views/forms/select_fields.html.haml
|
270
272
|
- tests/shared/app/views/iframes/iframe_1_content.haml
|
@@ -395,6 +397,7 @@ test_files:
|
|
395
397
|
- tests/rails-6_capybara-3/features/overriding.feature
|
396
398
|
- tests/rails-6_capybara-3/features/session_steps.feature
|
397
399
|
- tests/rails-6_capybara-3/features/step_definitions/.gitkeep
|
400
|
+
- tests/rails-6_capybara-3/features/step_definitions/field_error_steps.rb
|
398
401
|
- tests/rails-6_capybara-3/features/step_definitions/overriding_steps.rb
|
399
402
|
- tests/rails-6_capybara-3/features/step_definitions/test_steps.rb
|
400
403
|
- tests/rails-6_capybara-3/features/support/env.rb
|
@@ -428,6 +431,7 @@ test_files:
|
|
428
431
|
- tests/shared/app/views/forms/form2.html.haml
|
429
432
|
- tests/shared/app/views/forms/invalid_bootstrap3_form.html.haml
|
430
433
|
- tests/shared/app/views/forms/invalid_bootstrap4_form.html.haml
|
434
|
+
- tests/shared/app/views/forms/invalid_custom_form.html.haml
|
431
435
|
- tests/shared/app/views/forms/invalid_rails_form.html.haml
|
432
436
|
- tests/shared/app/views/forms/select_fields.html.haml
|
433
437
|
- tests/shared/app/views/iframes/iframe_1_content.haml
|