These are chat archives for Behat/Behat

22nd
Mar 2018
Chris Lock
@catharsisjelly
Mar 22 2018 10:08
@paulgibbs AFAIK it triggers before the Background too
Hi all, I'm having a bit of an issue tryiong to get Behat to register a namespaced context file linking with Symfony 4, if anyone has an example I'd appreciate it
Chuk Shirley
@chukShirley
Mar 22 2018 11:20
Anyone have tips for selecting a DataTables row from within a Mink context class? At first I thought I would just select the element with a css selector and click(), but as the DataTables docs say, "The checkbox is not an <input type="checkbox"> element, but rather a CSS that uses the :before and :after pseudo elements of the cell to draw a box and the tick. "
Chuk Shirley
@chukShirley
Mar 22 2018 12:07
Well, apparently you can just select the surrounding td and click()
Ciaran McNulty
@ciaranmcnulty
Mar 22 2018 16:13
@benplummer wrote scenarios using ubiquitous language and exercise your Application Service / Command Handler layer as well as your UI
Ben Plummer
@benplummer
Mar 22 2018 20:32

@ciaranmcnulty Would you write steps inside FeatureContext.php using Application services that don't exist yet so that they fail first in the usual TDD fashion? And then start building them to fix the Behat scenarios?

Or with Behat, would the TDD equivalent be writing the scenarios without steps in the FeatureContext.php so that they fail but build the Application services etc before writing the Behat steps?

Ciaran McNulty
@ciaranmcnulty
Mar 22 2018 20:34
I step-by-step write the definitions, see them fail, then make them work
Ben Plummer
@benplummer
Mar 22 2018 20:51
@ciaranmcnulty Ah okay - so you write your .feature files and FeatureContext.php step definitions before any code?
Ciaran McNulty
@ciaranmcnulty
Mar 22 2018 20:51
I wrote the feature with others as part of discussing the feature
Then I write one step definition and then code to make it pass, etc
Ben Plummer
@benplummer
Mar 22 2018 20:59
@ciaranmcnulty Thanks, that makes sense. To clarify, when you say about writing one step definition, is that one method in the relevant context file for one of the Given/When/Then lines of the relevant scenario? I'm fairly new to Behat so a little rusty with the terms!
Ciaran McNulty
@ciaranmcnulty
Mar 22 2018 21:00
Yes the method that matches the step
Ben Plummer
@benplummer
Mar 22 2018 21:00
@ciaranmcnulty Great, thanks for the help!
Ciaran McNulty
@ciaranmcnulty
Mar 22 2018 21:00
When I feel I’ve done a few scenarios and worked out the domain model I then look at running some of the scenarios as end to end UI tests
Ben Plummer
@benplummer
Mar 22 2018 21:04
@ciaranmcnulty Ah cool, thanks, I'll take a look. I thought it'd be good to use Behat to note down all of my scenarios first and identify a ubiquitous language as such.