spreewald 4.4.2 → 4.4.3

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: 4ce046682ec3812d9b7b5ca4cf7286a44d7e683cdf2d60c259865cc5734bc14b
4
- data.tar.gz: 7d1f7914f2b7621b509ac3fdc60cac9cfc39201760697aa041e9eb96e28c2d5d
3
+ metadata.gz: fafd6c66aa09488c02f829c4b64352d5fc0b8c313cbfcf3da8c8bfc9ef486192
4
+ data.tar.gz: 2839f5ae1583910b595d9df1166cf3a26696d23a7850c444715e0b965b137782
5
5
  SHA512:
6
- metadata.gz: 89a78a3a31b2e46374cc21213b072a4fb36a8cd50d75d752cce156a449af0159e486911d99543bb16af9c5ed0be414f62197e7b51d917e01d80ad2b1c919877b
7
- data.tar.gz: 797a519e0d97151108433d94a6a88ed2615ff2ec4cc0ae0b57079825dc72e98df882fd2d3160214abe0bafd9078c5102fd2513795662f588f74c5866623b99e5
6
+ metadata.gz: e75c55d4e317c6e67fb93f35b0eac0ed1c9aa9bc4b28a6b68f45976734e5e4ad684549052529b2ce3d3fa31e2b3ef2835cbd16da1d91af991b85811e2cfdf2fa
7
+ data.tar.gz: ab32078bf86d139a1ee68f21b27217a780eaad1784cf7dd1cf777a7fb2a4a0ceed42f7bf58e657fde8f1157984858bcd430c0d81e6dce79d51c2e032e9a20036
data/CHANGELOG.md CHANGED
@@ -3,6 +3,32 @@ 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.4.3
7
+ - Improve performance of the `I should (not) see a field ...` step to not retry the query when the element is **not** expected to be there.
8
+ - Improve the `an email should have been sent with` step to ignore successive whitespaces after newlines in HTML mail bodies, effectively improving text matching in formatted HTML-tags.
9
+
10
+ For example, when searching for `Test` inside of the following HTML, you **no longer** need to use asterisks, because the leading whitespaces/tabs in front of `Test` are ignored:
11
+ ```html
12
+ <dt>
13
+ Test
14
+ </dt>
15
+ ```
16
+
17
+ ```Gherkin
18
+ Then a mail should have been sent with
19
+ """
20
+ Test
21
+ """
22
+ ```
23
+
24
+ Up to this version, the plain text was resolved to `\n Test\n` (not `\nTest\n`) so it was necessary to declare a placeholder (`*`) for whitespaces:
25
+ ```Gherkin
26
+ Then a mail should have been sent with
27
+ """
28
+ *Test
29
+ """
30
+ ```
31
+
6
32
  ## 4.4.2
7
33
  - Add `ActionController::UrlGenerationError` to `patiently`'s retry errors.
8
34
  - This will solve timing issues when e.g. using step `I should be on ...` after creating a record via AJAX
data/README.md CHANGED
@@ -25,7 +25,7 @@ Require all Spreewald steps by putting
25
25
  into either your `support/env.rb` or `step_definitions/spreewald_steps.rb`.
26
26
 
27
27
  Steps are grouped into a number of categories. If you only want to use a subset
28
- of Spreewald's steps, insead of `require 'spreewald/all_steps'`, you can pick
28
+ of Spreewald's steps, instead of `require 'spreewald/all_steps'`, you can pick
29
29
  and choose single categories by requiring [single files](https://github.com/makandra/spreewald/tree/master/lib/spreewald) like this:
30
30
 
31
31
  require 'spreewald/email_steps'
@@ -194,17 +194,12 @@ end.overridable
194
194
 
195
195
  # Checks for the existance of an input field (given its id or label)
196
196
  Then /^I should( not)? see a field "([^"]*)"$/ do |negate, name|
197
- expectation = negate ? :not_to : :to
198
- patiently do
199
- begin
200
- # In old Capybaras find returns nil, so we assign it to `field`
201
- field = find_with_disabled(:field, name)
202
- rescue Capybara::ElementNotFound
203
- # In Capybara 0.4+ #find raises an error instead of returning nil
204
- # We must explicitely reset the field variable from a previous patiently iteration
205
- field = nil
197
+ if negate
198
+ expect(page).to have_no_field(name)
199
+ else
200
+ patiently do
201
+ expect(page).to have_field(name, disabled: :all)
206
202
  end
207
- expect(field).send(expectation, be_present)
208
203
  end
209
204
  end.overridable
210
205
 
@@ -36,7 +36,11 @@ module Spreewald
36
36
  end
37
37
 
38
38
  def text_from_html(html)
39
- Nokogiri::HTML(html).at_css('body').text.gsub(/[\r\n]+/, "\n")
39
+ Nokogiri::HTML(html)
40
+ .at_css('body')
41
+ .text
42
+ .gsub(/[\r\n]+/, "\n")
43
+ .gsub(/\n\s+/, "\n")
40
44
  end
41
45
  end
42
46
  end
@@ -1,3 +1,3 @@
1
1
  module Spreewald
2
- VERSION = '4.4.2'
2
+ VERSION = '4.4.3'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (4.4.2)
4
+ spreewald (4.4.3)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -1,6 +1,6 @@
1
1
  <p>
2
- Hello!
2
+ Hello!
3
3
  </p>
4
4
  <p>
5
- Bye!
5
+ Bye!
6
6
  </p>
@@ -362,6 +362,7 @@ Feature: Web steps
362
362
  When I go to "/forms/disabled_elements"
363
363
  Then I should see a field "Enabled field #1"
364
364
  And I should see a field "Disabled field #1"
365
+ But I should not see a field "Non-existing field"
365
366
 
366
367
 
367
368
  Scenario: /^I should( not)? see the (?:number|amount) ([\-\d,\.]+)(?: (.*?))?$/
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.4.2
4
+ version: 4.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-16 00:00:00.000000000 Z
11
+ date: 2022-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -351,7 +351,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
351
351
  - !ruby/object:Gem::Version
352
352
  version: '0'
353
353
  requirements: []
354
- rubygems_version: 3.0.3
354
+ rubygems_version: 3.2.3
355
355
  signing_key:
356
356
  specification_version: 4
357
357
  summary: Collection of useful cucumber steps.