You are here

public function ElementContext::assertClosedDetails in Lightning Core 8.3

Same name and namespace in other branches
  1. 8.5 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::assertClosedDetails()
  2. 8 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::assertClosedDetails()
  3. 8.2 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.

\Behat\Mink\Element\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 376

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());
}