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

1st
Mar 2016
Erik Huelsmann
@ehuelsmann
Mar 01 2016 23:24
@pjlsergeant ledgersmb/LedgerSMB#1374 factors out some steps which I can now use between different groups of features -- into a "step libary" for the LedgerSMB project so to say.
Peter Sergeant
@pjlsergeant
Mar 01 2016 23:27
Instead of C->{stash} you can just use S
Erik Huelsmann
@ehuelsmann
Mar 01 2016 23:29
Yea. It's a remnant of accessing the wrong object elsewhere (setting values in the feature stash instead of in the stash)
I'll clean it up once merged.
Peter Sergeant
@pjlsergeant
Mar 01 2016 23:29
Fair enough :-)
Erik Huelsmann
@ehuelsmann
Mar 01 2016 23:30
there's another extension in progress locally which would be used to create a browser driver session for browser-based tests
Peter Sergeant
@pjlsergeant
Mar 01 2016 23:30
I wonder if allowing you to provide a context class
Or something would be useful
get_driver(C)-> etc
Wonder if pherkin could provide something to streamline that a little
Erik Huelsmann
@ehuelsmann
Mar 01 2016 23:32
you mean so that the context can be "my" class, which then must be a derivative of StepContext?
or do you want to make StepContext into a role?
I thought about C->driver, indeed.
I think it helps to have that.
Peter Sergeant
@pjlsergeant
Mar 01 2016 23:34
I meant the former, but it's a 06:30am sort of thought ;-)
Erik Huelsmann
@ehuelsmann
Mar 01 2016 23:34
Behat allows to specify a context class (or even a context class factory)
Peter Sergeant
@pjlsergeant
Mar 01 2016 23:34
That would also allow you to write convenience methods to unpack items from the stash nicely
And set for that matter
Erik Huelsmann
@ehuelsmann
Mar 01 2016 23:35
right.
Peter Sergeant
@pjlsergeant
Mar 01 2016 23:35
Yeah, that should be easy enough to add
I wonder if a factory that gets passed the context object, or allowing a class name is the better choice
Or, I guess, bith
Both
Erik Huelsmann
@ehuelsmann
Mar 01 2016 23:36
I think it would clean up my code nicely.
(to have setters and getters)
Peter Sergeant
@pjlsergeant
Mar 01 2016 23:37
The very half-formed fantasy I have is that one day steps map just directly to methods
I have some long flights today, maybe I'll get a chance then
Erik Huelsmann
@ehuelsmann
Mar 01 2016 23:44
ok. enjoy your day. it's 0:43 here now. I'll sign off for the night.
I'm pretty happy with what's there now. One thought that I had is that we could maybe provide a test-runner like your 900-cucumber.t
but not one that people need to copy to every project,
but one that will respect the t/.pherkin.yml config, adjusts @INC and loads the extensions and their steps
Peter Sergeant
@pjlsergeant
Mar 01 2016 23:47
I wonder how you would distribute
You could have a bin or just a module
Erik Huelsmann
@ehuelsmann
Mar 01 2016 23:47
as a class of Test::BDD::Cucumber, with a simple "execute" or "run" method.
yea.
Peter Sergeant
@pjlsergeant
Mar 01 2016 23:48
Maybe just a switch to pherkin
There's a big hairy warning about not using it to run tests
But ... why not?
Have a switch that enables Test::Builder then all that other stufd
Erik Huelsmann
@ehuelsmann
Mar 01 2016 23:50
actually, I use pherkin for development of my tests and then I check if 'make test' still works
then it gets pushed to the central repo
if we can run App::pherkin()
but simply not provide any "command line" arguments
and have Test::Builder output
then, sure, why not use pherkin to drive tests?
Erik Huelsmann
@ehuelsmann
Mar 01 2016 23:55
(it would be nice to be able to provide multiple feature directories in that case; that's what I do in our 66-cucumber.t file)
anyway: night!
Peter Sergeant
@pjlsergeant
Mar 01 2016 23:59
night night