Read more

Spreewald 4.3.3 released

Dominic Beger
November 26, 2021Software engineer at makandra GmbH

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.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

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

Posted by Dominic Beger to makandra dev (2021-11-26 17:47)