function AssetAggregationAcrossPagesTest::testFrontAndRecipesPagesAuthenticated

Same name in other branches
  1. 10 core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php \Drupal\Tests\demo_umami\FunctionalJavascript\AssetAggregationAcrossPagesTest::testFrontAndRecipesPagesAuthenticated()

Checks the asset requests made when the front and recipe pages are visited.

File

core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php, line 37

Class

AssetAggregationAcrossPagesTest
Tests demo_umami profile performance.

Namespace

Drupal\Tests\demo_umami\FunctionalJavascript

Code

public function testFrontAndRecipesPagesAuthenticated() : void {
    $user = $this->createUser();
    $this->drupalLogin($user);
    sleep(2);
    $performance_data = $this->collectPerformanceData(function () {
        $this->doRequests();
    }, 'umamiFrontAndRecipePagesAuthenticated');
    $this->assertSame(6, $performance_data->getStylesheetCount());
    $this->assertLessThan(132500, $performance_data->getStylesheetBytes());
    $this->assertSame(2, $performance_data->getScriptCount());
    $this->assertLessThan(250000, $performance_data->getScriptBytes());
}

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