These are chat archives for Behat/Behat

10th
Jun 2016
Mark A Jones
@scopefragger
Jun 10 2016 13:46
hopefully a quick question
we have behat working, with lovely minx
we need to add some custom features while keeping minx
If i add a featureContext file i lose minx capabuilities
im assuming its something realy silly… as everything else in behat is so bloody easy lol
Andrew Kovalyov
@akovalyov
Jun 10 2016 13:50
I believe that once you post a config, it would be easier for anyone to understand your trouble.
Mark A Jones
@scopefragger
Jun 10 2016 13:51
Sure :P What do you want, the .yml ?

'# behat.yml
default:

extensions:
    Behat\MinkExtension\Extension:
        base_url: https://www.footballticketpad.com/
        goutte: ~
        selenium2: ~

calls:
error_reporting: 32759'

FlyLo11
@FlyLo11
Jun 10 2016 14:50
@scopefragger in my behat tests I have class FeatureContext extends MinkContext, this pretty much solves it for me
Mark A Jones
@scopefragger
Jun 10 2016 14:53
ah ;) you are a star
thats so simple i should have knew it
FlyLo11
@FlyLo11
Jun 10 2016 14:54
yeah, this way i can build stuff by reusing whatever mink provides.
Mark A Jones
@scopefragger
Jun 10 2016 15:20
This message was deleted
Victor Sollerhed
@MPV
Jun 10 2016 16:38

Hi.
I know that Behat support ”descriptions” for Features.

But does it also support it for Scenario, Scenario Outline and Examples?
https://cucumber.io/docs/reference#descriptions

Here’s an example:
Scenario: Withdraw cash
  Cash withdrawals only take place in GBP, other currencies won't be considered
  Given the account is in credit
  …
(the line between the Scenario and the Given)
FlyLo11
@FlyLo11
Jun 10 2016 16:44
@MPV quote from that link:
On the lines following a Feature, Scenario, Scenario Outline or Examples you can write anything you like, as long as no line starts witha key a keyword.
Christophe Coevoet
@stof
Jun 10 2016 16:58
@MPV no we don't. Descriptions for scenarios were not supported in gherkin at the time Konstantin ported it to PHP for Behat 1, and we missed the fact that this has been added in the language, meaning our parser does not support it
Ciaran McNulty
@ciaranmcnulty
Jun 10 2016 17:00
@stof I keep meaning to find time to look at the standardised Gherkin parser
FlyLo11
@FlyLo11
Jun 10 2016 17:03
@stof are you sure? it's working just fine for me. as long as the lines don't start with a keyword, they are ignored
Christophe Coevoet
@stof
Jun 10 2016 17:08
@ciaranmcnulty same for me (or at least finding time to try running our parser against their test data)
ah, we might ignore them, dropping them from the AST entirely
but treating them like comments is not the expected behavior AFAIK
FlyLo11
@FlyLo11
Jun 10 2016 17:10
oh, are descriptions more than a comment in the standard implementation?
Ciaran McNulty
@ciaranmcnulty
Jun 10 2016 17:10
they're in the parsed output
FlyLo11
@FlyLo11
Jun 10 2016 17:10
i mean, do they provide any functionality?
Ciaran McNulty
@ciaranmcnulty
Jun 10 2016 17:10
Behat currently uses them for role and feature filters
You can have a suite that only runs features whose description contains 'as a user' for instance
Or in 3.1 a description that matches arbitrary RegEx
Extensions could of course do more - if you can think of something
Christophe Coevoet
@stof
Jun 10 2016 17:37
Behat displays them in the pretty formatter too
while comments are just ignored
And gherkin3 has descriptions on AST nodes, while comments are separate