spreewald 4.3.3 → 4.3.6

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: 154442a339318c7f74e490bd7e8783e8abb24820d564b7c52fe6072bfd5cdb2d
4
- data.tar.gz: 2351555ffdd10b049ccf1e06e50b5eee41206d15bf716354337c4effb8464d38
3
+ metadata.gz: 319d2bf7ea1d7a001c53922c7142a1ccad262f3f7da34d48882c2fd9d825c3d6
4
+ data.tar.gz: cbd10a35c3a70400453854840e4fa0b2fe5c0646e9fec8efa9dc7a057eb109e1
5
5
  SHA512:
6
- metadata.gz: 4b4534235a684eaeb0f19b08fd207254c4d3bbf87a2a78cbb34bf04414a5addef88624127abfe3b426a5415d3a517a556be569743248aa098b46c69b7013a59e
7
- data.tar.gz: fe86089babc5374da459a9305097292a5d47943cd0cabf6932bd88768d7447e8e7424fff7b9c4c0de2ebc00c82cc83e54fa89636f120c89e612a6dddf5a8c4d6
6
+ metadata.gz: dc7159b50dde000619bbcf67e7fcc8b3623b3e4a8a3924917368475baf8e1a07c0ab81e412b66ca9b38bf8b4e2a344aa008f8c82a4e6a6726a758d46bd765ab6
7
+ data.tar.gz: aab557914fbde6a4b6affbea66cde6c3a2e325176dd544afc603204cf7800a50a126651ab4aadf48738931cacc1fdd075b3f7c63f43f085f2f923fb77b195ec7
data/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@ 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.6
7
+ - Use capybara's `make_visible` [option](https://github.com/teamcapybara/capybara/blob/0468de5a810aae75ab9de20447e246c5c35473f0/lib/capybara/node/actions.rb#L279) in step `I attach the file "..." to "..."`
8
+ - This will make CSS-Hacks like setting the opacity in tests obsolete
9
+
10
+ ## 4.3.5
11
+ - Fix deprecation warning for using keyword arguments as last argument when running with ruby 2.7
12
+
13
+ ## 4.3.4
14
+ - Fix "undefined method `build_rb_world_factory` for nil:NilClass" error when running tests on a real project'
15
+ - The field error class couldn't be required in certain circumstances and so the specs failed
16
+
6
17
  ## 4.3.3
7
18
  - Fixes that the `Spreewald.field_error_class` configuration
8
19
  did not find the correct elements
@@ -12,7 +23,14 @@ did not find the correct elements
12
23
  - `The ... field should have the error ...`
13
24
  - `The ... field should have an error`
14
25
  - Added the possibility to specify custom error classes and message selectors for these steps
15
- using `Spreewald.field_error_class` and `Spreewald.error_message_xpath_selector` in your configuration.
26
+ using `Spreewald.field_error_class` and `Spreewald.error_message_xpath_selector` in your configuration.
27
+
28
+ - We had separate steps for e.g. `I should see ...` and `I should not see ...`. These were merged now:
29
+ - `I should see "..."` + `I should not see "..."` => `I should( not)? see "..."`
30
+ - `I should see /.../` + `I should not see /.../` => `I should( not)? see /.../`
31
+ - `I should see '...'` + `I should not see '...'` => `I should( not)? see '...'`
32
+ - Optional negation was made more consistent. The steps use `"( not)? "` now.
33
+ - The search via `spreewald some query here` includes steps with optional negation now.
16
34
 
17
35
  ## 4.2.2
