GeolocationGoogleJavascriptTestBase.php in Geolocation Field 8
File
tests/src/FunctionalJavascript/GeolocationGoogleJavascriptTestBase.php
View source
<?php
namespace Drupal\Tests\geolocation\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
use Zumba\GastonJS\Exception\JavascriptError;
abstract class GeolocationGoogleJavascriptTestBase extends JavascriptTestBase {
protected function drupalGetFilterGoogleKey($path) {
try {
$this
->drupalGet($path);
$this
->getSession()
->getDriver()
->wait(1000, '1==2');
} catch (JavascriptError $e) {
foreach ($e
->javascriptErrors() as $errorItem) {
if (strpos((string) $errorItem, 'MissingKeyMapError') !== FALSE) {
continue;
}
else {
throw $e;
}
}
}
return FALSE;
}
}