public function ElementContext::assertClosedDetails in Lightning Core 8.2
Same name and namespace in other branches
- 8.5 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::assertClosedDetails()
- 8 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::assertClosedDetails()
- 8.3 tests/contexts/ElementContext.behat.inc \Acquia\LightningExtension\Context\ElementContext::assertClosedDetails()
- 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 374
Class
- ElementContext
- Contains miscellaneous step definitions for working with HTML elements.
Namespace
Acquia\LightningExtension\ContextCode
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());
}