<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
require_once 'CRM/Utils/Array.php';
class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase {
* @params string $mode import mode
* @params array $fieldMapper select mapper fields while import
* @params array $other other parameters
- * useMappingName : to reuse mapping
+ * useMappingName : to reuse mapping
+
* dateFormat : date format of data
* checkMapperHeaders : to override default check mapper headers
* saveMapping : save current mapping?
}
// Submit form.
- $this->click('_qf_UploadFile_upload');
+ $this->click('_qf_DataSource_upload');
$this->waitForPageToLoad($this->getTimeoutMsec());
// Select matching field for cvs data.
$this->_checkImportMapperData($headers, $rows, $existingMapping, isset($other['checkMapperHeaders']) ? $other['checkMapperHeaders'] : array());
// Submit form.
- $this->click('_qf_Preview_next-bottom');
- $this->waitForPageToLoad($this->getTimeoutMsec());
-
- // Visit summary page.
- $this->waitForElementPresent("_qf_Summary_next");
+ $this->clickLink('_qf_Preview_next-bottom', "_qf_Summary_next");
// Check success message.
$this->assertTrue($this->isTextPresent("Import has completed successfully. The information below summarizes the results."));
* @params string $mode import mode
* @params array $fieldMapper select mapper fields while import
* @params array $other other parameters
- * contactSubtype : import for selected Contact Subtype
+ * contactSubtype : import for selected Contact Subtype
+
* useMappingName : to reuse mapping
* dateFormat : date format of data
* checkMapperHeaders : to override default check mapper headers
* callbackImportSummary : function to override default import summary assertions
*
* @params string $type import type (csv/sql)
- * @todo:currently only supports csv, need to work on sql import
+ * @todo:currently only supports csv, need to work on sql import
+
*/
function importContacts($headers, $rows, $contactType = 'Individual', $mode = 'Skip', $fieldMapper = array(
), $other = array(), $type = 'csv') {
*
* @params string $component component name
*
- * @return string import url
+ * @return string import url
+
*/
function _getImportComponentUrl($component) {
*
* @params string $component component name
*
- * @return string import url
+ * @return string import url
+
*/
function _getImportComponentContactType($component, $contactType) {
$importComponentMode = array(
* Helper function to get imported contact ids.
*
* @params array $rows fields rows
- * @params string $contactType contact type
+ * @params string $contactType contact type
+
*
* @return array $contactIds imported contact ids
*/
$this->typeKeys("css=input#sort_name_navigation", $searchName);
// 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());
// Get contact id from url.
- $matches = array();
- preg_match('/cid=([0-9]+)/', $this->getLocation(), $matches);
- $contactIds[] = $matches[1];
+ $contactIds[] = $this->urlArg('cid');
}
return $contactIds;