class JavascriptErrorsSuppressionTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/FunctionalJavascriptTests/JavascriptErrorsSuppressionTest.php \Drupal\FunctionalJavascriptTests\JavascriptErrorsSuppressionTest
Tests that Drupal.throwError can be suppressed to allow a test to pass.
@group javascript
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalJavascriptTests\WebDriverTestBase implements \Drupal\Tests\BrowserTestBase
- class \Drupal\FunctionalJavascriptTests\JavascriptErrorsSuppressionTest implements \Drupal\FunctionalJavascriptTests\WebDriverTestBase
- class \Drupal\FunctionalJavascriptTests\WebDriverTestBase implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of JavascriptErrorsSuppressionTest
File
-
core/
tests/ Drupal/ FunctionalJavascriptTests/ JavascriptErrorsSuppressionTest.php, line 10
Namespace
Drupal\FunctionalJavascriptTestsView source
class JavascriptErrorsSuppressionTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected static $modules = [
'js_errors_test',
];
/**
* {@inheritdoc}
*/
protected $failOnJavascriptConsoleErrors = FALSE;
/**
* Tests that JavaScript console errors can be suppressed.
*/
public function testJavascriptErrors() : void {
// Visit page that will throw a JavaScript console error.
$this->drupalGet('js_errors_test');
// Ensure that errors from previous page loads will be
// detected.
$this->drupalGet('user');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.