findRowById example

/** * {@inheritdoc} */
  protected static $tabledragChangedXpathSelector = 'child::td[1]/div[contains(concat(" ", normalize-space(@class), " "), " js-tabledrag-cell-content ")]/abbr[contains(concat(" ", normalize-space(@class), " "), " tabledrag-changed ")]';

  /** * Ensures that there are no duplicate tabledrag handles. */
  public function testNoDuplicates() {
    $this->drupalGet('tabledrag_test_nested');
    $this->assertCount(1, $this->findRowById(1)->findAll('css', '.tabledrag-handle'));
  }

}
    $this->assertNotNull($this->assertSession()->waitForElement('css', 'html.no-touchevents'));
    $weight_select1 = $page->findField("table[1][weight]");
    $weight_select2 = $page->findField("table[2][weight]");
    $weight_select3 = $page->findField("table[3][weight]");

    // Check that initially the rows are in the correct order.     $this->assertOrder(['Row with id 1', 'Row with id 2', 'Row with id 3']);

    // Check that the 'unsaved changes' text is not present in the message area.     $this->assertSession()->pageTextNotContains('You have unsaved changes.');

    $row1 = $this->findRowById(1)->find('css', 'a.tabledrag-handle');
    $row2 = $this->findRowById(2)->find('css', 'a.tabledrag-handle');
    $row3 = $this->findRowById(3)->find('css', 'a.tabledrag-handle');

    // Drag row1 over row2.     $row1->dragTo($row2);

    // Check that the 'unsaved changes' text was added in the message area.     $this->assertSession()->waitForText('You have unsaved changes.');

    // Check that row1 and row2 were swapped.     $this->assertOrder(['Row with id 2', 'Row with id 1', 'Row with id 3']);

    
Home | Imprint | This part of the site doesn't use cookies.