You are here

protected function DataCollectorTableTest::assertColumnsIncreased in Charts 5.0.x

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

Assert columns.

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

File

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

Class

DataCollectorTableTest
Tests the data collector table element.

Namespace

Drupal\Tests\charts\FunctionalJavascript

Code

protected function assertColumnsIncreased() {
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->assertTrue($page
    ->waitFor(10, function ($page) {
    $expected_rows = DataCollectorTableTestForm::INITIAL_COLUMNS + 1;
    $columns = $page
      ->findAll('css', static::TABLE_COLUMN_SELECTOR);
    return count($columns) === $expected_rows;
  }), 'Expected columns were increased by one after add column click.');
}