You are here

public function ElementContext::assertClosedDetails in Lightning Core 8

Same name and namespace in other branches
  1. 8.5 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::assertClosedDetails()
  2. 8.2 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::assertClosedDetails()
  3. 8.3 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::assertClosedDetails()
  4. 8.4 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::assertClosedDetails()

Asserts the existence of a closed <details> element by its summary text.

@Then I should see a closed :summary details element

Parameters

string $summary: The exact summary text.

ElementInterface $container: (optional) The element in which to search for the <details> element.

Throws

\Behat\Mink\Exception\ExpectationException if the <details> element is open.

File

tests/contexts/ElementContext.behat.inc, line 369

Class

ElementContext
Contains miscellaneous step definitions for working with HTML elements.

Namespace

Acquia\LightningExtension\Context

Code

public function assertClosedDetails($summary, ElementInterface $container = NULL) {
  try {
    $this
      ->assertOpenDetails($summary, $container);
  } catch (ExpectationException $e) {
    return;
  }
  throw new ExpectationException("Expected '{$summary}' details to be closed, but it is open.", $this
    ->getSession()
    ->getDriver());
}