spreewald 4.6.1 → 4.6.2

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: 256b5e48d9fcbb9c845bc5f8503475a10184d2356f5483307100b43c7ae1a504
4
- data.tar.gz: 9374a61e063de94a0b240b24c8f48b292f95d87adc285b9893b3bc2a3d725c2d
3
+ metadata.gz: a8b36c0e7f58e2fdc53690d9bed5690077215e16f874cf953d04e3bc96eb6ad5
4
+ data.tar.gz: 5be73a131b725ed532f318f8dc373f2758b29620ad11a4e83154ba068b754a5f
5
5
  SHA512:
6
- metadata.gz: 934b5123e15812171d3d3dd1cf9f477024ac8f217b612ac85d6cf165afbd535fb2fd052755e52d389804c1f2b4222bce2c59259dfea1af771d367352e6d1baa8
7
- data.tar.gz: 837aa75e2071c48ccca0855746d86c1f4a205be84d15ba8a4c569036f56f51fb940700c1cdf362f253a66acb96b29e467e9353255ec6244501ce9cff1c9df6a8
6
+ metadata.gz: c0ccd9c02ae206858b788f96d8a5a79144046e64cc8164e577fd81c4b02e1eccb94fd241295ddb29827374115c83d072b24e2818d3aea0c42685ec907dd874e7
7
+ data.tar.gz: a8ecc4aff210a281a7e077ea6e7c9200ab402ce5e2171db3e9c4dee251adad36f834227f5d70c27ace7f697df1dc71b40556e5ef6fbed2b7e9e3bc2eb1805d3f
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@ 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.6.2
7
+ - Fix uninitialized constant `XPath::HTML` when using `When I fill in "..." with "..." inside any "..."` ([#210](https://github.com/makandra/spreewald/issues/210))
8
+
6
9
  ## 4.6.1
7
10
  - Fix undefined method `irb_at_exit` in new IRB versions ([#208](https://github.com/makandra/spreewald/pull/208))
8
11
 
data/Gemfile.ruby266.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spreewald (4.6.1)
4
+ spreewald (4.6.2)
5
5
  capybara
6
6
  cucumber
7
7
  cucumber_priority (>= 0.3.0)
data/Gemfile.ruby320.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spreewald (4.6.1)
4
+ spreewald (4.6.2)
5
5
  capybara
6
6
  cucumber
7
7
  cucumber_priority (>= 0.3.0)
data/README.md CHANGED
@@ -211,6 +211,10 @@ the step definitions.
211
211
 
212
212
  ### email_steps.rb
213
213
 
214
+ When specifying the `to`, `cc`, `bcc`, `from` or `reply_to` targets within email steps, you can either specify email addresses or any arbitrary identifier. When an identifier (other than an email address) is given, Spreewald can try to use this information to determine the associated user and gather its email address automatically over the application's `User` model. For this, you may set `Spreewald::MailFinder.user_identity` to an attribute name and Spreewald will call `User.find_by_<user_identity>(identifier)` and then use the `email` of the found user.<br/>
215
+
216
+ For example, if you set `reply_to` to the name `John Doe` within a scenario step and specify `Spreewald::MailFinder.user_identity = 'name'`, Spreewald will call `User.find_by_name('John Doe')`, find the according user with this name and expect its email address as `reply_to`.
217
+
214
218
  * **When I clear my e?mails**
215
219
 
216
220
 
@@ -568,7 +572,11 @@ deprecation notice. Decide for yourself whether you want to use them:
568
572
 
569
573
  * **Then the "..." field should have the error "..."**
570
574
 
571
- Checks that an input field was wrapped with a validation error
575
+ Checks that an input field was wrapped with a validation error. This is done by checking for different error HTML structures that display errors.<br/><br/>
576
+
577
+ Spreewald first checks for custom error wrappers (if specified), then Boostrap 3 error wrappers (`.form-group.has-error`), then Bootstrap 4/5 error wrappers (`:invalid` or `is-invalid`) and lastly, Rails error wrappers (`field_with_errors`). You are able to specify a custom error wrapper by setting `Spreewald.field_error_class = 'my-custom-error-class'` which is then used to look for the error class on the current or any ancestor `div`.<br /><br />
578
+
579
+ The same principle applies for matching the error message. First, it will look for the message text (starting from the input element) with a custom XPath (if specified), then one targeting a sibling element with a `help-block` class for Bootstrap 3 and then one targeting a sibling element with an `invalid-feedback` class for Bootstrap 4/5. Rails errors are checked specifically over the field title as this one contains the error message. You may specify the custom XPath by setting (e.g.) `Spreewald.error_message_xpath_selector = 'parent::*/child::*[@class="my-error-message"]'`.
572
580
 
573
581
 
574
582
  * **Then the "..." field should( not)? have an error**
@@ -620,7 +620,9 @@ When /^I fill in "([^"]*)" with "([^"]*)" inside any "([^"]*)"$/ do |field, valu
620
620
  containers = all(:css, selector)
621
621
  input = nil
622
622
  containers.detect do |container|
623
- input = container.first(:xpath, XPath::HTML.fillable_field(field))
623
+ input = container.first(:fillable_field, field)
624
+ rescue Capybara::ElementNotFound
625
+ # Capybara changed the behavior of #first and raises an error when the first container finds no matching field
624
626
  end
625
627
  if input
626
628
  input.set(value)
@@ -1,3 +1,3 @@
1
1
  module Spreewald
2
- VERSION = '4.6.1'
2
+ VERSION = '4.6.2'
3
3
  end
@@ -1 +1 @@
1
- 3.0.0
1
+ 3.2.0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (4.6.1)
4
+ spreewald (4.6.2)
5
5
  capybara
6
6
  cucumber
7
7
  cucumber_priority (>= 0.3.0)
@@ -12,6 +12,9 @@ class FormsController < ApplicationController
12
12
  def form2
13
13
  end
14
14
 
15
+ def form_with_two_inputs_in_separate_css_blocks_with_the_same_selector
16
+ end
17
+
15
18
  def select_fields
16
19
  end
17
20
 
@@ -0,0 +1,8 @@
1
+ = form_tag do
2
+ .my-container
3
+ = label_tag 'first_text_field', 'First Text field'
4
+ = text_field_tag 'first_text_field', 'First value'
5
+
6
+ .my-container
7
+ = label_tag 'second_text_field', 'Second Text field'
8
+ = text_field_tag 'second_text_field', 'Second value'
@@ -22,6 +22,7 @@ Rails.application.routes.draw do
22
22
  get '/forms/disabled_elements', to: 'forms#disabled_elements'
23
23
  get '/forms/form1', to: 'forms#form1'
24
24
  get '/forms/form2', to: 'forms#form2'
25
+ get '/forms/form_with_two_inputs_in_separate_css_blocks_with_the_same_selector', to: 'forms#form_with_two_inputs_in_separate_css_blocks_with_the_same_selector'
25
26
  get '/forms/select_fields', to: 'forms#select_fields'
26
27
  get '/forms/invalid_rails_form', to: 'forms#invalid_rails_form'
27
28
  get '/forms/invalid_bootstrap3_form', to: 'forms#invalid_bootstrap3_form'
@@ -416,3 +416,13 @@ Feature: Web steps
416
416
  Scenario: /^the window should be titled "([^"]*)"$/
