Я работаю над проектом Symfony и хочу создать модульный тест с помощью Behat/Mink.
У меня есть сценарий:
Feature: Homepage
Scenario: Check if I can log on
Given I am on "/"
And I follow "connexion_js"
And I switch to the iframe "cboxIframe"
Я определил последнюю строку в своем классе FeatureContext.
class FeatureContext extends MinkContext implements KernelAwareInterface{
// ...
/**
* @Given /^I switch to the iframe "([^"]*)"$/
*/
public function iSwitchToIframe($arg1 = null)
{
$this->getSession()->switchToIFrame($arg1);
}
}
Когда я выполняю свою команду оболочки:
$: bin/behat "@PoleMainBundle"
Feature: Homepage
Scenario: Check if I can log on # src/xxx/xxx/MainBundle/Features/homepage.feature:2
Given I am on "/" # xxx\xxx\MainBundle\Features\Context\FeatureContext::visit()
And I follow "connexion_js" # xxx\xxx\MainBundle\Features\Context\FeatureContext::clickLink()
And I switch to the iframe "cboxIframe" # xxx\xxx\MainBundle\Features\Context\FeatureContext::iSwithToIframe()
iFrame management is not supported by Behat\Symfony2Extension\Driver\KernelDriver
...