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 +--------------------------------------------------------------------+
28 * Description of AddRecurringEventTest
33 require_once 'CiviTest/CiviSeleniumTestCase.php';
36 * Class WebTest_Event_AddRecurringEventTest
38 class WebTest_Event_AddRecurringEventTest
extends CiviSeleniumTestCase
{
40 protected function setUp() {
44 public function testRecurringEvent() {
45 $this->webtestLogin();
47 //Add repeat configuration for an event
48 $this->openCiviPage("event/manage/repeat", "reset=1&action=update&id=1", '_qf_Repeat_cancel-bottom');
50 $this->click('repetition_frequency_unit');
51 $this->select('repetition_frequency_unit', 'label=week');
52 $this->click('repetition_frequency_interval');
53 $this->select('repetition_frequency_interval', 'label=1');
54 $this->click('start_action_condition_monday');
55 $this->click('start_action_condition_tuesday');
56 $this->click('CIVICRM_QFID_1_ends');
58 $occurrences = rand(3, 5);
62 $this->select('start_action_offset', $occurrences);
63 $this->multiselect2('exclude_date_list', array('05/11/2015', '05/12/2015'), TRUE);
64 $this->click('_qf_Repeat_submit-bottom');
65 $this->waitForTextPresent('A recurring set will be created with the following dates.');
66 $this->click("xpath=//button//span[text()='Continue']");
67 $this->waitForAjaxContent();
68 $this->checkCRMAlert('Repeat Configuration has been saved');
70 //Check if assertions are correct
71 $this->waitForElementPresent("xpath=//div[@id='recurring-entity-block']/following-sibling::div//div[@class='crm-accordion-body']/div/table/tbody/tr");
72 $count = $this->getXpathCount("xpath=//div[@id='recurring-entity-block']/following-sibling::div//div[@class='crm-accordion-body']/div/table/tbody/tr");
73 $this->assertEquals($occurrences, $count);
75 //Lets go to find participant page and see our repetitive events there
76 $this->openCiviPage("event/manage", "reset=1");
77 $eventTitle = "Fall Fundraiser Dinner";
78 $this->type("title", $eventTitle);
79 $this->click("_qf_SearchEvent_refresh");
80 $this->assertTrue($this->isTextPresent("Recurring Event - (Child)"));
81 $this->assertTrue($this->isTextPresent("Recurring Event - (Parent)"));
83 //Update Mode Cascade Changes
84 $this->click('event-configure-1');
85 $this->waitForElementPresent("xpath=//span[@id='event-configure-1']/ul[@class='panel']/li/a[text()='Info and Settings']");
86 $this->click("xpath=//span[@id='event-configure-1']/ul[@class='panel']/li/a[text()='Info and Settings']");
87 $this->waitForElementPresent('_qf_EventInfo_cancel-bottom');
88 $this->type('title', 'CiviCon');
89 $this->click('_qf_EventInfo_upload_done-top');
90 $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Cancel']");
91 $this->click("recur-all-entity");
92 $this->click("xpath=//button//span[text()='Continue']");
93 $this->waitForAjaxContent();
94 $this->openCiviPage("event/manage", "reset=1");
95 $newEventTitle = "CiviCon";
96 $this->type("title", $newEventTitle);
97 $this->click("_qf_SearchEvent_refresh");
98 $this->waitForPageToLoad();
99 $countOfEvents = $this->getXpathCount("xpath=//div[@id='option11_wrapper']/table[@id='option11']/tbody/tr");
100 if ($countOfEvents) {
101 for ($i = 0; $i <= $countOfEvents; $i++
) {
102 $this->verifyText("xpath=//div[@id='option11_wrapper']/table[@id='option11']/tbody/tr/td[1]/a", 'CiviCon');