If I understand you right you want to access specific site by key which you assigned in the config file? Okay I didnt explained it very well. What I had in mind is that you will put the two sites you want to test in your behat.yml file. Lets say you have
http://<brand>-dev.foobar.com and
http://<brand>-cds.foobar.comSo your behat.yml will look like this :
ProfileName:
extensions:
Behat\MinkExtension:
files_path: %paths.base%/files
suites:
default:
contexts:
- FeatureContext:
- siteOne:
url: "
http://<brand>-dev.foobar.com"
siteTwo:
url: "
http://<brand>-cds.foobar.com"
Then in your FeatureContext.php you will create the functions which you will use in the feature files. You will have two functions for the 2 different sites.
/** Go to specific siteOne using parameters
* @Given /^I go to siteOne$/
*/
public function goTositeOne()
{
$session = $this->getSession();
$page = $session->getPage();
$url = $this->params['siteOne']['url'];
$this->getSession()->visit($this->locatePath($url));
}
/** Go to specific siteTwo using parameters
* @Given /^I go to siteTwo $/
*/
public function goTositeTwo()
{
$session = $this->getSession();
$page = $session->getPage();
$url = $this->params['siteTwo']['url'];
$this->getSession()->visit($this->locatePath($url));
}
After this in your features you can now use:
Given I go to siteOne
And ...........
And of course you can use:
Given I go to "siteTwo"
Then ......