function EditModeTest::getTabbableElementsCount
Same name in other branches
- 9 core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php \Drupal\Tests\contextual\FunctionalJavascript\EditModeTest::getTabbableElementsCount()
- 8.9.x core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php \Drupal\Tests\contextual\FunctionalJavascript\EditModeTest::getTabbableElementsCount()
- 11.x core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php \Drupal\Tests\contextual\FunctionalJavascript\EditModeTest::getTabbableElementsCount()
Gets the number of elements that are tabbable.
Return value
int The number of tabbable elements.
1 call to EditModeTest::getTabbableElementsCount()
- EditModeTest::testEditModeEnableDisable in core/
modules/ contextual/ tests/ src/ FunctionalJavascript/ EditModeTest.php - Tests enabling and disabling edit mode.
File
-
core/
modules/ contextual/ tests/ src/ FunctionalJavascript/ EditModeTest.php, line 161
Class
- EditModeTest
- Tests edit mode.
Namespace
Drupal\Tests\contextual\FunctionalJavascriptCode
protected function getTabbableElementsCount() {
// Mark all tabbable elements.
$this->getSession()
->executeScript("jQuery(window.tabbable.tabbable(document.body)).attr('data-marked', '');");
// Count all marked elements.
$count = count($this->getSession()
->getPage()
->findAll('css', "[data-marked]"));
// Remove set attributes.
$this->getSession()
->executeScript("jQuery('[data-marked]').removeAttr('data-marked');");
return $count;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.