browser
browser copied to clipboard
Crawler is detached from the form fill helpers
I'm having problems with selectFieldOption
when it is dynamic. It's impossible to select a value that is added via JS.
So I'm trying to add it dynamically and then select it, but the thing is that in ->use(function (Crawler $crawler)
callback what I modify via crawler is not trully sent as form data.
In https://github.com/symfony/ux/issues/1334 it was suggested to use ChoiceFormField::addChoice($node)
but that doesn't work with non-multiple select element. So I though I will do this:
->use(static function (Crawler $crawler) {
$form = $crawler->selectButton('Submit')->form();
$stage = $form->get('create[items][0][stage]');
self::assertInstanceOf(ChoiceFormField::class, $stage);
$stage->disableValidation();
$stage->select('cf97d7fe-3222-472a-a1c3-ed9cdd058080');
})
But probably the crawler does not modify Mink's document? Could we have a helper method to add dynamic values for this case?