Spreewald 4.3.3 released

Posted . Visible to the public.

Field error steps

Spreewald's The ... field should have an error and The ... field should have the error ... steps now have built-in support for Rails and Bootstrap (v3-v5) error classes. When using Bootstrap, it is no longer necessary to overwrite the steps in your project.

At the same time, support for formtastic has been removed as there were no real use cases. Due to that, no breaking change was introduced, as the amount of users affected by this should be zero (it was neither in the documentation nor tested).

Users may now add custom error classes and error message xpaths to the Spreewald configuration. This means overriding the step shouldn't be necessary any longer. When dealing with frameworks that decorate your inputs with different error classes, you may set Spreewald.field_error_class accordingly. Providing custom classes also requires an xpath to the element rendering your error hints/messages for the particular field. You may set it using Spreewald.error_message_xpath_selector, starting from the input element as current node.

Given your custom framework uses the error class my-error and renders the validation message in a sibling element with class my-error-description, you may configure it like that:

Spreewald.field_error_class = 'my-error'
Spreewald.error_message_xpath_selector = 'parent::*/child::*[contains(@class, "my-error-description")]'

Optional negation

We had separate steps for e.g. I should see ... and I 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.

Image

Image

Dominic Beger
Last edit
Florian Leinsinger
License
Source code in this card is licensed under the MIT License.
Posted by Dominic Beger to makandra dev (2021-11-26 16:47)