These are chat archives for pjlsergeant/test-bdd-cucumber-perl

3rd
Jul 2017
Yves Lavoie
@ylavoie
Jul 03 2017 04:32
Hi
@pjlsergeant I figured here would be a better place to talk about your ideas for soft-fails
Yves Lavoie
@ylavoie
Jul 03 2017 04:46
I haven't seen any documentation in TBC for Hooks. Are they missing from the language implementation?
Erik Huelsmann
@ehuelsmann
Jul 03 2017 07:42
@ylavoie hooks?
Yves Lavoie
@ylavoie
Jul 03 2017 12:31
Cucumber uses Gherkin and provides a number of Hooks to allow actions to be done before or after a step, a scenario.... See https://github.com/cucumber/cucumber/wiki/Hooks
Peter Sergeant
@pjlsergeant
Jul 03 2017 12:31
Cucumber doesn't really use Gherkin I'm afraid
It should do, but we never got it over the edge
There's some support for Before / After / Transform
If you look in the Calculator examples
Yves Lavoie
@ylavoie
Jul 03 2017 12:33
I will.
Yes there are, in the stepfiles. I was wondering yesterday if we had support directly in the feature files.
Peter Sergeant
@pjlsergeant
Jul 03 2017 12:38
Doesn't @ehuelsmann's plugin architect support that to some degree?
Yves Lavoie
@ylavoie
Jul 03 2017 12:45
Extensions?
Yves Lavoie
@ylavoie
Jul 03 2017 13:29
I also saw that @ehuelsmann was pushing for Gherkin3. Is that still the objective?
Erik Huelsmann
@ehuelsmann
Jul 03 2017 13:37
@ylavoie maybe you should tell us what you're trying to achieve.
I'm not clear what you try to do from the above remarks.
Yves Lavoie
@ylavoie
Jul 03 2017 14:01
Yesterday I was looking for a quick way to hook after a failing step to provide debug statement, print value... No problem, Hooks are there for that in Cucumber and this package is Gherkin compliant... Almost.
Erik Huelsmann
@ehuelsmann
Jul 03 2017 15:23
@ylavoie ok. I didn't know about hooks. Do you have pointers to the Cucumber docs for reference and my orientation?
(just a side-note: Gherkin is the language; Cucumber is the tool)
Erik Huelsmann
@ehuelsmann
Jul 03 2017 15:26
ok. and to what extent do extensions miss to address this?
Yves Lavoie
@ylavoie
Jul 03 2017 15:28
They probably don't. My understanding was that TBC was the Perl implementation of Cucumber and I was expecting that syntax to be valid.
Erik Huelsmann
@ehuelsmann
Jul 03 2017 15:32
which syntax and where did you want to use it?
this:
Before do
  # Do something before each scenario.
end
?
Yves Lavoie
@ylavoie
Jul 03 2017 15:34

In a feature file, something like:
`AfterStep do

Do something after each step.

end`

How do we quote code?
Erik Huelsmann
@ehuelsmann
Jul 03 2017 15:35
that syntax is not meant to be used in the feature file.
it's to be used in the step file.
the syntax is Ruby syntax.
from the header of that page:
Cucumber provides a number of hooks which allow us to run blocks at various points in the Cucumber test cycle. You can put them in your support/env.rb file or any other file under the support directory, for example in a file called support/hooks.rb. There is no association between where the hook is defined and which scenario/step it is run for, but you can use tagged hooks (see below) if you want more fine grained control.
which refers to specific ruby files where you can put these hooks.
but not in the feature files.
Yves Lavoie
@ylavoie
Jul 03 2017 15:37
My bad. So as @pjlsergeant pointed out, there is already support with examples in the calculator for similar.