diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php index f3ef2a416d869480d9a07da91a9e4bd3d433f805..c313f1cce5d3a299fb7c9dd17c3c3b036c8f967e 100644 --- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php +++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php @@ -80,7 +80,7 @@ public function testFrontPageCoolCache() { $this->drupalGet('<front>'); $this->rebuildAll(); // Now visit a different page to warm non-route-specific caches. - $this->drupalGet('/user/login'); + $this->drupalGet('user/login'); $this->collectPerformanceData(function () { $this->drupalGet('<front>'); }, 'umamiFrontPageCoolCache'); diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php index 2b9287336e6b06550690bb46a1e0ba7edca2c6ff..a378ae0081b5026536fce870e79388deb988221d 100644 --- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php +++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php @@ -29,7 +29,7 @@ public function testNodePageColdCache() { $this->drupalGet('user/login'); $this->rebuildAll(); $this->collectPerformanceData(function () { - $this->drupalGet('/node/1'); + $this->drupalGet('node/1'); }, 'umamiNodePageColdCache'); $this->assertSession()->pageTextContains('quiche'); } @@ -44,10 +44,17 @@ public function testNodePageHotCache() { // the browser cache. $this->drupalGet('node/1'); $this->drupalGet('node/1'); - $this->collectPerformanceData(function () { - $this->drupalGet('/node/1'); + + $performance_data = $this->collectPerformanceData(function () { + $this->drupalGet('node/1'); }, 'umamiNodePageHotCache'); $this->assertSession()->pageTextContains('quiche'); + $this->assertSame($performance_data->getQueryCount(), 0); + $this->assertSame($performance_data->getCacheGetCount(), 1); + $this->assertSame($performance_data->getCacheSetCount(), 0); + $this->assertSame($performance_data->getCacheDeleteCount(), 0); + $this->assertSame(0, $performance_data->getCacheTagChecksumCount()); + $this->assertSame(1, $performance_data->getCacheTagIsValidCount()); } /** @@ -61,9 +68,9 @@ public function testNodePageCoolCache() { $this->drupalGet('node/1'); $this->rebuildAll(); // Now visit a non-node page to warm non-route-specific caches. - $this->drupalGet('/user/login'); + $this->drupalGet('user/login'); $this->collectPerformanceData(function () { - $this->drupalGet('/node/1'); + $this->drupalGet('node/1'); }, 'umamiNodePageCoolCache'); $this->assertSession()->pageTextContains('quiche'); } @@ -79,9 +86,9 @@ public function testNodePageWarmCache() { $this->drupalGet('node/1'); $this->rebuildAll(); // Now visit a different node page to warm non-path-specific caches. - $this->drupalGet('/node/2'); + $this->drupalGet('node/2'); $this->collectPerformanceData(function () { - $this->drupalGet('/node/1'); + $this->drupalGet('node/1'); }, 'umamiNodePageWarmCache'); $this->assertSession()->pageTextContains('quiche'); }