How do I set the value of a date and time field with Behat? I am trying to test my site with Behat.
On my entity edit form, I have a Datetime field that uses the Date and time widget.  I want to use the Date and time widget because I need to set the time in increments of seconds, which I cannot do with the Select list widget.
I want to set the value of this field with a step like this:
And I assign the date &quot;yesterday&quot; with timezone &quot;Asia/Tokyo&quot; for &quot;edit-field-datetime-MYFIELD-0-value&quot;

To do so, in FeatureContext.php, I wrote the following code.
  /**
   * @Then I assign the date :date with timezone :timezone for :field
   *
   * Assign the specified date to the element with the given CSS.
   */
  public function assertEnterDateForField($field, $timezone, $date_string) {
    $date_field = $field . '-date';
    $time_field = $field . '-time';
    // Drupal stores timezones as UTC so we need the base time in UTC.
    $datetime = new DateTime($date_string, timezone_open('UTC'));
    // We need to convert the UTC time to the user's timezone.
    // This is because when saving the entity,
    // Drupal will convert the value to UTC.
    $datetime-&gt;setTimezone(timezone_open($timezone));
    $date_output_string = $datetime-&gt;format('mdY');
    $time_output_string = $datetime-&gt;format('hisA');
    $datetime_debug_string = $datetime-&gt;format('Y-m-d\TH:i:sO');
    $this-&gt;fillfield($time_field, $time_output_string);
    $this-&gt;fillField($date_field, $date_output_string);
    echo &quot;Datetime $datetime_debug_string
    Field set to
    date: $date_output_string
    time: $time_output_string&quot;;
  }

On my local environment (lando, running the Standalone Chrome container), this code works as expected; the date/time is set correctly for the field.
However, on my test server (Pantheon/CircleCI, running the Behat Chrome Extension, it doesn't work.  The debug information is correct; for example:
  │ Datetime 2020-08-13T09:00:00+0900
  │     Field set to
  │     date: 08132020
  │     time: 090000AM

However, the date/time is not actually filled in, so when the entity is saved, the date/time has not been updated.
How can I set the value of a field that uses the Date and time widget with Behat/Mink/Drupal Extension?
I haven't been able to find a way to do this, so for now, I rewrote my CI configuration so that I can use Standalone Chrome with Pantheon/CircleCI instead of the Behat Chrome Extension.