public function SelectorsContext::registerSelectors in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.5
Same name and namespace in other branches
- 8.8 tests/features/bootstrap/SelectorsContext.php \SelectorsContext::registerSelectors()
- 8.4 tests/features/bootstrap/SelectorsContext.php \SelectorsContext::registerSelectors()
- 8.6 tests/features/bootstrap/SelectorsContext.php \SelectorsContext::registerSelectors()
- 8.7 tests/features/bootstrap/SelectorsContext.php \SelectorsContext::registerSelectors()
- 9.0.x tests/features/bootstrap/SelectorsContext.php \SelectorsContext::registerSelectors()
@BeforeStep @javascript
File
- tests/
features/ bootstrap/ SelectorsContext.php, line 116
Class
- SelectorsContext
- Defines application features from the specific context.
Code
public function registerSelectors() {
$selectorHandler = $this
->getSession()
->getSelectorsHandler()
->getSelector('named');
// Register selector name for all CSS selectors.
$css = new CssSelector();
foreach ($this->cssSelectors as $name => $selector) {
$selectorHandler
->registerNamedXpath($name, $css
->translateToXPath($selector));
}
// Register selector name for all XPath selectors.
foreach ($this->xpathSelectors as $name => $selector) {
$selectorHandler
->registerNamedXpath($name, $selector);
}
}