public function TestSubContext::iTypeIntoField in Panopoly 7
@When I type :text into :field field
File
- modules/
panopoly/ panopoly_test/ behat/ steps/ panopoly_test.behat.inc, line 797 - Provide Behat step-definitions for generic Panopoly tests.
Class
Code
public function iTypeIntoField($text, $field) {
// The builtin "I fill in..." step will immediately move focus out of the
// field, which makes it impossible to test autocomplete. This step puts the
// value in without changing focus.
$this
->getSession()
->getDriver()
->getWebDriverSession()
->element('xpath', $this
->getSession()
->getSelectorsHandler()
->selectorToXpath('named_exact', array(
'field',
$field,
)))
->postValue(array(
'value' => array(
$text,
),
));
}