*/
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Import_ContactCustomDataTest
+ */
class WebTest_Import_ContactCustomDataTest extends ImportCiviSeleniumTestCase {
protected function setUp() {
$this->click("xpath=//div[@id='browseValues_Individual']/div[2]/a/span");
$this->waitForElementPresent('_qf_DedupeRules_next-bottom');
$this->type('title', $newRuleTitle);
- $this->click("CIVICRM_QFID_1_used");
+ $this->click("CIVICRM_QFID_Supervised_used");
$this->select("where_0", "label=$customDataParams[1]");
$this->type('weight_0', '10');
$this->type('threshold', '10');
$this->click('_qf_DedupeRules_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("The rule '{$newRuleTitle}' has been saved."));
+ $this->waitForText("crm-notification-container", "The rule '{$newRuleTitle}' has been saved.");
$rgId = explode('&rgid=', $this->getAttribute("xpath=//div[@id='browseValues_Individual']//table/tbody//tr/td[text()='{$newRuleTitle}']/../td[3]/span/a[text()='Use Rule']@href"));
$rgId = explode('&', $rgId[1]);
// Add Contact
$firstName2 = 'An_' . substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName2, "Summerson");
- $this->waitForPageToLoad($this->getTimeoutMsec());
// Edit and expand all tabs
$this->click('link=Edit');
$this->typeKeys('css=input#sort_name_navigation', $firstName1);
// Wait for result list.
- $this->waitForElementPresent("css=div.ac_results-inner li");
+ $this->waitForElementPresent("css=ul.ui-autocomplete li");
// Visit contact summary page.
- $this->click("css=div.ac_results-inner li");
+ $this->click("css=ul.ui-autocomplete li");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertTrue($this->isTextPresent('This is a test field'));
}
/*
* Helper function to provide data for custom data import.
*/
+ /**
+ * @param $customDataParams
+ * @param $firstName1
+ *
+ * @return array
+ */
function _individualCustomCSVData($customDataParams, $firstName1) {
$headers = array(
'first_name' => 'First Name',
return array($headers, $rows);
}
+ /**
+ * @param $originalHeaders
+ * @param $originalRows
+ * @param $checkSummary
+ */
function checkDuplicateContacts($originalHeaders, $originalRows, $checkSummary) {
$this->assertTrue($this->isTextPresent('CiviCRM has detected one record which is a duplicate of existing CiviCRM contact record. These records have not been imported.'));
}
+ /**
+ * @return array
+ */
function _addCustomData() {
$this->openCiviPage("admin/custom/group", "reset=1");
$this->click('extends[0]');
$this->select('extends[0]', "value=Contact");
$this->click("//option[@value='Contact']");
- $this->click('_qf_Group_next-bottom');
- $this->waitForElementPresent('_qf_Field_cancel-bottom');
+ $this->clickLink('_qf_Group_next-bottom');
//Is custom group created?
$this->waitForText('crm-notification-container', $customGroupTitle);
+ $this->waitForElementPresent('_qf_Field_cancel-bottom');
$gid = $this->urlArg('gid');
// create another custom field - Date
$this->click("is_searchable");
// clicking save
- $this->click('_qf_Field_next-bottom');
- $this->waitForElementPresent('newCustomField');
+ $this->click('_qf_Field_done-bottom');
+ $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td");
- $this->assertTrue($this->isTextPresent("Your custom field '{$customField}' has been saved."));
+ $this->waitForText('crm-notification-container', "Custom field '{$customField}' has been saved.");
$customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField']/../../td[8]/span/a@href"));
$customFieldId = $customFieldId[1];