Behat / MinkExtension

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

I would like to use MinkContext in two different Contexts. #348

Open mtopcu opened 5 years ago

mtopcu commented 5 years ago

I would like to use MinkContext functions in FeatureContext and other Context named as ApiContext. But when I try to use, I got below error.

Is there anyone who solved this issue? Thanks.

Step "the response should be json" is already defined in FeatureContext::theResponseShouldBeJson()

My FeatureContext class like: class FeatureContext extends MinkContext My ApiContext class like: class ApiContext extends FeatureContext implements Context

And my behat yml is like:

default:
  suites:
    default:
      contexts:
        - FeatureContext:
            parameters:
        - ApiContext:
            parameters:

  extensions:
    Behat\MinkExtension:
      base_url: http://api-v2-int.somc.io/
      browser_name: chrome
      default_session: default
      javascript_session: selenium2
      sessions:
        default:
          goutte:
            guzzle_parameters:
              verify: false
        selenium2:
          selenium2:
            wd_host: http://127.0.0.1:4444/wd/hub
            capabilities: {browserVersion:  , version:  }
mtopcu commented 5 years ago

I need to remove FeatureContext in behat.yml. Now it works. But this time, I cant set parameters for FeatureContext.