protected function ElementContext::findDetails in Lightning Core 8.2
Same name and namespace in other branches
- 8.5 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::findDetails()
- 8 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::findDetails()
- 8.3 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::findDetails()
- 8.4 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::findDetails()
Asserts the existence of a <details> element by its summary text.
Parameters
string $summary: The exact summary text.
ElementInterface $container: The element in which to search for the <details> element.
Return value
\Behat\Mink\Element\NodeElement|bool The <details> element, or FALSE if it was not found.
1 call to ElementContext::findDetails()
- ElementContext::assertDetails in tests/contexts/ ElementContext.behat.inc 
- Asserts the existence of a <details> element by its summary text.
File
- tests/contexts/ ElementContext.behat.inc, line 299 
Class
- ElementContext
- Contains miscellaneous step definitions for working with HTML elements.
Namespace
Acquia\LightningExtension\ContextCode
protected function findDetails($summary, ElementInterface $container) {
  /** @var \Behat\Mink\Element\NodeElement $element */
  foreach ($container
    ->findAll('css', 'details > summary') as $element) {
    if ($element
      ->getText() == $summary) {
      return $element
        ->getParent();
    }
  }
  return FALSE;
}