You are here

protected function DataCollectorTableTest::assertRowsIncreased in Charts 8.4

Same name and namespace in other branches
  1. 5.0.x tests/src/FunctionalJavascript/DataCollectorTableTest.php \Drupal\Tests\charts\FunctionalJavascript\DataCollectorTableTest::assertRowsIncreased()

Assert rows.

1 call to DataCollectorTableTest::assertRowsIncreased()
DataCollectorTableTest::doTableOperation in tests/src/FunctionalJavascript/DataCollectorTableTest.php
Do table operation.

File

tests/src/FunctionalJavascript/DataCollectorTableTest.php, line 158

Class

DataCollectorTableTest
Tests the data collector table element.

Namespace

Drupal\Tests\charts\FunctionalJavascript

Code

protected function assertRowsIncreased() {
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->assertTrue($page
    ->waitFor(10, function ($page) {
    $expected_rows = DataCollectorTableTestForm::INITIAL_ROWS + 1;
    $rows = $page
      ->findAll('css', static::TABLE_ROW_SELECTOR);
    return count($rows) === $expected_rows;
  }), 'Expected rows were increased by one after add row click.');
}