<?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 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase {
* Test contact import for Individuals Duplicate Matching.
*/
function testIndividualDuplicateMatchingImport() {
- // This is the path where our testing install resides.
- // The rest of URL is defined in CiviSeleniumTestCase base class, in
- // class attributes.
- $this->open($this->sboxPath);
-
- // Logging in. Remember to wait for page to load. In most cases,
- // you can rely on 30000 as the value that allows your test to pass, however,
- // sometimes your test might fail because of this. In such cases, it's better to pick one element
- // somewhere at the end of page and use waitForElementPresent on it - this assures you, that whole
- // page contents loaded and you can continue your test execution.
$this->webtestLogin();
- // Go directly to the URL of New Individual.
- $this->open($this->sboxPath . 'civicrm/contact/add?reset=1&ct=Individual');
- $this->waitForElementPresent('first_name');
+ $this->openCiviPage("contact/add", "reset=1&ct=Individual", 'first_name');
$email = substr(sha1(rand()), 0, 7) . '@example.com';
// Clicking save.
$this->click('_qf_Contact_upload_view');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertElementContainsText('crm-notification-container', "Contact Saved");
+ $this->waitForText('crm-notification-container', "Contact Saved");
$existingContact = array(
'first_name' => $firstName,
$this->importContacts($fillHeaders, $fillRows, 'Individual', 'Fill');
foreach ($importedContactIds as $cid) {
- $this->open($this->sboxPath . "civicrm/contact/view?reset=1&cid={$cid}");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage("contact/view", "reset=1&cid={$cid}");
// Check old display name.
$displayName = "{$updateRows[$cid]['first_name']} {$updateRows[$cid]['last_name']}";
* Test contact import for Organization Duplicate Matching.
*/
function testOrganizationDuplicateMatchingImport() {
- // This is the path where our testing install resides.
- // The rest of URL is defined in CiviSeleniumTestCase base class, in
- // class attributes.
- $this->open($this->sboxPath);
-
- // Logging in. Remember to wait for page to load. In most cases,
- // you can rely on 30000 as the value that allows your test to pass, however,
- // sometimes your test might fail because of this. In such cases, it's better to pick one element
- // somewhere at the end of page and use waitForElementPresent on it - this assures you, that whole
- // page contents loaded and you can continue your test execution.
$this->webtestLogin();
//create oranization
- $this->open($this->sboxPath . 'civicrm/contact/add?reset=1&ct=Organization');
- $this->waitForElementPresent('organization_name');
+ $this->openCiviPage("contact/add", "reset=1&ct=Organization", 'organization_name');
// get value for organization contact
$organizationName = 'org_' . substr(sha1(rand()), 0, 7);
// Get imported contact Ids
$importedContactIds = $this->_getImportedContactIds($rows, 'Organization');
-
// Build update mode import headers
$updateHeaders = array(
'email' => 'Email',
$this->importContacts($fillHeaders, $fillRows, 'Organization', 'Fill');
foreach ($importedContactIds as $cid) {
- $this->open($this->sboxPath . "civicrm/contact/view?reset=1&cid={$cid}");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage("contact/view", "reset=1&cid={$cid}");
// Check old Organization name.
$organizationName = $updateRows[$cid]['organization_name'];
* Test contact import for Household Duplicate Matching.
*/
function testHouseholdDuplicateMatchingImport() {
- // This is the path where our testing install resides.
- // The rest of URL is defined in CiviSeleniumTestCase base class, in
- // class attributes.
- $this->open($this->sboxPath);
-
- // Logging in. Remember to wait for page to load. In most cases,
- // you can rely on 30000 as the value that allows your test to pass, however,
- // sometimes your test might fail because of this. In such cases, it's better to pick one element
- // somewhere at the end of page and use waitForElementPresent on it - this assures you, that whole
- // page contents loaded and you can continue your test execution.
$this->webtestLogin();
// create household
- $this->open($this->sboxPath . 'civicrm/contact/add?reset=1&ct=Household');
- $this->waitForElementPresent('household_name');
+ $this->openCiviPage("contact/add", "reset=1&ct=Household", 'household_name');
// get values for household contact
$householdName = 'household_' . substr(sha1(rand()), 0, 7);
$this->importContacts($fillHeaders, $fillRows, 'Household', 'Fill');
foreach ($importedContactIds as $cid) {
- $this->open($this->sboxPath . "civicrm/contact/view?reset=1&cid={$cid}");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage("contact/view", "reset=1&cid={$cid}");
// Check old Household name.
$householdName = $updateRows[$cid]['household_name'];