What I understood with gherkin is, it shows what's wrong with our design and UX. And if we can't tell the program what field fill, how a human could he?
Also the main purpose of your scenario is not to fill the form but add a city. So you should change Then
by And
on the line Then I fill in "name" with "Testing 1 2 3"
.
On the other side, you can simply add a specific validation method and keep a readable feature, something like :
And I fill the city's creation form field with "Testing 1 2 3"
Then in your context :
/**
* @Given /^I fill the city's creation form field with "([^"]*)"$/
*/
public function fillCitysCreationForm($arg1)
{
$this->fillField('my_project_localebundle_citytype_name', $arg1);
}
PS: I didn't test the previous code, you may have to improve it.