These are chat archives for Behat/Behat

24th
Oct 2017
gvanduijn
@gvanduijn
Oct 24 2017 06:06
@panos5 sorry for the late answer, but ja. I building something that I don't know whats in the FeatureContext. So it's possible that are a lot of the same functions. But my project that's possible, but don't know if that's possible for Behat
gvanduijn
@gvanduijn
Oct 24 2017 08:26
@panos5 did you know an solution for this problem?
panos5
@panos5
Oct 24 2017 08:55
i don't really get what d y mean by "I don't know what is in the featureContext".You don;t have access?However, you shouldn't have duplicated functions in the same file.
gvanduijn
@gvanduijn
Oct 24 2017 08:56
No I have multiple ContextFiles
Also defined in my suite, but they can have the same functions.
panos5
@panos5
Oct 24 2017 08:58
Alright.So where d y get the problem if you have defined them in the suites section properly as well?
gvanduijn
@gvanduijn
Oct 24 2017 09:00
Well, I have an suite and I have two context controllers. These two (because I sync them with my modules) I can't know what kind of function is in there. So I get them generate my config. And try to run the test. But then I got the duplicate error. Because (for now) they have the same functions.
Got what I mean now?
panos5
@panos5
Oct 24 2017 09:01
Have you defined the paths for each Context controller?So each feature knows which context class to pull.
This message was deleted
gvanduijn
@gvanduijn
Oct 24 2017 09:02
Hmm
panos5
@panos5
Oct 24 2017 09:02
This message was deleted
gvanduijn
@gvanduijn
Oct 24 2017 09:03
I saw quickly your message yes
panos5
@panos5
Oct 24 2017 09:03
Give me a second to find the right format so I can put the message back
suites:
default:
contexts:
             - FeatureContext
             - Behat\MinkExtension\Context\MinkContext
         paths: [ %paths.base%/features/web ]
    commands:
         contexts:
             - CommandLineProcessContext
         paths: [ %paths.base%/features/commands ]
I don;t know why but the format is not right however you can see what I mean..
gvanduijn
@gvanduijn
Oct 24 2017 09:06
Yes true, I will try to put down on paper what I have
gvanduijn
@gvanduijn
Oct 24 2017 09:11
suites:
default:
commands:
contexts: ['path\to\context\FeatureContext', 'path\to\context2\FeatureContext']
paths: [ %paths.base%/features/path/to/ ]
Sorry I don't know how you can format it. but oke
panos5
@panos5
Oct 24 2017 09:18
So I think that if you have it like that and all the features pull from both files you have to clear the same/duplicated functions.