MockPerformanceMonitor

Playwright\Performance\Monitor\MockPerformanceMonitor

Mock implementation of PerformanceMonitorInterface for testing.

$ composer require playwright-php/performance

Methods

setCoreWebVitals()

void

Set the Core Web Vitals that will be returned by collectCoreWebVitals().

function setCoreWebVitals(CoreWebVitals $vitals): void

setResourceMetrics()

void

Set the resource metrics that will be returned by collectResourceMetrics().

function setResourceMetrics(array $resources): void

getNavigatedUrls()

array

Get the list of URLs that were navigated to.

function getNavigatedUrls(): array
void
function navigate(string $url): void

collectCoreWebVitals()

CoreWebVitals
function collectCoreWebVitals(): CoreWebVitals

collectResourceMetrics()

array
function collectResourceMetrics(): array