Commit | Line | Data |
---|---|---|
eac2f71b | 1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
81621fee | 4 | | CiviCRM version 4.7 | |
eac2f71b | 5 | +--------------------------------------------------------------------+ |
e7112fa7 | 6 | | Copyright CiviCRM LLC (c) 2004-2015 | |
eac2f71b | 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 | +--------------------------------------------------------------------+ | |
d25dd0ee | 25 | */ |
eac2f71b | 26 | |
27 | /** | |
28 | * Description of AddRecurringEventTest | |
29 | * | |
30 | * @author Priyanka | |
31 | */ | |
32 | ||
33 | require_once 'CiviTest/CiviSeleniumTestCase.php'; | |
34 | ||
7fe37828 EM |
35 | /** |
36 | * Class WebTest_Event_AddRecurringEventTest | |
37 | */ | |
eac2f71b | 38 | class WebTest_Event_AddRecurringEventTest extends CiviSeleniumTestCase { |
39 | ||
40 | protected function setUp() { | |
41 | parent::setUp(); | |
42 | } | |
43 | ||
00be9182 | 44 | public function testRecurringEvent() { |
b1d50716 | 45 | $this->markTestSkipped('Skipping for now as it works fine locally.'); |
eac2f71b | 46 | $this->webtestLogin(); |
47 | ||
48 | //Add repeat configuration for an event | |
49 | $this->openCiviPage("event/manage/repeat", "reset=1&action=update&id=1", '_qf_Repeat_cancel-bottom'); | |
50 | ||
51 | $this->click('repetition_frequency_unit'); | |
df519dcf | 52 | $this->select('repetition_frequency_unit', 'label=week'); |
eac2f71b | 53 | $this->click('repetition_frequency_interval'); |
54 | $this->select('repetition_frequency_interval', 'label=1'); | |
55 | $this->click('start_action_condition_monday'); | |
56 | $this->click('start_action_condition_tuesday'); | |
57 | $this->click('CIVICRM_QFID_1_ends'); | |
58 | ||
59 | $occurrences = rand(3, 5); | |
60 | if (!$occurrences) { | |
61 | $occurrences = 3; | |
62 | } | |
06dfe3b5 | 63 | $this->select('start_action_offset', $occurrences); |
64 | $this->multiselect2('exclude_date_list', array('05/11/2015', '05/12/2015'), TRUE); | |
eac2f71b | 65 | $this->click('_qf_Repeat_submit-bottom'); |
b303b743 | 66 | $this->waitForTextPresent('A repeating set will be created with the following dates.'); |
06dfe3b5 | 67 | $this->click("xpath=//button//span[text()='Continue']"); |
eac2f71b | 68 | $this->waitForAjaxContent(); |
69 | $this->checkCRMAlert('Repeat Configuration has been saved'); | |
70 | ||
71 | //Check if assertions are correct | |
06dfe3b5 | 72 | $this->waitForElementPresent("xpath=//div[@id='recurring-entity-block']/following-sibling::div//div[@class='crm-accordion-body']/div/table/tbody/tr"); |
73 | $count = $this->getXpathCount("xpath=//div[@id='recurring-entity-block']/following-sibling::div//div[@class='crm-accordion-body']/div/table/tbody/tr"); | |
eac2f71b | 74 | $this->assertEquals($occurrences, $count); |
75 | ||
76 | //Lets go to find participant page and see our repetitive events there | |
77 | $this->openCiviPage("event/manage", "reset=1"); | |
78 | $eventTitle = "Fall Fundraiser Dinner"; | |
79 | $this->type("title", $eventTitle); | |
80 | $this->click("_qf_SearchEvent_refresh"); | |
04374d9d | 81 | $this->assertTrue($this->isTextPresent("Repeating")); |
eac2f71b | 82 | |
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']"); | |
38653166 | 87 | $this->waitForTextPresent("Event Title"); |
eac2f71b | 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']"); | |
06dfe3b5 | 91 | $this->click("recur-all-entity"); |
92 | $this->click("xpath=//button//span[text()='Continue']"); | |
eac2f71b | 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++) { | |
f78f9745 | 102 | $this->verifyText("xpath=//div[@id='option11_wrapper']/table[@id='option11']/tbody/tr/td[1]/a", 'CiviCon'); |
eac2f71b | 103 | } |
104 | } | |
105 | } | |
106 | ||
107 | } |