Running functional tests on a non-English site
I think there are a few ways. The simplest might be to override the installParameters() method to specify your desired language:

protected function installParameters() {
  // This will come back with the langcode set to `en`.
  $parameters = parent::installParameters();

  // Update to desired langcode:
  $parameters['parameters']['langcode'] = 'es';

  return $parameters;
}


I didn't find any tests in core that did it this way, but there are a few that change it during setup via the UI. (This example from LanguagePathMonolingualTest)

// Make French the default language.
$edit = [
  'site_default_language' =&gt; 'fr',
];
$this-&gt;drupalPostForm('admin/config/regional/language', $edit, t('Save configuration'));