How to do System Tests / Functional Tests with an existing database
I have once answered this exact same question for Drupal 7. Though some things have changed, the concept remains the same; extend the test class.

The normal setup of a BrowserTest would look something like this:

  /**
   * {@inheritdoc}
   */
  public function setUp() {
    parent::setUp();

    // Create an article content type that we will use for testing.
    $type = $this-&gt;container-&gt;get('entity_type.manager')-&gt;getStorage('node_type')
      -&gt;create([
        'type' =&gt; 'article',
        'name' =&gt; 'Article',
      ]);
    $type-&gt;save();
    $this-&gt;container-&gt;get('router.builder')-&gt;rebuild();
  }


All you need to is to remove the database definitions from parent::setUp();

So copy setUp() from core/tests/Drupal/Tests/BrowserTestBase.php and remove the database definitions. That should make the test run on the current database. 

Though this is very simplistic and you might run into more problems along the way. All is in the BrowserTestBase class. Make sure to read my other answer, make sure to implement the teardown properly. And most of all, make proper backups!