Read more

Spreewald 0.6.1 makes it easier to inspect form values

Henning Koch
August 22, 2013Software engineer at makandra GmbH

The new version of Spreewald Show archive.org snapshot makes it easier to inspect form values.

Testing the value of any type of input control

  • When the step Then the "foo" field should contain "bar" is applied to a <select>, it now tests against option labels, not option values.
  • This is now consistent with Then "bar" should be selected for "foo".
  • This means you can now use Then the "foo" field should contain "bar" is applied to a <select> for all types of input controls.

Handling of selects with no selected option

  • When testing the value of a <select> and none of its options is selected, we assume the value to be the value of the first option.
  • This is how real browsers behave when the form is submitted.
  • This applies to both Then the "foo" field should contain "bar" and Then "bar" should be selected for "foo".

New step to test the state of an entire form

Illustration book lover

Growing Rails Applications in Practice

Check out our e-book. Learn to structure large Ruby on Rails codebases with the tools you already know and love.

  • Introduce design conventions for controllers and user-facing models
  • Create a system for growth
  • Build applications to last
Read more Show archive.org snapshot

You can now say:

Then I should see a form with the following values:
  | E-mail    | foo@bar.com   |
  | Role      | Administrator |
  | Full name | Foo Bar       |

The step does not yet handle check boxes and radio buttons.

Spreewald has tests!

Just a reminder that we recently added Cucumber features to test Spreewald steps. They're really easy to use! Please add your own tests for steps you add or change.

Posted by Henning Koch to makandra dev (2013-08-22 12:28)