Mink icon indicating copy to clipboard operation
Mink copied to clipboard

shared sessionStrategy: UnknownError when getSession() called in second test method

Open Jodes81 opened this issue 11 years ago • 5 comments

I have come across the error when modifying the "GeneralTest" class given in the examples.

To reproduce:

  1. I add this to the $browser array: 'sessionStrategy' => 'shared'
  2. I copy the method testUsingSession() and paste as testUsingSession2()

For now, the only workaround I have is to omit the shared session declaration and have a new browser window load for each test method - very slow.

Jodes81 avatar Jul 25 '15 13:07 Jodes81

The shared session concept comes from https://github.com/minkphp/phpunit-mink repo. You should be reporting there instead of this https://github.com/minkphp/Mink repo.

aik099 avatar Jul 25 '15 16:07 aik099

Can you please describe what you want to achieve instead?

aik099 avatar Jul 25 '15 16:07 aik099

It's my first project with Mink and Behat and am still getting a feel for it all. Thanks for pointing out phpunit-mink, I understand now.

I just wanted to speed up tests, sharing sessions seems like a fundamental I need to get working!

Thanks for your help

Jodes81 avatar Jul 26 '15 13:07 Jodes81

When you create task in correct repo post link to it here so it can be tracked properly.

Talking about terminology:

  • Behat + Mink = use gherkin language to write scenarios + run them using Behat feature context classes
  • PHPUnit-Mink + Mink = write PHPUnit tests directly using Mink language

PHPUnit-Mink + Behat + Mink isn't really a possibility, because you can use either 2 together.

aik099 avatar Jul 26 '15 13:07 aik099

I have raised the issue for phpunit-mink here:

https://github.com/minkphp/phpunit-mink/issues/53

Jodes81 avatar Jul 27 '15 15:07 Jodes81