function OpenTelemetryFrontPagePerformanceTest::testFrontPageColdCache

Same name and namespace in other branches
  1. 10 core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php \Drupal\Tests\demo_umami\FunctionalJavascript\OpenTelemetryFrontPagePerformanceTest::testFrontPageColdCache()

Logs front page tracing data with a cold cache.

File

core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php, line 26

Class

OpenTelemetryFrontPagePerformanceTest
Tests demo_umami profile performance.

Namespace

Drupal\Tests\demo_umami\FunctionalJavascript

Code

public function testFrontPageColdCache() : void {
    // @todo Chromedriver doesn't collect tracing performance logs for the very
    //   first request in a test, so warm it up.
    //   https://www.drupal.org/project/drupal/issues/3379750
    $this->drupalGet('user/login');
    $this->rebuildAll();
    $this->collectPerformanceData(function () {
        $this->drupalGet('<front>');
    }, 'umamiFrontPageColdCache');
    $this->assertSession()
        ->pageTextContains('Umami');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.