$session =
$this->
getSession();
$page =
$session->
getPage();
// Confirm touchevents detection is loaded with Tabledrag
$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);