Commit 67fcdc02 authored by l26yan's avatar l26yan
Browse files

ISTWCMS-4793 Add test for contacts and re-arrange contacts views

parent d19bcca9
......@@ -1878,6 +1878,37 @@ class UwWcmsBasicTest extends BrowserTestBase {
// Make sure not 'Revert to defaults' button on contact layout page.
$this->assertSession()->buttonNotExists('Revert to defaults');
// Check contacts listing view.
$this->drupalGet('contacts');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('Contacts');
$this->assertSession()->pageTextContains('Name');
$this->assertSession()->pageTextContains('Limit to contacts where the name matches');
$this->assertFieldByXPath('//input[@type="text" and @id="edit-title"]', NULL, 'Input field exists.');
$this->assertSession()->pageTextContains('Groups');
$this->assertSession()->pageTextContains('Limit to contacts where the group is one or more of');
$this->assertSession()->buttonExists('Apply filters');
// Check rearrange contacts.
$this->drupalGet('admin/rearrange-contacts');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('Published');
$this->assertOptionSelected('edit-status', '- Any -');
$this->assertSession()->buttonExists('Apply filters');
// Check dashboard contact rearrange link.
$this->drupalGet('dashboard/my_dashboard');
$this->assertSession()->statusCodeEquals(200);
$rearranges = $this->getSession()->getPage()->findAll('xpath', "//a[contains(text(), 'Rearrange')]");
$this->assertEquals(base_path() . 'admin/rearrange-contacts', $rearranges[0]->getAttribute('href'));
// Make sure site manager's rearrange is checked.
$this->drupalGet('admin/content-access');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->checkboxChecked('edit-permissions-contact-rearrange-site-manager');
$this->assertSession()->checkboxNotChecked('edit-permissions-contact-rearrange-content-editor');
$this->assertSession()->checkboxNotChecked('edit-permissions-contact-rearrange-content-author');
// Check pathauto pattern to make sure they are in same row.
$this->drupalGet('admin/config/search/path/patterns');
$this->assertSession()->statusCodeEquals(200);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment