After reading The cucumber book I decided to add clever cucumber transforms but steps started to fail all over the place … Even completly unrelated scenarios were failing …
I should have read the Cucumber transforms doc page and particularly the “Transforms wisdom” section before anything, it would have been a real time saver. To summarise, when a step is executed, all transforms regexps are tried on the step captures, and the first matching transform is applied ! Inlining the transform global inside the step regex removes duplication, but in no way does it imply which transform will be applied !
1 2 3 4 5 6 7 8
will match the bank name with CAPTURE_NUMBER, and you’ll get an “invalid value for Float” error.