Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
06a1bc01 | 4 | | CiviCRM version 4.5 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
06a1bc01 | 6 | | Copyright CiviCRM LLC (c) 2004-2014 | |
6a488035 TO |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
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. | | |
13 | | | | |
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. | | |
18 | | | | |
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 | +--------------------------------------------------------------------+ | |
25 | */ | |
26 | ||
6a488035 TO |
27 | require_once 'CiviTest/CiviSeleniumTestCase.php'; |
28 | class WebTest_Admin_Form_ScheduleReminderTest extends CiviSeleniumTestCase { | |
29 | ||
30 | protected function setUp() { | |
31 | parent::setUp(); | |
32 | } | |
33 | ||
34 | function testScheduleReminder() { | |
6a488035 TO |
35 | $this->webtestLogin(); |
36 | ||
37 | // Add new Schedule Reminder | |
42daf119 | 38 | $this->openCiviPage("admin/scheduleReminders", "action=add&reset=1", '_qf_ScheduleReminders_cancel-bottom'); |
6a488035 TO |
39 | |
40 | // Fill Title | |
41 | $title = 'Title' . substr(sha1(rand()), 0, 4); | |
42 | $this->type('title', $title); | |
43 | ||
44 | // Fill Entity Details | |
45 | $this->click('entity_0'); | |
46 | $this->select('entity_0', 'label=Activity'); | |
47 | $this->addSelection('entity_1', 'label=Meeting'); | |
48 | $this->addSelection('entity_2', 'label=Completed'); | |
49 | $this->select('start_action_offset', 'label=1'); | |
50 | $this->select('start_action_condition', 'label=after'); | |
51 | $this->click('is_repeat'); | |
52 | $this->select('repetition_frequency_interval', 'label=1'); | |
53 | $this->click('recipient'); | |
54 | $this->select('recipient', 'label=Activity Assignees'); | |
55 | ||
56 | // Fill Subject | |
57 | $subject = 'subject' . substr(sha1(rand()), 0, 4); | |
58 | $this->type('subject', $subject); | |
59 | ||
60 | //click on save | |
61 | $this->click('_qf_ScheduleReminders_next-bottom'); | |
62 | $this->waitForPageToLoad($this->getTimeoutMsec()); | |
63 | ||
1d4d99e9 | 64 | $this->click("//div[@id='reminder']//div[@id='option11_wrapper']/table/tbody//tr/td[1][text()='{$title}']/../td[7]/span/a[text()='Edit']"); |
6a488035 TO |
65 | $this->waitForElementPresent('_qf_ScheduleReminders_cancel-bottom'); |
66 | ||
67 | $this->assertEquals($title, $this->getValue('id=title')); | |
68 | $this->removeSelection('entity_1', 'label=Meeting'); | |
69 | $this->addSelection('entity_1', 'label=Phone Call'); | |
70 | $this->addSelection('entity_1', 'label=Interview'); | |
71 | $this->removeSelection('entity_2', 'label=Completed'); | |
72 | $this->addSelection('entity_2', 'label=Scheduled'); | |
73 | $this->addSelection('entity_2', 'label=Completed'); | |
74 | ||
75 | $this->assertEquals('1', $this->getSelectedValue('id=start_action_offset')); | |
76 | $this->assertEquals('hour', $this->getSelectedValue('id=start_action_unit')); | |
77 | $this->assertEquals('after', $this->getSelectedValue('id=start_action_condition')); | |
78 | $this->assertEquals('activity_date_time', $this->getSelectedValue('id=start_action_date')); | |
79 | ||
80 | $this->assertChecked('is_repeat'); | |
81 | ||
82 | $this->assertEquals('1', $this->getSelectedValue('id=recipient')); | |
83 | $this->assertChecked('is_active'); | |
84 | } | |
85 | } | |
86 |