You are here

protected function YamlFormTestTrait::assertCssSelect in YAML Form 8

Passes if the CSS selector IS found on the loaded page, fail otherwise.

2 calls to YamlFormTestTrait::assertCssSelect()
YamlFormElementStatesTest::testSelectors in src/Tests/YamlFormElementStatesTest.php
Tests element #states selectors.
YamlFormSubmissionFormSettingsTest::testSettings in src/Tests/YamlFormSubmissionFormSettingsTest.php
Tests form setting including confirmation.

File

src/Tests/YamlFormTestTrait.php, line 471

Class

YamlFormTestTrait
Defines form test trait.

Namespace

Drupal\yamlform\Tests

Code

protected function assertCssSelect($selector, $message = '') {
  $element = $this
    ->cssSelect($selector);
  if (!$message) {
    $message = new FormattableMarkup('Found @selector', [
      '@selector' => $selector,
    ]);
  }
  $this
    ->assertTrue(!empty($element), $message);
}