18
36
  - Fixes the "Show me the email" step (#171)
data/README.md CHANGED
@@ -4,6 +4,10 @@ Spreewald is a collection of useful steps for cucumber. Feel free to fork.
4
4
 
5
5
  You can find a list of all contained steps at the end of this README.
6
6
 
7
+ ## Supported versions
8
+
9
+ Spreewald is currently tested against and Ruby 2.6.6 and 3.0.0 with Rails 6 and Capybara 3.
10
+
7
11
  ## Installation
8
12
 
9
13
  Add this line to your application's Gemfile:
@@ -12,18 +16,7 @@ Add this line to your application's Gemfile:
12
16
 
13
17
  And then execute:
14
18
 
15
- $ bundle
16
-
17
- Or install it yourself as:
18
-
19
- $ gem install spreewald
20
-
21
-
22
- ## Supported versions
23
-
24
- Spreewald is currently tested against and Ruby 2.6.6 with Rails 6 and Capybara 3.
25
-
26
- ## Usage
19
+ $ bundle install
27
20
 
28
21
  Require all Spreewald steps by putting
29
22
 
@@ -32,19 +25,28 @@ Require all Spreewald steps by putting
32
25
  into either your `support/env.rb` or `step_definitions/spreewald_steps.rb`.
33
26
 
34
27
  Steps are grouped into a number of categories. If you only want to use a subset
35
- of Spreewald's steps, you can pick and choose single categories by requiring
36
- single files like this:
28
+ of Spreewald's steps, insead of `require 'spreewald/all_steps'`, you can pick
29
+ and choose single categories by requiring [single files](https://github.com/makandra/spreewald/tree/master/lib/spreewald) like this:
37
30
 
38
31
  require 'spreewald/email_steps'
39
32
  require 'spreewald/web_steps'
40
33
 
41
- Have a look at our [recommended Capybara defaults](#recommended-capybara-defaults) as they impact the behavior of many Spreewald steps.
34
+ After that you are good to go and use the steps [described below](#steps).
35
+
36
+ ### Recommended additional setup
37
+
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
+ 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
+
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 ...`.
42
+
43
+ We also suggest to look at our [recommended Capybara defaults](#recommended-capybara-defaults) as they impact the behavior of many Spreewald steps.
42
44
 
43
45
  ## Spreewald binary
44
46
 
45
47
  Spreewald comes with a binary that prints a list of all Cucumber steps from
46
48
  Spreewald _and your project_. It will filter the list by any string you
47
- pass it. Example usage:
49
+ pass it. Example usage (e.g. on a linux shell in the root folder of the project which uses Spreewald):
48
50
 
49
51
  ```bash
50
52
  spreewald # lists all steps
@@ -94,7 +96,7 @@ Capybara.default_normalize_ws = true
94
96
 
95
97
  This will affect all Spreewald steps that are using Capybara's `:text` option.
96
98
 
97
- Furthermore, we recommend setting [Capybara's matching strategy](https://github.com/teamcapybara/capybara/blob/master/README.md#strategy) to `:prefer_exact`. This will positively affect Spreewald steps as it prevents the `Capybara::Ambiguous` error in the edge case when two fields are matching the given name, but one of the matches includes the name only as a substring,
99
+ Furthermore, we recommend setting [Capybara's matching strategy](https://github.com/teamcapybara/capybara/blob/master/README.md#strategy) to `:prefer_exact`. This will positively affect Spreewald steps as it prevents the `Capybara::Ambiguous` error in the edge case when two fields are matching the given name, but one of the matches includes the name only as a substring.
98
100
 
99
101
  ```ruby
100
102
  Capybara.match = :prefer_exact
@@ -119,14 +121,11 @@ Spreewald has different kind of tests:
119
121
 
120
122
  Run all tests for your current ruby version with `rake` or `rake matrix:tests`. To bundle use `rake matrix:install` first.
121
123
 
122
- Please note that you need [geordi](https://github.com/makandra/geordi) to run the integration tests.
123
-
124
-
125
124
  ### If you would like to contribute:
126
125
 
127
126
  - Fork the repository
128
127
  - Push your changes with specs
129
- - Make sure `rake` passes
128
+ - Make sure `rake matrix:tests` passes
130
129
  - Regenerate the "Steps" section of this Readme with `rake update_readme`, if needed
131
130
  - Make a pull request
132
131
 
@@ -160,8 +160,11 @@ end.overridable
160
160
 
161
161
  # Attach a file to a file upload form field
162
162
  When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"$/ do |path, field|
163
+ options = {}
164
+ options[:make_visible] = true if javascript_capable?
165
+
163
166
  patiently do
164
- attach_file(field, File.expand_path(path))
167
+ attach_file(field, File.expand_path(path), options)
165
168
  end
166
169
  end.overridable
167
170
 
@@ -486,18 +489,18 @@ end.overridable
486
489
  # Checks for the presence of an option in a select
487
490
  Then /^"([^"]*)" should( not)? be an option for "([^"]*)"$/ do |value, negate, field|
488
491
  finder_arguments = if Spreewald::Comparison.compare_versions(Capybara::VERSION, :<, "2.12")
489
- ['option', { :text => value }]
492
+ { text: value }
490
493
  else
491
- ['option', { :exact_text => value }]
494
+ { exact_text: value }
492
495
  end
493
496
  patiently do
494
497
  if negate
495
498
  begin
496
- expect(find_with_disabled(:field, field)).to have_no_css(*finder_arguments)
499
+ expect(find_with_disabled(:field, field)).to have_no_css('option', **finder_arguments)
497
500
  rescue Capybara::ElementNotFound
498
501
  end
499
502
  else
500
- expect(find_with_disabled(:field, field)).to have_css(*finder_arguments)
503
+ expect(find_with_disabled(:field, field)).to have_css('option', **finder_arguments)
501
504
  end
502
505
  end
503
506
  end.overridable
data/lib/spreewald.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  require 'cucumber_priority'
4
- require "spreewald_support/field_errors"
5
4
  require "spreewald_support/version"
6
5
  require "spreewald_support/github"
7
6
  require "spreewald_support/unsupported_email_header"
@@ -1,3 +1,3 @@
1
1
  module Spreewald
2
- VERSION = '4.3.3'
2
+ VERSION = '4.3.6'
3
3
  end
data/spreewald.gemspec CHANGED
@@ -9,6 +9,7 @@ Gem::Specification.new do |gem|
9
9
  gem.summary = %q{Collection of useful cucumber steps.}
10
10
  gem.homepage = "https://github.com/makandra/spreewald"
11
11
  gem.license = 'MIT'
12
+ gem.metadata = { 'rubygems_mfa_required' => 'true' }
12
13
 
13
14
  gem.files = `git ls-files`.split($\)
14
15
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (4.3.3)
4
+ spreewald (4.3.6)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
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.3.3
4
+ version: 4.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-26 00:00:00.000000000 Z
11
+ date: 2022-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -334,7 +334,8 @@ files:
334
334
  homepage: https://github.com/makandra/spreewald
335
335
  licenses:
336
336
  - MIT
337
- metadata: {}
337
+ metadata:
338
+ rubygems_mfa_required: 'true'
338
339
  post_install_message:
339
340
  rdoc_options: []
340
341
  require_paths: