//Profile Advance Settings
$this->click("//form[@id='Group']/div[2]/div[2]/div[1]");
- //If you want member(s) of your organization to receive a
- //notification email whenever this Profile
- //form is used to enter or update contact information, enter one or more email addresses here.
- $this->type('notify', 'This is notify email');
-
//Drupal user account registration option
$this->click('CIVICRM_QFID_0_8');
$this->click('is_uf_link');
//click on save
- $this->click('_qf_Group_next');
+ $this->clickLink('_qf_Group_next', NULL, TRUE);
//check for profile create
$this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
+ $gid = $this->urlArg('gid');
+
+ $this->openCiviPage('admin/uf/group/field/add', array('action' => 'add', 'reset' => 1, 'gid' => $gid), 'field_name[0]');
+
//Add field to profile
- $this->waitForElementPresent('field_name[0]');
$this->click('field_name[0]');
$this->select('field_name[0]', 'value=Contact');
$this->click("//option[@value='Contact']");
$this->click('is_searchable');
$this->click('in_selector');
$this->type('help_post', 'This is help for profile field');
- $this->click('_qf_Field_next_new-top');
+ $this->clickLink('_qf_Field_next_new-top');
- $this->waitForPageToLoad($this->getTimeoutMsec());
$this->click('field_name[0]');
$this->select('field_name[0]', 'value=Contact');
$this->click("//option[@value='Contact']");
$this->select('visibility', 'value=Public Pages and Listings');
$this->click('is_searchable');
$this->type('help_post', 'This is help for profile field');
- $this->click('_qf_Field_next');
- //click on save
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink('_qf_Field_next');
$uselink = explode('?', $this->getAttribute("xpath=//*[@id='field_page']/div[1]/a[4]@href"));
- $this->openCiviPage('profile/create', "$uselink[1]", '_qf_Edit_cancel');
+ $this->openCiviPage('profile/create', "$uselink[1]", '_qf_Edit_next');
$recordNew = $this->_addRecords('Create');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $elements = $this->parseURL();
- $gid = $elements['queryString']['gid'];
- $id = $elements['queryString']['id'];
+ $id = $this->urlArg('id');
if ($userCheck) {
//add drupal user
}
$this->waitForElementPresent("//a/span[contains(text(), 'Add New Record')]");
$this->click("//a/span[contains(text(), 'Add New Record')]");
- $this->waitForElementPresent("_qf_Edit_cancel");
- $record1 = $this->_addRecords();
+ $this->waitForElementPresent("_qf_Edit_next");
+ $record1 = $this->_addRecords('Edit', TRUE);
$this->waitForElementPresent("//div[@id='custom--table-wrapper']/div/div/table/tbody/tr[2]/td[1]");
$alertText = $this->getAlert();
$this->assertEquals("Thank you. Your information has been saved.", $alertText);
$this->verifyText("//div[@id='custom--table-wrapper']/div/div/table/thead/tr/th[1]", preg_quote($params['textFieldLabel']));
$this->verifyText("//div[@id='custom--table-wrapper']/div/div/table/tbody/tr[2]/td[1]", preg_quote($record1['text']));
$this->click("//a/span[contains(text(), 'Add New Record')]");
- $record2 = $this->_addRecords();
+ $this->waitForElementPresent("_qf_Edit_next");
+ $record2 = $this->_addRecords('Edit', TRUE);
$this->waitForElementPresent("//div[@id='custom--table-wrapper']/div/div/table/tbody/tr[3]/td[1]");
$alertText = $this->getAlert();
$this->assertEquals("Thank you. Your information has been saved.", $alertText);
$this->verifyElementNotPresent("//a/span[contains(text(), 'Add New Record')]");
//Check for edit functionality
- // Because it tends to cause problems, all uses of sleep() must be justified in comments
- // Sleep should never be used for wait for anything to load from the server
- // Justification for this instance: FIXME
- sleep(3);
$this->click("//div[@id='custom--table-wrapper']/div/div/table/tbody/tr/td[3]/span/a[text()='Edit']");
- $this->waitForElementPresent("xpath=//div[@class='ui-dialog-content ui-widget-content modal-dialog crm-ajax-container']/form/div[2]//div[@id='crm-profile-block']//div[@class='crm-submit-buttons']/span/input[@class='validate crm-form-submit default crm-form-submit']");
+ $this->waitForElementPresent("xpath=//div[@class='ui-dialog-content ui-widget-content modal-dialog crm-ajax-container']/form/div[2]//div[@id='crm-profile-block']");
$this->verifyText("//div[@id='custom--table-wrapper']/div/div/table/thead/tr/th[1]", preg_quote($params['textFieldLabel']));
$this->type("//div[@id='crm-profile-block']/div/div[2]/input[@class='crm-form-text required']", $recordNew['text'].'edit');
- $this->click("xpath=//div[@class='ui-dialog-content ui-widget-content modal-dialog crm-ajax-container']/form/div[2]//div[@id='crm-profile-block']//div[@class='crm-submit-buttons']/span/input[@class='validate crm-form-submit default crm-form-submit']");
+ $this->click("css=.ui-dialog-buttonset button[data-identifier=_qf_Edit_next]");
$this->waitForText("//div[@id='custom--table-wrapper']/div/div/table/tbody/tr[1]/td[1]", $recordNew['text'].'edit');
$editalertText = $this->getAlert();
$this->assertEquals("Thank you. Your information has been saved.", $editalertText);
// Check the delete functionality
$this->click("//div[@id='custom--table-wrapper']/div/div/table/tbody/tr/td[3]/span/a[text()='Delete']");
- $this->waitForElementPresent("xpath=//div[@class='ui-dialog-content ui-widget-content modal-dialog crm-ajax-container']/form/div[2]/div");
- $this->assertElementContainsText("xpath=//div[@class='ui-dialog-content ui-widget-content modal-dialog crm-ajax-container']/form/div[2]/div", 'Are you sure you want to delete this record?');
+ $this->waitForText("css=.ui-dialog-content.crm-ajax-container", 'Are you sure you want to delete this record?');
$this->click('_qf_Edit_upload_delete');
- // Because it tends to cause problems, all uses of sleep() must be justified in comments
- // Sleep should never be used for wait for anything to load from the server
- // Justification for this instance: FIXME
- sleep(3);
+ $this->waitForElementPresent("//a/span[contains(text(), 'Add New Record')]");
$delText = $this->getAlert();
$this->assertEquals("Deleted Your record has been deleted.", $delText);
- // Check the view functionality
- // Because it tends to cause problems, all uses of sleep() must be justified in comments
- // Sleep should never be used for wait for anything to load from the server
- // Justification for this instance: FIXME
- sleep(3);
+
$this->click("//div[@id='custom--table-wrapper']/div/div/table/tbody/tr/td[3]/span/a[text()='View']");
- $this->waitForText("xpath=//div[@class='ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix']", 'View '.$params['customGroupTitle']);
- $this->assertElementContainsText("xpath=//div[@class='ui-dialog-content ui-widget-content modal-dialog crm-ajax-container']", $params['textFieldLabel']);
+ $this->waitForText("css=.ui-dialog-title", 'View '.$params['customGroupTitle'] . ' Record');
+ $this->assertElementContainsText("css=.ui-dialog-content.crm-ajax-container", $params['textFieldLabel']);
if ($checkSearchable) {
$this->verifyElementNotPresent("//div[@id='profile-dialog']/div/div/div/div/div[1]/div[2]/a");
return array($gid, $profileTitle);
$this->waitForElementPresent("//input[@id='is_multiple']");
$this->click("//input[@id='is_multiple']");
$this->type("max_multiple", 3);
- $this->click("//form[@id='Group']/div[2]/div[3]/span[1]/input");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink("//form[@id='Group']/div[2]/div[3]/span[1]/input");
//Is custom group created?
$this->assertElementContainsText('crm-container', $params['customGroupTitle']);
+
+ $gid = $this->urlArg('gid');
+ $this->openCiviPage('admin/custom/group/field/add', 'reset=1&action=add&gid=' . $gid);
+
//add custom field - alphanumeric text
$params['textFieldLabel'] = 'test_text_field' . substr(sha1(rand()), 0, 3);
$this->click("header");
$this->click("is_searchable");
//clicking save
- $this->click("_qf_Field_next-bottom");
+ $this->click("_qf_Field_done-bottom");
//Is custom field created?
$this->waitForText('crm-notification-container', $params['selectFieldLabel']);
*
* @return mixed
*/
- function _addRecords($context = 'Edit', $parentElement = '//') {
+ function _addRecords($context = 'Edit', $dialog = FALSE) {
$params['text'] = 'text' . substr(sha1(rand()), 0, 3);
$this->waitForElementPresent("//div[@id='crm-profile-block']/div/div[2]/input[@class='crm-form-text required']");
$this->type("//div[@id='crm-profile-block']/div/div[2]/input[@class='crm-form-text required']", $params['text']);
$this->type('email-Primary', $params['email']);
$this->waitForElementPresent("//div[@id='crm-profile-block']//div/div[2]/select");
$this->select("//div[@id='crm-profile-block']//div/div[2]/select",'value=1');
- $this->click("xpath=//div[@id='crm-profile-block']//div[@class='crm-submit-buttons']/span/input[@class='validate crm-form-submit default crm-form-submit']");
}
else {
$this->waitForElementPresent("//div[@id='crm-profile-block']//div/div[2]/select");
$this->select("//div[@id='crm-profile-block']//div/div[2]/select",'value=1');
- $this->click("xpath=//div[@class='ui-dialog-content ui-widget-content modal-dialog crm-ajax-container']/form/div[2]//div[@id='crm-profile-block']//div[@class='crm-submit-buttons']/span/input[@class='validate crm-form-submit default crm-form-submit']");
+
+ }
+ if ($dialog) {
+ $this->click("css=.ui-dialog-buttonset button[data-identifier=_qf_Edit_next]");
+ }
+ else {
+ $this->click("_qf_Edit_next");
}
return $params;
}