spreewald 4.4.1 → 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: 892a8b1fc2985989a10ad303aa6be9a65a4ea3542bea9c5d9311fb0f1463b73a
4
- data.tar.gz: 2031b66e60406bd9205204a6355fc0f745eed30abf3b14095121f9b04290610e
3
+ metadata.gz: fafd6c66aa09488c02f829c4b64352d5fc0b8c313cbfcf3da8c8bfc9ef486192
4
+ data.tar.gz: 2839f5ae1583910b595d9df1166cf3a26696d23a7850c444715e0b965b137782
5
5
  SHA512:
6
- metadata.gz: e7c84b276c5b1cca99a3beac23d656d206ae68cc8f74b17ca3b316b59703249611c226c85d1cc17305faf588e56a1b689d213b916251db4e876c3644c48ee893
7
- data.tar.gz: a61b5d8dd7bf93dca91ea19a69d77de47ddb79b251bacf4ed37b79b1cab91972ea5c2f995d05f9ccf2d83f5a6f37b36882a14ffba178399380da192495a7ac34
6
+ metadata.gz: e75c55d4e317c6e67fb93f35b0eac0ed1c9aa9bc4b28a6b68f45976734e5e4ad684549052529b2ce3d3fa31e2b3ef2835cbd16da1d91af991b85811e2cfdf2fa
7
+ data.tar.gz: ab32078bf86d139a1ee68f21b27217a780eaad1784cf7dd1cf777a7fb2a4a0ceed42f7bf58e657fde8f1157984858bcd430c0d81e6dce79d51c2e032e9a20036
data/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@ 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
+
32
+ ## 4.4.2
33
+ - Add `ActionController::UrlGenerationError` to `patiently`'s retry errors.
34
+ - This will solve timing issues when e.g. using step `I should be on ...` after creating a record via AJAX
35
+
6
36
  ## 4.4.1
7
37
  - Fix deprecation warning for `ActiveRecord::Base.default_timezone` when running with Rails 7.0 ([#191](https://github.com/makandra/spreewald/issues/191))
8
38
  - Fix deprecation warning for using keyword arguments as last argument when running with ruby 2.7 ([#192](https://github.com/makandra/spreewald/issues/192))
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'
@@ -38,7 +38,7 @@ After that you are good to go and use the steps [described below](#steps).
38
38
  We recommend using a `features/support/paths.rb` file in your project to define mappings between verbal phrases and your project's routes. You can then use these phrases in steps like `Then I should be on ...` or `When I go to ...`.
39
39
  You can find [an example in this repository](https://github.com/makandra/spreewald/blob/master/examples/paths.rb). Please note that you may have to adapt it depending on the namespaces and other setup of your application's routes.
40
40
 
41
- Similarly, you may define a `features/support/paths.rb` file in your project to define mappings of verbal phrases to CSS selectors. You can also find [an example for that in this repository](https://github.com/makandra/spreewald/blob/master/examples/selectors.rb). These mappings can be used with steps like `Then I should( not)? see (an|the) element for ...` or `When I click on the element for ...`.
41
+ Similarly, you may define a `features/support/selectors.rb` file in your project to define mappings of verbal phrases to CSS selectors. You can also find [an example for that in this repository](https://github.com/makandra/spreewald/blob/master/examples/selectors.rb). These mappings can be used with steps like `Then I should( not)? see (an|the) element for ...` or `When I click on the element for ...`.
42
42
 
43
43
  We also suggest to look at our [recommended Capybara defaults](#recommended-capybara-defaults) as they impact the behavior of many Spreewald steps.
44
44
 
@@ -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,5 +1,6 @@
1
1
  module ToleranceForSeleniumSyncIssues
2
2
  RETRY_ERRORS = %w[
3
+ ActionController::UrlGenerationError
3
4
  Capybara::ElementNotFound
4
5
  Spec::Expectations::ExpectationNotMetError
5
6
  RSpec::Expectations::ExpectationNotMetError
@@ -1,3 +1,3 @@
1
1
  module Spreewald
2
- VERSION = '4.4.1'
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.0)
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.1
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-06-10 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