Using attachFileToField in a Functional test doesn't allow entering the alt text for an image In a Functional test, I am doing:
    $this-&gt;drupalGet('node/add/article');

    $page-&gt;fillField('title[0][value]', 'Page 1 EN');

    $page-&gt;pressButton('Add image');
    // Using TestFileCreationTrait::getTestFiles().
    $image = current($this-&gt;getTestFiles('image'));
    $page-&gt;attachFileToField('field_image', $this-&gt;container-&gt;get('file_system')-&gt;realpath($image-&gt;uri));

This appears to work, in that if I then do:
    $page-&gt;pressButton('Save');

I get a form error because the image alt text is required.
But this doesn't work:
    $page-&gt;fillField('field_image[0][alt]', 'Image alt text EN');

and in the browser output, I don't see the subfields for the image.
In FunctionalJavascript tests that use attachFileToField(), there's typically a waitForFoo() call which waits for the form AJAX to update and show the image subfields.
But that's not available in Functional tests, and besides, there's no AJAX since there's no JS.
How can I get this to work?
(I'd really rather not use drupalPost() to send a massive edit array; using Mink to fill fields one by one is much better DX I find.)
Ah, it looks like this might do it:
    $page-&gt;fillField('field_image[0][alt]', 'Image alt text EN');
    $page-&gt;pressButton('Upload');
    // This reloads the page and the alt text field is now present.