Can't set a default theme in a FunctionalJavascript test with $defaultTheme class property Trying multiple ways here to set a default theme to use in FunctionalJavascript tests and it is not working (I am watching them execute in VNC viewer). Bartik always shows.

I also tried setting $defaultTheme to stark, it does not appear either. It is always Bartik. According to the class and docs, this is supported in Drupal 8.8.2.

How can I make my theme default and load? This is the class my FunctionalJavascript class tests extend:

abstract class WebDriverTestBase extends CoreWebDriverTestBase {

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'MYTHEME';

  protected $profile = 'standard';

  /**
   * {@inheritdoc}
   */
  protected $strictConfigSchema = FALSE;

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    $this-&gt;container-&gt;get('module_installer')-&gt;uninstall(['page_cache']);
    $this-&gt;container-&gt;get('theme_installer')-&gt;install(['MYTHEME'], TRUE);
    $this-&gt;container-&gt;get('config.factory')-&gt;getEditable('system.theme')-&gt;set('default', 'MYTHEME')-&gt;save();
  }


Edit: command being run:

docker-compose exec --user=$DOCKER_COMPOSE_USER php phpunit --testsuite unit,kernel,functional,functional-javascript

My phpunit.xml.dist file has limited those suites to my modules/custom folder.

Edit 2:

I have now done the following:

drush si --sites-subdir=testing.docker.localhost
drush then MYTHEME
drush cedit system.theme (set MYTHEME default)
drush pm-uninstall page_cache
drush en mymodule_user_auth
drush cr
phpunit ....


I had to set the block too (one test looks for the presence of a block). Now the tests pass. But why is the setUp() method not doing the above even though its being told to do so? Regular Functional tests adhere to this, why not FunctionalJavascript ones?
I wound up installing a barebones install with drush si and exporting certain configuration to an install profile. After adding this to drush si in CI and local, all functional javascript browser tests work without complaints. 

I double checked and the parent BrowserTestBase class does have defaultTheme and profile properties, so I don't know why those were not installed.