You are here

public function ElementContext::matchExactly in Lightning Core 8.5

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

Asserts that a number of elements match a CSS selector.

@Then exactly :n element(s) should match :selector

Parameters

string $selector: The selector.

int $n: The number of elements expected to match the selector.

File

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

Class

ElementContext
Contains miscellaneous step definitions for working with HTML elements.

Namespace

Acquia\LightningExtension\Context

Code

public function matchExactly($selector, $n) {
  $this
    ->assertSession()
    ->elementsCount('css', $selector, $n);
}