417
417
  When I go to "/static_pages/home"
418
418
  Then the window should be titled "spreewald test application"
419
+
420
+
421
+ Scenario: I fill in "..." with "..." inside any "..."
422
+ When I go to "/forms/form_with_two_inputs_in_separate_css_blocks_with_the_same_selector"
423
+ Then the "First Text field" field should contain "First value"
424
+ And the "Second Text field" field should contain "Second value"
425
+
426
+ When I fill in "Second Text field" with "My new value" inside any ".my-container"
427
+ Then the "First Text field" field should contain "First value"
428
+ And the "Second Text field" field should contain "My new value"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreewald
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.1
4
+ version: 4.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-25 00:00:00.000000000 Z
11
+ date: 2024-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -225,6 +225,7 @@ files:
225
225
  - tests/shared/app/views/forms/disabled_elements.html.haml
226
226
  - tests/shared/app/views/forms/form1.html.haml
227
227
  - tests/shared/app/views/forms/form2.html.haml
228
+ - tests/shared/app/views/forms/form_with_two_inputs_in_separate_css_blocks_with_the_same_selector.html.haml
228
229
  - tests/shared/app/views/forms/invalid_bootstrap3_form.html.haml
229
230
  - tests/shared/app/views/forms/invalid_bootstrap4_form.html.haml
230
231
  - tests/shared/app/views/forms/invalid_custom_form.html.haml
@@ -315,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
315
316
  - !ruby/object:Gem::Version
316
317
  version: '0'
317
318
  requirements: []
318
- rubygems_version: 3.4.20
319
+ rubygems_version: 3.4.1
319
320
  signing_key:
320
321
  specification_version: 4
321
322
  summary: Collection of useful cucumber steps.
@@ -394,6 +395,7 @@ test_files:
394
395
  - tests/shared/app/views/forms/disabled_elements.html.haml
395
396
  - tests/shared/app/views/forms/form1.html.haml
396
397
  - tests/shared/app/views/forms/form2.html.haml
398
+ - tests/shared/app/views/forms/form_with_two_inputs_in_separate_css_blocks_with_the_same_selector.html.haml
397
399
  - tests/shared/app/views/forms/invalid_bootstrap3_form.html.haml
398
400
  - tests/shared/app/views/forms/invalid_bootstrap4_form.html.haml
399
401
  - tests/shared/app/views/forms/invalid_custom_form.html.haml