diff --git a/.ddev/config.selenium-standalone-chrome.yaml b/.ddev/config.selenium-standalone-chrome.yaml index 7f5336b42..134ff13cc 100644 --- a/.ddev/config.selenium-standalone-chrome.yaml +++ b/.ddev/config.selenium-standalone-chrome.yaml @@ -20,4 +20,4 @@ web_environment: - DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES=node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest - DRUPAL_NIGHTWATCH_OUTPUT=reports/nightwatch - DTT_BASE_URL=http://web - - DTT_MINK_DRIVER_ARGS=[\"chrome\", {\"browserName\":\"chrome\",\"chromeOptions\":{\"w3c\":false,\"args\":[\"--window-size=1920,1080\", \"--disable-gpu\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"] + - DTT_MINK_DRIVER_ARGS=[\"chrome\", {\"browserName\":\"chrome\",\"goog:loggingPrefs\":{\"performance\":\"ALL\"}, \"chromeOptions\":{\"w3c\":false, \"args\":[\"--window-size=1920,1080\", \"--disable-gpu\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"] diff --git a/web/modules/custom/server_general/tests/src/ExistingSite/ServerGeneralHomepageTest.php b/web/modules/custom/server_general/tests/src/ExistingSite/ServerGeneralHomepageTest.php index 2401f616b..6b209fc99 100644 --- a/web/modules/custom/server_general/tests/src/ExistingSite/ServerGeneralHomepageTest.php +++ b/web/modules/custom/server_general/tests/src/ExistingSite/ServerGeneralHomepageTest.php @@ -2,11 +2,26 @@ namespace Drupal\Tests\server_general\ExistingSite; +use Drupal\Tests\PerformanceTestTrait; + /** * Tests for the Homepage. */ class ServerGeneralHomepageTest extends ServerGeneralSelenium2TestBase { + use PerformanceTestTrait; + + /** + * Performance tests with open telemetry. + */ + public function testPerformance() { + $performance_data = $this->collectPerformanceData(function () { + $this->drupalGet(''); + }, 'serverGeneralFrontPageColdCache'); + $this->assertSame(5, $performance_data->getStylesheetCount()); + $this->assertSame(1, $performance_data->getScriptCount()); + } + /** * Test the featured content carousel on homepage. */