Test a settings form that displays a queue I'm trying to write a test on a settings form. The module uses a queue, and the settings form displays the items in the queue like so: 



When I extend the test class from WebTestBase I get:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mskcc_local_d8.test73723996queue' doesn't exist: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {queue} q WHERE name = :db_condition_placeholder_0) subquery; Array ( [:db_condition_placeholder_0] =&gt; google_analytics_counter_worker ) in Drupal\google_analytics_counter\GoogleAnalyticsCounterManager-&gt;getCount() (line 635 of modules/contrib/google_analytics_counter/src/GoogleAnalyticsCounterManager.php).
Drupal\Core\Database\Statement-&gt;execute(Array, Array) (Line: 625)
Drupal\Core\Database\Connection-&gt;query('SELECT COUNT(*) AS expression
FROM 
(SELECT 1 AS expression
FROM 
{queue} q
WHERE name = :db_condition_placeholder_0) subquery', Array, Array) (Line: 87)
Drupal\Core\Database\Driver\mysql\Connection-&gt;query('SELECT COUNT(*) AS expression
FROM 
(SELECT 1 AS expression
FROM 
{queue} q
WHERE name = :db_condition_placeholder_0) subquery', Array, Array) (Line: 510)
Drupal\Core\Database\Query\Select-&gt;execute() (Line: 635)
Drupal\google_analytics_counter\GoogleAnalyticsCounterManager-&gt;getCount('queue') (Line: 134)
Drupal\google_analytics_counter\Form\GoogleAnalyticsCounterSettingsForm-&gt;buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 514)
Drupal\Core\Form\FormBuilder-&gt;retrieveForm('google_analytics_counter_admin_settings', Object) (Line: 271)
Drupal\Core\Form\FormBuilder-&gt;buildForm('google_analytics_counter_admin_settings', Object) (Line: 74)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 664)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)


which tells me that the queue table is missing from the automated test environment. 

But when I extend the test class from KernelTestBase and add

// These additional tables are necessary because $this-&gt;cron-&gt;run() calls
// system_cron().
$this-&gt;installSchema('system', ['key_value_expire']);

$this-&gt;connection = Database::getConnection();
$this-&gt;cron = \Drupal::service('cron');


to setup(), I assume my automated testing environment will contain a queue table (still to be determined). But the methods I regularly use to test a form, like $this-&gt;drupalGet and $this-&gt;assertResponse will now be not found. 

How can I test a settings form that displays the contents of the queue table?

Thanks
A functional test satisfies both requirements.

&lt;?php

namespace Drupal\Tests\google_analytics_counter\Functional;

use Drupal\Component\Utility\SafeMarkup;
use Drupal\Tests\BrowserTestBase;

/**
 * Tests the google analytics counter settings form.
 *
 * @group statistics
 */
class GoogleAnalyticsCounterSettingsTest extends BrowserTestBase {
  const ADMIN_SETTINGS_PATH = 'admin/config/system/google-analytics-counter';

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = ['google_analytics_counter'];

  /**
   * A test user with administrative privileges.
   *
   * @var \Drupal\user\UserInterface
   */
  protected $adminUser;

  /**
   * Verifies that the google analytics counter settings page works.
   *
   * @see MediaSourceTest for good example code.
   */
  public function testForm() {
    $admin_user = $this-&gt;drupalCreateUser(array(
      'administer site configuration',
      'administer google analytics counter',
    ));
    $this-&gt;drupalLogin($admin_user);

    // Create item(s) in the queue.
    $queue_name = 'google_analytics_counter_worker';
    $queue = \Drupal::queue($queue_name);

    for ($i = 1; $i &lt;= 5; $i++) {
      $queue-&gt;createItem(['type' =&gt; 'fetch', 'index' =&gt; 'boogie' . $i]);
    }

    $this-&gt;drupalGet(self::ADMIN_SETTINGS_PATH);
    $this-&gt;assertResponse(200, 'Access granted to settings page.');

    // Assert Fields.
    $settings_fields = $this-&gt;getAdminUserSettingsFields();
    foreach ($settings_fields as $field_name) {
      $this-&gt;assertField($field_name, SafeMarkup::format('@field_name field exists.', ['@field_name' =&gt; $field_name]));
    }

    // Cron Settings.
    $edit = [
      'cron_interval' =&gt; 0,
      'chunk_to_fetch' =&gt; 5000,
      'api_dayquota' =&gt; 10000,
      'cache_length' =&gt; 24,
    ];

    // Enable counter on content view.
    $this-&gt;drupalPostForm(self::ADMIN_SETTINGS_PATH, $edit, t('Save configuration'));
    $this-&gt;assertRaw('The configuration options have been saved.');
  }

  /**
   * Returns a list containing the admin settings fields.
   */
  protected function getAdminUserSettingsFields() {
    return [
      'cron_interval',
      'chunk_to_fetch',
      'api_dayquota',
      'cache_length',
      'queue_time',
      'start_date',
      'advanced_date_checkbox',
      'fixed_start_date',
      'fixed_end_date',
    ];
  }

}