$this->openCiviPage('group', 'reset=1');
$this->type('title', $params['name']);
$this->click('_qf_Search_refresh');
- $this->waitForElementPresent("xpath=//table[@id='crm-group-selector']/tbody/tr/td[3]/a");
+ $this->waitForElementPresent("xpath=//table[@id='crm-group-selector']/tbody/tr/td[contains(text(), '{$params['name']}')]");
$createdBy = $this->getText("xpath=//table[@id='crm-group-selector']/tbody/tr/td[3]/a");
$this->click("xpath=//table[@id='crm-group-selector']/tbody/tr/td[7]/span/a[2]");
$this->waitForElementPresent("xpath=//form[@id='Edit']/div[2]/div/table[2]/tbody/tr/td[2]/select");
$this->click("xpath=//table[@id='crm-group-selector']/tbody//tr/td[1][text()='{$params['name']}']/following-sibling::td[2]/a");
$this->waitForPageToLoad($this->getTimeoutMsec());
$name = explode(',', $createdBy);
- $displayName = isset($name[1]) ? "{$name[1]} {$name[0]}" : "{$name[0]}";
- $this->assertElementContainsText("css=div.crm-summary-display_name",$displayName);
+ $name1 = trim($name[1]);
+ $name0 = trim($name[0]);
+ $displayName = isset($name1) ? "{$name1} {$name0}" : "{$name0}";
+ $this->assertElementContainsText("css=div.crm-summary-display_name", $displayName);
}
function testGroupReserved() {
// Check Reserved box
$this->click("is_reserved");
-
+
// Clicking save.
$this->click("_qf_Edit_upload");
$this->waitForPageToLoad($this->getTimeoutMsec());
// Is status message correct?
$this->assertTrue($this->isTextPresent("The Group '{$params['name']}' has been saved."));
-
+
// Create a new role w/o reserved group permissions
$role = 'role' . substr(sha1(rand()), 0, 7);
$this->open($this->sboxPath . "admin/people/permissions/roles");
$this->type("edit-name", $role);
$this->click("edit-add");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
$this->open($this->sboxPath . "admin/people/permissions/roles");
$this->waitForElementPresent("xpath=//table[@id='user-roles']/tbody//tr/td[1][text()='{$role}']");
$roleId = explode('/', $this->getAttribute("xpath=//table[@id='user-roles']/tbody//tr/td[1][text()='{$role}']/../td[4]/a[text()='edit permissions']/@href"));
"edit-{$roleId}-access-civicrm",
);
$this->changePermissions($permissions);
-
+
// Now logout as admin, login as regular user and verify that Group settings, delete and disable links are not available
$this->openCiviPage('logout', 'reset=1', NULL);
$this->open($this->sboxPath);
$this->type('edit-pass', 'Test12345');
$this->click('edit-submit');
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
$this->openCiviPage('group', 'reset=1');
$this->type('title', $params['name']);
$this->click('_qf_Search_refresh');
$this->waitForPageToLoad($this->getTimeoutMsec());
return $name;
}
-
+
function _roleDelete($role) {
$this->waitForElementPresent("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']");
$this->click("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']");
$this->click("edit-submit");
$this->waitForTextPresent("The role has been deleted.");
}
-
-}
-
-
+}
\ No newline at end of file