$this->
drupalGet($form_path);
$page->
pressButton("AJAX changed: Click to mark div changed with asterisk."
);
$this->
assertWaitPageContains('<div id="changed_div" class="ajax-changed"> <div id="changed_div_mark_this">This div can be marked as changed or not. <abbr class="ajax-changed" title="Changed">*</abbr> </div></div>'
);
// Tests the 'css' command.
$page->
pressButton("Set the '#box' div to be blue."
);
$this->
assertWaitPageContains('<div id="css_div" style="background-color: blue;">'
);
// Tests the 'data' command.
$page->
pressButton("AJAX data command: Issue command."
);
$this->
assertTrue($page->
waitFor(10,
function D
) use ($session) { return 'testvalue' ===
$session->
evaluateScript('window.jQuery("#data_div").data("testkey")'
);
}));
// Tests the 'html' command.
$page->
pressButton("AJAX html: Replace the HTML in a selector."
);
$this->
assertWaitPageContains('<div id="html_div">replacement text</div>'
);
// Tests the 'insert' command.
$page->
pressButton("AJAX insert: Let client insert based on #ajax['method']."
);
$this->
assertWaitPageContains('<div id="insert_div">insert replacement textOriginal contents</div>'
);
// Tests the 'invoke' command.