MinkExtension icon indicating copy to clipboard operation
MinkExtension copied to clipboard

Scenarios not isolated

Open jonathanjfshaw opened this issue 8 years ago • 1 comments

My scenarios are not isolated in terms of URL and page content.

  In order to demonstrate isolation failure
  As an issue reporter
  I need to show that the same scenario fails if it comes first but passes if last.

  Scenario:
    Then I should see "Search"

  Scenario:
    Given I am on "http://www.google.com"

  Scenario:
    Then I should see "Search"
3 scenarios (2 passed, 1 failed)
3 steps (2 passed, 1 failed)

The first scenario fails ("Unable to access the request before visiting a page") as it should, but the third passes.

This is just using the bare Mink extension:

  autoload:
    - %paths.base%/features/build/contexts
  suites:
    default:
      paths:
        - %paths.base%/features
      contexts:
        - Behat\MinkExtension\Context\MinkContext
  extensions:
    Behat\MinkExtension:
      sessions:
        default:
          goutte: ~
      base_url: http://localhost:80

Using @isolated makes no difference. Using $this->mink->restartSessions() in an @BeforeScenario or @BeforeStep hook makes no difference.

What on earth is happening?

jonathanjfshaw avatar Jul 15 '17 14:07 jonathanjfshaw

For isolating environment responsible IsolatingScenarioTester, there are method test that started with:

$isolatedEnvironment = $this->envManager->isolateEnvironment($env, $scenario);

I don't know if it will help you, but at list you can debug it.

spolischook avatar Aug 15 '17 08:08 spolischook