Tests contextual links in the preview form.
protected function testPreviewContextual() {
module_enable(array(
'contextual',
));
$this
->drupalGet('admin/structure/views/view/test_preview/edit');
$this
->assertResponse(200);
$this
->drupalPost(NULL, $edit = array(), t('Update preview'));
$elements = $this
->xpath('//div[@id="views-live-preview"]//ul[contains(@class, :ul-class)]/li[contains(@class, :li-class)]', array(
':ul-class' => 'contextual-links',
':li-class' => 'filter-add',
));
$this
->assertEqual(count($elements), 1, 'The contextual link to add a new field is shown.');
$this
->drupalPost(NULL, $edit = array(
'view_args' => '100',
), t('Update preview'));
// Test that area text and exposed filters are present and rendered.
$this
->assertFieldByName('id', NULL, 'ID exposed filter field found.');
$this
->assertText('Test header text', 'Rendered header text found');
$this
->assertText('Test footer text', 'Rendered footer text found.');
$this
->assertText('Test empty text', 'Rendered empty text found.');
}