All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
- Fix email steps not showing the attachments
- Fix uninitialized constant
XPath::HTML
when usingWhen I fill in "..." with "..." inside any "..."
(#210)
- Fix undefined method
irb_at_exit
in new IRB versions (#208)
- Spreewald now explicitly depends on Capybara. We don't expect anyone used it without Capybara in the first place.
- Changes to "the ... field should (not) have (an error|the error ...)" step:
- fixed an edgecases where errors were nested deeper inside a .field_with_errors element
- significant speed-up in most situations
- Make
I should see an element for
andI click on the element for
compatible for Ruby 3.0. (#204)
patiently
retries one more time in certain edge cases where the alloted time was used up within the last retry of thepatiently
block (usually by Capybara).
- Make
When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"$/
compatible for Ruby 3.0.
-
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. -
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.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 ofTest
are ignored:<dt> Test </dt>
Then a mail should have been sent with """ Test """
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:Then a mail should have been sent with """ *Test """
- Add
ActionController::UrlGenerationError
topatiently
's retry errors.- This will solve timing issues when e.g. using step
I should be on ...
after creating a record via AJAX
- This will solve timing issues when e.g. using step
- Fix deprecation warning for
ActiveRecord::Base.default_timezone
when running with Rails 7.0 (#191) - Fix deprecation warning for using keyword arguments as last argument when running with ruby 2.7 (#192)
- Add support for Rails 7.0
- Use capybara's
make_visible
option in stepI attach the file "..." to "..."
- This will make CSS-Hacks like setting the opacity in tests obsolete
- Fix deprecation warning for using keyword arguments as last argument when running with ruby 2.7
- Fix "undefined method
build_rb_world_factory
for nil:NilClass" error when running tests on a real project'- The field error class couldn't be required in certain circumstances and so the specs failed
- Fixes that the
Spreewald.field_error_class
configuration did not find the correct elements
-
Added built-in support for Rails and Bootstrap (3-5) error classes to the steps
The ... field should have the error ...
The ... field should have an error
-
Added the possibility to specify custom error classes and message selectors for these steps using
Spreewald.field_error_class
andSpreewald.error_message_xpath_selector
in your configuration. -
We had separate steps for e.g.
I should see ...
andI should not see ...
. These were merged now:I should see "..."
+I should not see "..."
=>I should( not)? see "..."
I should see /.../
+I should not see /.../
=>I should( not)? see /.../
I should see '...'
+I should not see '...'
=>I should( not)? see '...'
-
Optional negation was made more consistent. The steps use
"( not)? "
now. -
The search via
spreewald some query here
includes steps with optional negation now.
- Fixes the "Show me the email" step (#171)
- Fixes the "I follow the link in the email" step. (#172, #173)
- It works for emails with and without explicit html parts
- There's a better error message if no links are found
- Multiple invocations of console don't raise anymore
- The step
I open .. in a new browser tab
is now using thenoopener
option (see issue #174)
-
New steps:
- When ... inside the ... iframe
-
New steps only available for Capybara 3+:
- When I switch to the ... iframe
- When I switch back to the whole page
- The I switch back to the whole page step does not work reliably with Capybara 2 and lead to StaleReferenceErrors, therefore we decided to not make these steps available for Capybara 2.
-
Small improvements:
- Trying to match against unsupported email headers will raise an error. Supported headers are "To", "CC", "BCC", "From", "Reply-To", "Subject", "Attachments"
- It's now possible to have indented header lines in email steps.
- If there's not an explicit text part in a mail, Spreewald determines if the email body is HTML or plaintext and converts it to plaintext accordingly.
- Dropped support for capybara 1, Ruby 2.1 and Rails 3.2.
- The
an email should have been sent with
step now interprets all lines as body when not specifying headers (see issue #157)
- Introduce wildcard for the beginning of a line. (see issue #155)
- This will allow you to check for a specific sentence inside the body
- Fix deduplication of linebreaks for html mails in mail finder. (see issue #153)
-
The following steps have been removed:
/^the file "([^"]*)" was attached(?: as (?:([^"]*)\/)?([^"]*))? to the ([^"]*) above(?: at "([^"]*)")?$/
(see #106, this functionality was moved to CucumberFactory)/^the "([^"]*)" field should have no error$/
(see #134)/^I should get a text response$/
(see #135)/^I wait for the page to load$/
(see #136)debugger
(was an alias forconsole
)
-
These email steps have been removed in favor of
(an?|no)( HTML| plain-text|) e?mail should have been sent with:
(see #132):/^(an|no) e?mail should have been sent((?: |and|with|from "[^"]+"|bcc "[^"]+"|cc "[^"]+"|to "[^"]+"|the subject "[^"]+"|the body "[^"]+"|the attachments "[^"]+")+)$/
/^that e?mail should( not)? have the following lines in the body$/
/^that e?mail should have the following (?:|content in the )body:$/
-
The
and disabled
modifier of the stepthe "..." checkbox should( not)? be checked
has been removed. Use the step without the modifier together with the stepthe "..." checkbox should be disabled
to achieve the old behavior. -
The step
/^(the tag )?"([^\"]+)" should( not)? be visible$/
lost itsnot
modifier (UseThen (the tag )?"..." should be hidden
orThen I should not see "..."
) -
The file
lib/spreewald/timecop_steps.rb
was removed (was an alias forlib/spreewald/time_steps.rb
). -
The step
(an?|no)( HTML| plain-text|) e?mail should have been sent with:
does now require that the whole body is matched. -
All web steps interacting with forms will now find both enabled and disabled fields. We encourage you to assert the "disabled" state in a separate step when needed, Spreewald offers these steps as well.
The following steps have been adjusted:
I should( not)? see a field "..."
the "..." field should( not)? contain "..."
I should see a form with the following values:
the "..." field should have the error "..."
the "..." field should( not)? have an error
the "..." checkbox should( not)? be checked
"..." should be selected for "..."
nothing should be selected for "..."
"..." should( not)? be an option for "..."
the "..." field should( not)? be visible
the "..." select should( not)? be sorted
- Reintroduced support for emails with CRLF line ending
- The following steps were deprecated and will be removed in the upcoming major version:
- The step
and disabled
modifier of the step/^the "([^"]*)" checkbox should( not)? be checked( and disabled)?$/
has been deprecated.
- The step
an email should have been sent with:
does now support wildcards (*
at the end of a line to ignore the rest of the line,*
as single character in a line to ignore multiple lines). The step also has better error messages if an email could not be found. - The step
show me the emails
got an option to display only the email headers. Additionally, a new stepshow me the email( header)?s with:
has been created to only show a subset of all sent emails, with a syntax similar toan email should have been sent with:
. - The email steps
an email should have been sent (from ...) (to ...) (cc ...) ...
,that email should( not)? have the following lines in the body
andthat email should have the following content in the body:
have been deprecated in favor ofan email should have been sent with:
.
- Add radio buttons to the
the "..." (field|button|checkbox|radio button) should( not)? be disabled
step.
- Fix the step
I follow the ... link in the email
if the email contains non-HTTP(S) links
- Support RFC-compliant encoding of filenames in
Content-Disposition
header (e.g. send_data), as provided by Rails 6.
- Add a step modifier to control different Capybara sessions:
... in the browser session "..."
. (see issue #66)
- The time steps do now work with the time helpers in ActiveSupport 4.1+ if the timecop gem is not included in the bundle. Please note that the two approaches branch. While ActiveSupport will freeze the time, Timecop will keep it running.
- The steps in the file
spreewald/timecop.rb
file were moved tospreewald/time.rb
and importingspreewald/timecop
directly is deprecated now.
- Add a set of steps to control browser tabs (Selenium only):
I open ... in a new browser tab
I close the browser tab
I switch to the new browser tab
I switch to the previous browser tab
I may open a new browser tab
(required for the following step)I should( not)? have opened a new browser tab
there should be (\d+) browser tabs?
there should be at least (\d+) browser tabs?
- Fix the step
I should( not)? see a link labeled "STRING"
, it is now overridable.
- Adapt
I should get a download with filename "..."
step to also work if thefilename
is not the last attribute inContent-Disposition
header.
- Fix "I follow the ... link in the email" step for HTML e-mails to only follow URLs from
<a href="...">
links.
- Deprecate two steps:
- (Given) the file ... was attached to the ... above
- (Then) debugger
- Fix "..." field should have the error "..." test by removing old should syntax
- Add single-line mail step to README
- Fix 'the window should be titled' step - closes: #102
- Support old capybara_screenshot versions which require launchy gem
- Fix
Then the "something" button should be disabled
(see issue #18) - Improve documentation of emails steps
- Clarify step definition of
that e?mail should have the following (?:|content in the )body:
- Refactor the
I should see the (number|amount)
step. (see issues #43 and #44)- It can now be composed with the 'within' step
- It can now truly match negative numbers
- It dropped the hidden dependency on the HTMLEntities gem
- Fix URLs to the GitHub repository of Spreewald as part of the
_path_to
and_selector_for
error handling. (see issue #82)
- Add a new step
I should( not)? see a link labeled "STRING"
. - Refer to Capybara 3's new flag
Capybara.default_normalize_ws = true
in the README,
The I should(not )? see /REGEXP/
step no longer refuses slashes as part of the regular expression. You can thus match full domains and more.
Allow I should(not )? see /REGEXP/
to be composed with the within
step.
Fix `Then I should get a download with filename "..."' step
'Then show me the page' supports capybara-screenshot. (see issue #81)
Mail steps supports both LF and CRLF linebreaks. (see issue #83)
Requires RSpec >= 2.13.0 because we dropped RSpec's should syntax.
The "within" step no longer clashes with the "I should see an element for" and "I click on the element for" steps (Issue #87)
The "it should work" step now takes an optional reason.
The word "within" can now be used in arguments for other steps without causing errors (Issue #53)
Prevent wall of warnings when Then console
is used multiple times in on test run (issue #80)
Always check the current driver by its class (see issue)
- Remove deprecation warnings because of
failure_message_for_should
andfailure_message_for_should_not
- Make Spreewald work without jQuery
- Added CHANGELOG
- Replaced
field_labeled
withfind_field
(https://github.com/teamcapybara/capybara/blob/master/History.md#removed)