Behat / MinkExtension

Mink extension (tight integration and configuration) for Behat
MIT License
636 stars 279 forks source link

[Suggestion] Make the name capability configurable for each test #249

Open Ninir opened 8 years ago

Ninir commented 8 years ago

Hi,

I'm making a follow-up of the conversation I and @stof had on Twitter yersterday.

What I would like to do is naming the session (BrowserStack / Sauce) on each test so that it's easier to find individual tests for a given project at a given build. It is something possible according to their respective documentations:

Stof said that each test should be isolated, which is not a problem I guess, adding the insulated tag.

Now, I'd like to find a way to make it configurable, via a callback or something in the idea. Do you think it could be done? would gladly do it if it fits the idea of Behat & Mink and does not add too much overhead.

Thanks.

aik099 commented 8 years ago

What I would like to do is naming the session (BrowserStack / Sauce) on each test so that it's easier to find individual tests for a given project at a given build.

Unfortunately name for the Sauce Labs / BrowserStack is given upon session creation and can't be changed after that. In my tests, in case of failure, I also wanted logs to look cool and show actual test that failed, but to make that happen I had to stop/start session for each test and that's huge overhead considering how long it takes to start a session on Sauce Labs / BrowserStack.

It is something possible according to their respective documentations:

Both services have API library, that when given SessionID of WebDriver can then change it's name on the fly, but that stays the same session. Not different session for each test.

adrian-radu commented 7 years ago

This worked on behat 2 using global variables, please search here selenium2-driver-fork for BROWSERSTACK_SCENARIO and these variables could be set in a BeforeScenario