Skip to content
Snippets Groups Projects

Issue #3477191: Add PerformanceTestTrait::assertMetrics() so it is easier to...

Files
6
@@ -25,10 +25,14 @@ public function testFrontAndRecipesPages(): void {
$performance_data = $this->collectPerformanceData(function () {
$this->doRequests();
}, 'umamiFrontAndRecipePages');
$this->assertSame(6, $performance_data->getStylesheetCount());
$this->assertLessThan(125000, $performance_data->getStylesheetBytes());
$this->assertSame(1, $performance_data->getScriptCount());
$this->assertLessThan(12000, $performance_data->getScriptBytes());
$expected = [
'ScriptCount' => 1,
'ScriptBytes' => 11850,
'StylesheetCount' => 6,
'StylesheetBytes' => 124450,
];
$this->assertMetrics($expected, $performance_data);
}
/**
@@ -41,10 +45,15 @@ public function testFrontAndRecipesPagesAuthenticated(): void {
$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());
$expected = [
'ScriptCount' => 2,
'ScriptBytes' => 249650,
'StylesheetCount' => 6,
];
$this->assertMetrics($expected, $performance_data);
$this->assertLessThan(250000, $performance_data->getScriptBytes());
}
/**
Loading