MinkExtension icon indicating copy to clipboard operation
MinkExtension copied to clipboard

[Suggestion] Make the name capability configurable for each test

Open Ninir opened this issue 9 years ago • 2 comments

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.

Ninir avatar Jun 14 '16 07:06 Ninir

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.

aik099 avatar Jun 14 '16 09:06 aik099

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

adrian-radu avatar Jul 05 '17 10:07 adrian-radu