$this->waitForPageToLoad($this->getTimeoutMsec());
$profileTitle = 'Batch Profile test_' . substr(sha1(rand()), 0, 7);
- $profileFields = array (array (
- 'type' => 'Individual',
- 'name' => 'Last Name',
- 'label' => 'Last Name'
- ));
+ $profileFields = array(
+ array(
+ 'type' => 'Individual',
+ 'name' => 'Last Name',
+ 'label' => 'Last Name'
+ )
+ );
$this->addProfile($profileTitle, $profileFields);
$this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh');
$this->type('sort_name', "Smiths_x");
$this->waitForPageToLoad($this->getTimeoutMsec());
//Reserve and interview responsedents
- $this->open($this->sboxPath . "civicrm/campaign?reset=1&subPage=survey");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('campaign', 'reset=1&subPage=survey');
$this->waitForElementPresent("xpath=//table[@id='surveys']/tbody//tr/td[2]/a[text()='{$surveyTitle}']/../following-sibling::td[@class='crm-campaign-voterLinks']/span/ul/li/a");
$this->click("xpath=//table[@id='surveys']/tbody//tr/td[2]/a[text()='{$surveyTitle}']/../following-sibling::td[@class='crm-campaign-voterLinks']/span/ul/li/a");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertTrue($assertCheck, 'copy rows for field two failed for inteview (campaign)[radio button]');
//change the editor back to ckeditor
- $this->open($this->sboxPath . "civicrm/admin/setting/preferences/display?reset=1");
- $this->waitForElementPresent('_qf_Display_next-bottom');
+ $this->openCiviPage('admin/setting/preferences/display', 'reset=1', '_qf_Display_next-bottom');
$this->select('editor_id', 'CKEditor');
$this->click('_qf_Display_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
function _addProfile($profileTitle, $customDataArr, $profileFor) {
// Go directly to the URL of the screen that you will be testing (New Profile).
- $this->open($this->sboxPath . "civicrm/admin/uf/group?reset=1");
+ $this->openCiviPage('admin/uf/group', 'reset=1');
- $this->waitForPageToLoad($this->getTimeoutMsec());
$this->click('link=Add Profile');
// Add membership custom data field to profile
$this->click('_qf_Group_next-bottom');
$this->waitForElementPresent('_qf_Field_cancel-bottom');
- $this->assertTrue($this->isTextPresent("Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."));
+ $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
foreach ($customDataArr as $key => $customDataParams) {
$this->select('field_name[0]', "label={$profileFor}");
// Clicking save and new
$this->click('_qf_Field_next_new-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("Your CiviCRM Profile Field '{$customDataParams[1]}' has been saved to '{$profileTitle}'."));
+ $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile Field '{$customDataParams[1]}' has been saved to '{$profileTitle}'.");
}
}
$returnArray = array();
$customGroupTitle = 'Custom_' . substr(sha1(rand()), 0, 4);
// Go directly to the URL of the screen that you will be testing (New Custom Group).
- $this->open($this->sboxPath . "civicrm/admin/custom/group?reset=1");
+ $this->openCiviPage('admin/custom/group', 'reset=1');
//add new custom data
$this->click("//a[@id='newCustomDataGroup']/span");
$this->waitForElementPresent('_qf_Field_cancel-bottom');
//Is custom group created?
- $this->assertTrue($this->isTextPresent("Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."));
+ $this->assertElementContainsText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
//for checkbox 1
$checkLabel1 = 'Custom Check One Text_' . substr(sha1(rand()), 0, 4);
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created
- $this->assertTrue($this->isTextPresent("Your custom field '$checkLabel1' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "Your custom field '$checkLabel1' has been saved.");
$returnArray[1] = array($customGroupTitle, $checkLabel1);
// create another custom field - Integer Radio
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created
- $this->assertTrue($this->isTextPresent("Your custom field '$checkLabel2' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "Your custom field '$checkLabel2' has been saved.");
$returnArray[2] = array($customGroupTitle, $checkLabel2);
// create another custom field - Integer Radio
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created
- $this->assertTrue($this->isTextPresent("Your custom field '$dateFieldLabel' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "Your custom field '$dateFieldLabel' has been saved.");
$returnArray[3] = array($customGroupTitle, $dateFieldLabel);
// create another custom field - Integer Radio
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created
- $this->assertTrue($this->isTextPresent("Your custom field '$richTextField' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "Your custom field '$richTextField' has been saved.");
$returnArray[4] = array($customGroupTitle, $richTextField);
// create another custom field - Integer Radio
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created
- $this->assertTrue($this->isTextPresent("Your custom field '$radioLabel1' has been saved."));
+ $this->assertElementContainsText('crm-container', "Your custom field '$radioLabel1' has been saved.");
$returnArray[5] = array($customGroupTitle, $radioLabel1);
// create another custom field - Integer Radio
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created
- $this->assertTrue($this->isTextPresent("Your custom field '$radioLabel2' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "Your custom field '$radioLabel2' has been saved.");
$returnArray[6] = array($customGroupTitle, $radioLabel2);
return $returnArray;
$this->changePermissions($permission);
// Go directly to the URL of the screen that you will beadding New Individual.
- $this->open($this->sboxPath . "civicrm/contact/add?reset=1&ct=Individual");
+ $this->openCiviPage('contact/add', 'reset=1&ct=Individual');
$firstName = "John" . substr(sha1(rand()), 0, 7);
$lastName = "Smith" . substr(sha1(rand()), 0, 7);
$this->click("_qf_Contact_upload_view");
$this->waitForPageToLoad($this->getTimeoutMsec());
$individualName = $this->getText("xpath=//div[@class='crm-summary-display_name']");
- $this->assertTrue($this->isTextPresent("$individualName has been created."));
+ $this->assertElementContainsText('crm-notification-container', "$individualName has been created.");
// submit dupe using profile/create as anonymous
- $this->open($this->sboxPath . "civicrm/profile/create?gid=4&reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("_qf_Edit_next");
+ $this->openCiviPage('profile/create', 'gid=4&reset=1', '_qf_Edit_next');
$firstName = "John" . substr(sha1(rand()), 0, 7);
$lastName = "Smith" . substr(sha1(rand()), 0, 7);
$this->click("_qf_Edit_next");
$this->waitForTextPresent("A record already exists with the same information.");
}
-}
-
-
+}
\ No newline at end of file
$params = $this->_testCustomAdd($checkSearchable);
// Go directly to the URL of the screen that you will be
// testing (Add new profile ).
- $this->open($this->sboxPath . 'civicrm/admin/uf/group?reset=1');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/uf/group', 'reset=1');
$this->click('newCiviCRMProfile-top');
$this->waitForElementPresent('_qf_Group_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
//check for profile create
- $this->assertTrue($this->isTextPresent("Your CiviCRM Profile '$profileTitle' has been added. You can add fields to this profile now"));
+ $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
//Add field to profile
$this->waitForElementPresent('field_name[0]');
$recordNew = $this->_addRecords('Create');
$this->waitForPageToLoad($this->getTimeoutMsec());
$elements = $this->parseURL( );
+
$gid = $elements['queryString']['gid'];
$id = $elements['queryString']['id'];
$this->click('edit-submit');
$this->waitForPageToLoad($this->getTimeoutMsec());
}
- $this->open($this->sboxPath . 'civicrm/profile/edit?reset=1&id='.$id.'&gid='.$gid);
+ $this->openCiviPage('profile/edit', "reset=1&id=$id&gid=$gid");
if (!$checkMultiRecord) {
- $this->assertTrue($this->isTextPresent('No multi-record entries found'));
+ $this->assertElementContainsText('crm-container', 'No multi-record entries found');
return;
}
$this->waitForElementPresent("//div[@id='crm-profile-block']/a");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->verifyText("//div[@id='browseValues']/div/div/table/thead/tr/th[1]", preg_quote($params['textFieldLabel']));
$this->verifyText("//div[@id='browseValues']/div/div/table/tbody/tr[2]/td[1]", preg_quote($record1['text']));
- $this->open($this->sboxPath . 'civicrm/profile/edit?reset=1&id='.$id.'&gid='.$gid);
- $this->waitForElementPresent("//div[@id='crm-profile-block']/a");
+ $this->openCiviPage('profile/edit', "reset=1&id=$id&gid=$gid", "//div[@id='crm-profile-block']/a");
$this->click("//div[@id='crm-profile-block']/a");
$record2 = $this->_addRecords();
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click("//div[@id='browseValues']/div/div/table/tbody/tr/td[3]/span/a[text()='Delete']");
$this->waitForElementPresent("//html/body/div[5]");
sleep(3);
- $this->assertTrue($this->isTextPresent('Are you sure you want to delete this record?'));
+ $this->assertElementContainsText('profile-dialog', 'Are you sure you want to delete this record?');
$this->click('_qf_Edit_upload_delete');
// Check the view functionality
sleep(3);
$this->click("//div[@id='browseValues']/div/div/table/tbody/tr/td[3]/span/a[text()='View']");
$this->waitForElementPresent("//html/body/div[5]");
- $this->assertTrue($this->isTextPresent('View '.$params['customGroupTitle']));
- $this->assertTrue($this->isTextPresent($params['textFieldLabel']));
+ $this->assertElementContainsText('ui-id-1', 'View '.$params['customGroupTitle']);
+ $this->assertElementContainsText('crm-container', $params['textFieldLabel']);
if ($checkSearchable) {
$this->verifyElementNotPresent("//div[@id='profile-dialog']/div/div/div/div[1]/div[2]/a");
return;
$this->click("//div[@id='profile-dialog']/div/div/div/div/div[2]/a");
$this->waitForElementPresent("//form[@id='Search']");
$this->verifyText("//form[@id='Search']/div[3]/div[2]/table/tbody/tr[2]/td[2]", preg_quote($recordNew['firstname']));
- $this->open($this->sboxPath . 'civicrm/profile/view?reset=1&id='.$id.'&gid='.$gid);
- $this->waitForElementPresent("//div[@id='row-first_name']/div[2]/a");
+ $this->openCiviPage('profile/view', "reset=1&id=$id&gid=$gid", "//div[@id='row-first_name']/div[2]/a");
$this->click("//div[@id='row-first_name']/div[2]/a");
$this->waitForElementPresent("//form[@id='Search']");
// Check that Email column is not present in selector results
function _testCustomAdd($checkSearchable) {
// Go directly to the URL of the screen that you will be testing (Custom data for contacts).
- $this->open($this->sboxPath . "civicrm/admin/custom/group?action=add&reset=1");
+ $this->openCiviPage('admin/custom/group', 'action=add&reset=1');
// As mentioned before, waitForPageToLoad is not always reliable. Below, we're waiting for the submit
// button at the end of this page to show up, to make sure it's fully loaded.
- $this->waitForPageToLoad($this->getTimeoutMsec());
//fill custom group title
$params['customGroupTitle'] = 'custom_group' . substr(sha1(rand()), 0, 3);
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom group created?
- $this->assertTrue($this->isTextPresent($params['customGroupTitle']));
+ $this->assertElementContainsText('crm-container', $params['customGroupTitle']);
//add custom field - alphanumeric text
$params['textFieldLabel'] = 'test_text_field' . substr(sha1(rand()), 0, 3);
$this->click("header");
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created?
- $this->assertTrue($this->isTextPresent($params['selectFieldLabel']));
+ $this->assertElementContainsText('crm-container', $params['selectFieldLabel']);
return $params;
}
$params['email'] = $params['firstname'].$params['lastname'].'@exa.com';
$this->type('email-Primary', $params['email']);
}
- $this->waitForElementPresent("//div[@id='crm-profile-block']/div/div[3]/div[2]/select");
- $this->select("//div[@id='crm-profile-block']/div/div[3]/div[2]/select",'value=1');
+ $this->waitForElementPresent("//div[@id='crm-profile-block']/div//div/div[2]/select");
+ $this->select("//div[@id='crm-profile-block']/div//div/div[2]/select",'value=1');
$this->click('_qf_Edit_next');
return $params;
}
// Go directly to the URL of the screen that you will be
// testing (Add new profile ).
- $this->open($this->sboxPath . 'civicrm/admin/uf/group?reset=1');
-
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/uf/group', 'reset=1');
$this->click('newCiviCRMProfile-top');
$this->waitForPageToLoad($this->getTimeoutMsec());
//check for profile create
- $this->assertTrue($this->isTextPresent("Your CiviCRM Profile '$profileTitle' has been added. You can add fields to this profile now"));
+ $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
//Add field to profile
$this->click('field_name[0]');
$this->waitForPageToLoad($this->getTimeoutMsec());
// delete the profile
- $this->open($this->sboxPath . 'civicrm/admin/uf/group?reset=1');
+ $this->openCiviPage('admin/uf/group', 'reset=1');
$this->_testdeleteProfile($profileTitle);
}
$this->waitForElementPresent('_qf_Group_next-bottom');
$this->click('_qf_Group_next-bottom');
$this->waitForElementPresent('newCiviCRMProfile-bottom');
- $this->assertTrue($this->isTextPresent("Your CiviCRM Profile '$profileTitle' has been deleted."));
+ $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been deleted.");
}
-}
-
-
+}
\ No newline at end of file