$this->WebtestAddGroup();
// go to display preferences to enable Open ID field
- $this->openCiviPage('admin/setting/preferences/display'. "reset=1", "_qf_Display_next-bottom");
+ $this->openCiviPage('admin/setting/preferences/display', "reset=1", "_qf_Display_next-bottom");
$this->check("xpath=//ul[@id='contactEditBlocks']//li/span[2]/label[text()='Open ID']/../input");
$this->click("_qf_Display_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->webtestLogin();
// Go directly to the URL of the screen that you will be testing (New Individual).
- $this->openCiviPage('civicrm/contact/add', "reset=1&ct=Individual");
+ $this->openCiviPage('contact/add', "reset=1&ct=Individual");
//contact details section
//select prefix
// Select Your Editor
$this->_selectEditor('CKEditor');
- $this->open($this->sboxPath . "civicrm/contact/add?reset=1&action=update&cid={$contactId}");
- $this->waitForPageToLoad($this->getTimeoutMsec());
-
+ $this->openCiviPage("contact/add", "reset=1&action=update&cid={$contactId}");
$this->click("//tr[@id='Email_Block_1']/td[1]/div[2]/div[1]");
// HTML format message
$this->waitForPageToLoad($this->getTimeoutMsec());
// Is status message correct?
- $this->assertTrue($this->isTextPresent("{$name} has been updated."));
+ $this->assertElementContainsText("crm-notification-container", "{$name} has been updated.");
// Go for Ckeck Your Editor, Click on Send Mail
$this->click("//a[@id='crm-contact-actions-link']/span");
*/
function _selectEditor($editor) {
// Go directly to the URL of Set Default Editor.
- $this->open($this->sboxPath . 'civicrm/admin/setting/preferences/display?reset=1');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/setting/preferences/display', 'reset=1');
// Select your Editor
$this->click('editor_id');
function testAddContactsToGroup() {
- // Create a new group with a random name; included test provides login
+ $this->webtestLogin();
$newGroupName = 'Group_' . substr(sha1(rand()), 0, 7);
$this->WebtestAddGroup($newGroupName);
$this->waitForPageToLoad($this->getTimeoutMsec());
// Check status messages are as expected
- $this->assertTrue($this->isTextPresent("Added Contacts to {$newGroupName}"));
- $this->assertTrue($this->isTextPresent("2 contacts added to group "));
+ $this->assertElementContainsText('crm-notification-container', "Added Contacts to {$newGroupName}");
+ $this->assertElementContainsText('crm-notification-container', "2 contacts added to group");
// Search by group membership in newly created group
$this->openCiviPage('contact/search/advanced', 'reset=1');
}
function testMultiplePageContactSearchAddContactsToGroup() {
+ $this->webtestLogin();
$newGroupName = 'Group_' . substr(sha1(rand()), 0, 7);
$this->WebtestAddGroup($newGroupName);
$this->waitForPageToLoad($this->getTimeoutMsec());
// Check status messages are as expected
- $this->assertTrue($this->isTextPresent("Added Contacts to {$newGroupName}"));
- $this->assertTrue($this->isTextPresent("50 contacts added to group"));
+ $this->assertElementContainsText('crm-notification-container', "Added Contacts to {$newGroupName}");
+ $this->assertElementContainsText('crm-notification-container', "50 contacts added to group");
$this->openCiviPage('contact/search/advanced', 'reset=1');
$this->select("crmasmSelect1", "label=" . $newGroupName);
function testStandaloneMemberAdd() {
- $this->open($this->sboxPath);
$this->webtestLogin();
// create contact
$membershipTypes = $this->webtestAddMembershipType();
// now add membership
- $this->open($this->sboxPath . "civicrm/member/add?reset=1&action=add&context=standalone");
-
- $this->waitForElementPresent("_qf_Membership_upload");
+ $this->openCiviPage("member/add", "reset=1&action=add&context=standalone", "_qf_Membership_upload");
// select contact
$this->webtestFillAutocomplete($firstName);
$this->waitForElementPresent("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']");
$this->click("xpath=//div[@id='memberships']//table/tbody/tr[1]/td[9]/span/a[text()='View']");
$this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
+
$expected = array(
- 2 => $membershipTypes['membership_type'],
- 3 => 'New',
- 4 => 'Membership StandaloneAddTest Webtest',
+ 'Membership Type' => $membershipTypes['membership_type'],
+ 'Status' => 'New',
+ 'Source' => 'Membership StandaloneAddTest Webtest',
);
- foreach ($expected as $label => $value) {
- $this->verifyText("xpath=id('MembershipView')/div[2]/div/table[1]/tbody/tr[$label]/td[2]", preg_quote($value));
- }
+ $this->webtestVerifyTabularData($expected);
}
function testStandaloneMemberOverrideAdd() {
- $this->open($this->sboxPath);
$this->webtestLogin();
// add contact
$membershipTypes = $this->webtestAddMembershipType();
// add membership
- $this->open($this->sboxPath . "civicrm/member/add?reset=1&action=add&context=standalone");
-
- $this->waitForElementPresent("_qf_Membership_upload");
+ $this->openCiviPage("member/add", "reset=1&action=add&context=standalone", "_qf_Membership_upload");
// select contact
$this->webtestFillAutocomplete($firstName);
$this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
$expected = array(
- 2 => $membershipTypes['membership_type'],
- 3 => 'Grace',
- 4 => 'Membership StandaloneAddTest Webtest',
+ 'Membership Type' => $membershipTypes['membership_type'],
+ 'Status' => 'Grace',
+ 'Source' => 'Membership StandaloneAddTest Webtest',
);
- foreach ($expected as $label => $value) {
- $this->verifyText("xpath=id('MembershipView')/div[2]/div/table[1]/tbody/tr[$label]/td[2]", preg_quote($value));
- }
+ $this->webtestVerifyTabularData($expected);
}
}