私は Selenium2 で Behat を使用しており、フィールドがフォーカスされているかどうかを確認するテストを作成したいと考えています。これは私の実験です:
/**
* @Then /^I could see username focused$/
*/
public function iCouldSeeUsernameFocused()
{
$this->getSession()->wait(1000, "$('#username').is(':focus') == true");
}
これは常に緑色になります。これも:
/**
* @Then /^I could see username focused$/
*/
public function iCouldSeeUsernameFocused()
{
$this->getSession()->wait(1000, "false");
}
textField がフォーカスされているかどうかを Behat でテストできますか?