3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.3 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2013 |
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. |
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';
28 class WebTest_Generic_CheckActivityTest
extends CiviSeleniumTestCase
{
30 protected function setUp() {
34 function testCheckDashboardElements() {
35 // Log in using webtestLogin() method
36 $this->webtestLogin();
38 // Adding contact with randomized first name
39 // We're using Quick Add block on the main page for this.
40 $contactFirstName1 = substr(sha1(rand()), 0, 7);
41 $this->webtestAddContact($contactFirstName1, "Devis", TRUE);
43 // Adding another contact with randomized first name
44 // We're using Quick Add block on the main page for this.
45 $contactFirstName2 = substr(sha1(rand()), 0, 7);
46 $this->webtestAddContact($contactFirstName2, "Anderson", TRUE);
47 $this->openCiviPage("activity", "reset=1&action=add&context=standalone", "_qf_Activity_upload");
49 $this->select("activity_type_id", "label=Meeting");
51 $this->click("css=tr.crm-activity-form-block-target_contact_id input#token-input-contact_1");
52 $this->type("css=tr.crm-activity-form-block-target_contact_id input#token-input-contact_1", "$contactFirstName1");
53 $this->typeKeys("css=tr.crm-activity-form-block-target_contact_id input#token-input-contact_1", "$contactFirstName1");
55 // ...waiting for drop down with results to show up...
56 $this->waitForElementPresent("css=div.token-input-dropdown-facebook");
57 $this->waitForElementPresent("css=li.token-input-dropdown-item2-facebook");
59 // ...need to use mouseDownAt on first result (which is a li element), click does not work
60 $this->mouseDownAt("css=li.token-input-dropdown-item2-facebook");
62 // ...again, waiting for the box with contact name to show up (span with delete token class indicates that it's present)...
63 $this->waitForElementPresent("css=tr.crm-activity-form-block-target_contact_id td ul li span.token-input-delete-token-facebook");
65 // Now we're doing the same for "Assigned To" field.
66 // Typing contact's name into the field (using typeKeys(), not type()!)...
67 $this->click("css=tr.crm-activity-form-block-assignee_contact_id input#token-input-assignee_contact_id");
68 $this->type("css=tr.crm-activity-form-block-assignee_contact_id input#token-input-assignee_contact_id", "$contactFirstName2");
69 $this->typeKeys("css=tr.crm-activity-form-block-assignee_contact_id input#token-input-assignee_contact_id", "$contactFirstName2");
71 // ...waiting for drop down with results to show up...
72 $this->waitForElementPresent("css=div.token-input-dropdown-facebook");
73 $this->waitForElementPresent("css=li.token-input-dropdown-item2-facebook");
75 //..need to use mouseDownAt on first result (which is a li element), click does not work
76 $this->mouseDownAt("css=li.token-input-dropdown-item2-facebook");
78 // ...again, waiting for the box with contact name to show up...
79 $this->waitForElementPresent("css=tr.crm-activity-form-block-assignee_contact_id td ul li span.token-input-delete-token-facebook");