3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License along with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
27 require_once 'CiviTest/CiviSeleniumTestCase.php';
30 * Class WebTest_Contact_DupeContactTest
32 class WebTest_Contact_DupeContactTest
extends CiviSeleniumTestCase
{
34 protected function setUp() {
38 public function testDuplicateContactAdd() {
39 $this->webtestLogin();
41 $this->openCiviPage('contact/add', 'reset=1&ct=Individual');
43 $firstName = substr(sha1(rand()), 0, 7);
44 $lastName1 = substr(sha1(rand()), 0, 7);
45 $email = "{$firstName}@example.com";
46 $lastName2 = substr(sha1(rand()), 0, 7);
48 //contact details section
50 $this->click("prefix_id");
51 $this->select("prefix_id", "value=3");
54 $this->type("first_name", "$firstName");
57 $this->type("last_name", "$lastName1");
60 $this->type("email_1_email", "$email");
62 //check for matching contact
63 //$this->click("_qf_Contact_refresh_dedupe");
64 //$this->waitForPageToLoad($this->getTimeoutMsec());
67 $this->click("_qf_Contact_upload_view");
68 $this->waitForPageToLoad($this->getTimeoutMsec());
69 $this->waitForText('crm-notification-container', "Contact Saved");
71 $this->openCiviPage('contact/add', 'reset=1&ct=Individual');
73 //contact details section
76 $this->type("first_name", "$firstName");
79 $this->type("last_name", "$lastName1");
82 $this->type("email_1_email", "$email");
85 $this->click("_qf_Contact_upload_view");
86 $this->waitForPageToLoad($this->getTimeoutMsec());
88 $this->assertElementContainsText("css=.notify-content", "Please correct the following errors in the form fields below: One matching contact was found. You can View or Edit the existing contact.");