requestPage example

protected function doTestAggregation(array $settings): void {
    $this->writeSettings($settings);
    $this->rebuildAll();
    $this->config('system.performance')->set('css', [
      'preprocess' => TRUE,
      'gzip' => TRUE,
    ])->save();
    $this->config('system.performance')->set('js', [
      'preprocess' => TRUE,
      'gzip' => TRUE,
    ])->save();
    $this->requestPage();
    $session = $this->getSession();
    $page = $session->getPage();

    // Collect all the URLs for all the script and styles prior to making any     // more requests.     $style_elements = $page->findAll('xpath', '//link[@href and @rel="stylesheet"]');
    $script_elements = $page->findAll('xpath', '//script[@src]');
    $style_urls = [];
    foreach ($style_elements as $element) {
      $style_urls[] = $element->getAttribute('href');
    }
    
Home | Imprint | This part of the site doesn't use cookies.