Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser.php
Show First 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | public function storeConsoleLog($name) | ||||
if (in_array($this->driver->getCapabilities()->getBrowserName(), static::$supportsRemoteLogs)) { | if (in_array($this->driver->getCapabilities()->getBrowserName(), static::$supportsRemoteLogs)) { | ||||
$console = $this->driver->manage()->getLog('browser'); | $console = $this->driver->manage()->getLog('browser'); | ||||
// Ignore errors/warnings irrelevant for testing | // Ignore errors/warnings irrelevant for testing | ||||
foreach ($console as $idx => $entry) { | foreach ($console as $idx => $entry) { | ||||
if ( | if ( | ||||
$entry['level'] != 'SEVERE' | $entry['level'] != 'SEVERE' | ||||
|| strpos($entry['message'], 'Failed to load resource: the server responded with a status of') | || strpos($entry['message'], 'Failed to load resource: the server responded with a status of') | ||||
|| preg_match('/^\S+\.js [0-9]+:[0-9]+\s*$/', $entry['message']) | |||||
) { | ) { | ||||
$console[$idx] = null; | $console[$idx] = null; | ||||
} | } | ||||
} | } | ||||
$console = array_values(array_filter($console)); | $console = array_values(array_filter($console)); | ||||
if (!empty($console)) { | if (!empty($console)) { | ||||
Show All 10 Lines |