Skip to content

Commit ea9693d

Browse files
committed
MQE-1254: MFTF with Firefox fails due to getLog call
- Added check to ascertain browser is among the available log types
1 parent 66b6ecd commit ea9693d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Magento/FunctionalTestingFramework/Extension/ErrorLogger.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ private function __construct()
4848
public function logErrors($webDriver, $stepEvent)
4949
{
5050
//Types available should be "server", "browser", "driver". Only care about browser at the moment.
51-
$browserLogEntries = $webDriver->manage()->getLog("browser");
52-
foreach ($browserLogEntries as $entry) {
53-
if (array_key_exists("source", $entry) && $entry["source"] === "javascript") {
54-
$this->logError("javascript", $stepEvent, $entry);
51+
if (in_array("browser", $webDriver->manage()->getAvailableLogTypes())) {
52+
$browserLogEntries = $webDriver->manage()->getLog("browser");
53+
foreach ($browserLogEntries as $entry) {
54+
if (array_key_exists("source", $entry) && $entry["source"] === "javascript") {
55+
$this->logError("javascript", $stepEvent, $entry);
56+
}
5557
}
5658
}
5759
}

0 commit comments

Comments
 (0)