Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
2fe49090 | 4 | | CiviCRM version 5 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
8c9251b3 | 6 | | Copyright CiviCRM LLC (c) 2004-2018 | |
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 | +--------------------------------------------------------------------+ | |
d25dd0ee | 25 | */ |
6a488035 | 26 | |
6a488035 | 27 | require_once 'CiviTest/CiviSeleniumTestCase.php'; |
e9479dcf EM |
28 | |
29 | /** | |
30 | * Class WebTest_Event_AddParticipationTest | |
31 | */ | |
6a488035 TO |
32 | class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { |
33 | ||
34 | protected function setUp() { | |
35 | parent::setUp(); | |
36 | } | |
37 | ||
00be9182 | 38 | public function testEventParticipationAdd() { |
6a488035 TO |
39 | $this->webtestLogin(); |
40 | ||
41 | // Adding contact with randomized first name (so we can then select that contact when creating event registration) | |
6a488035 TO |
42 | $firstName = substr(sha1(rand()), 0, 7); |
43 | $this->webtestAddContact($firstName, 'Anderson', TRUE); | |
6a488035 TO |
44 | $displayName = "$firstName Anderson"; |
45 | ||
c038a4f0 | 46 | $this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", "_qf_Participant_upload-bottom"); |
6a488035 | 47 | |
6a488035 TO |
48 | // Type contact last name in contact auto-complete, wait for dropdown and click first result |
49 | $this->webtestFillAutocomplete($firstName); | |
50 | ||
51 | // Select event. Based on label for now. | |
33cf86bd | 52 | $this->select2('event_id', "Rain-forest Cup Youth Soccer Tournament"); |
6a488035 TO |
53 | |
54 | // Select role | |
673c7418 | 55 | $this->multiselect2('role_id', array('Volunteer')); |
6a488035 TO |
56 | |
57 | // Choose Registration Date. | |
58 | // Using helper webtestFillDate function. | |
59 | $this->webtestFillDate('register_date', 'now'); | |
60 | $today = date('F jS, Y', strtotime('now')); | |
6a488035 TO |
61 | |
62 | // Select participant status | |
33cf86bd | 63 | $this->select('status_id', 'value=1'); |
6a488035 TO |
64 | |
65 | // Setting registration source | |
66 | $this->type('source', 'Event StandaloneAddTest Webtest'); | |
67 | ||
68 | // Since we're here, let's check of screen help is being displayed properly | |
69 | $this->assertTrue($this->isTextPresent('Source for this registration (if applicable).')); | |
70 | ||
71 | // Select an event fee | |
72 | $this->waitForElementPresent('priceset'); | |
73 | ||
2861538e | 74 | $this->click("xpath=//input[@class='crm-form-radio']"); |
6a488035 TO |
75 | |
76 | // Enter amount to be paid (note: this should default to selected fee level amount, s/b fixed during 3.2 cycle) | |
77 | $this->type('total_amount', '800'); | |
78 | ||
79 | // Select payment method = Check and enter chk number | |
80 | $this->select('payment_instrument_id', 'value=4'); | |
81 | $this->waitForElementPresent('check_number'); | |
82 | $this->type('check_number', '1044'); | |
83 | ||
84 | // go for the chicken combo (obviously) | |
85 | // $this->click('CIVICRM_QFID_chicken_Chicken'); | |
48b420d7 | 86 | |
5dc17bfe DG |
87 | $this->waitForElementPresent('send_receipt'); |
88 | $this->assertTrue($this->isChecked("send_receipt"), 'Send Confirmation and Receipt checkbox should be checked by default but is not checked.'); | |
48b420d7 | 89 | |
6a488035 | 90 | // Clicking save. |
e42c089b | 91 | $this->clickLink('_qf_Participant_upload-bottom'); |
6a488035 TO |
92 | |
93 | // Is status message correct? | |
e42c089b | 94 | $this->checkCRMAlert("Event registration for $displayName has been added"); |
6a488035 | 95 | |
752b08dc | 96 | $this->waitForElementPresent("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); |
6a488035 | 97 | //click through to the participant view screen |
e0f528d0 | 98 | $this->clickAjaxLink("xpath=//*[@id='Search']/table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom'); |
6a488035 | 99 | |
6a488035 TO |
100 | $this->webtestVerifyTabularData( |
101 | array( | |
102 | 'Event' => 'Rain-forest Cup Youth Soccer Tournament', | |
103 | 'Participant Role' => 'Attendee', | |
104 | 'Status' => 'Registered', | |
105 | 'Event Source' => 'Event StandaloneAddTest Webtest', | |
2861538e | 106 | 'Fees' => '$ 800.00', |
6a488035 TO |
107 | ) |
108 | ); | |
109 | // check contribution record as well | |
110 | //click through to the contribution view screen | |
e42c089b | 111 | $this->clickAjaxLink("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ContributionView_cancel-bottom'); |
6a488035 TO |
112 | |
113 | $this->webtestVerifyTabularData( | |
114 | array( | |
115 | 'From' => $displayName, | |
116 | 'Financial Type' => 'Event Fee', | |
117 | 'Total Amount' => '$ 800.00', | |
118 | 'Contribution Status' => 'Completed', | |
4db803dd | 119 | 'Payment Method' => 'Check', |
6a488035 TO |
120 | 'Check Number' => '1044', |
121 | ) | |
122 | ); | |
123 | } | |
124 | ||
00be9182 | 125 | public function testEventParticipationAddWithMultipleRoles() { |
6a488035 TO |
126 | $this->webtestLogin(); |
127 | ||
128 | // Adding contact with randomized first name (so we can then select that contact when creating event registration) | |
6a488035 TO |
129 | $firstName = substr(sha1(rand()), 0, 7); |
130 | $this->webtestAddContact($firstName, 'Anderson', TRUE); | |
6a488035 TO |
131 | $displayName = "$firstName Anderson"; |
132 | ||
133 | // add custom data for participant role | |
c038a4f0 | 134 | $this->openCiviPage("admin/custom/group", "reset=1"); |
6a488035 TO |
135 | |
136 | //add new custom data | |
e42c089b | 137 | $this->clickLink("//a[@id='newCustomDataGroup']/span"); |
6a488035 TO |
138 | |
139 | //fill custom group title | |
140 | $customGroupTitle = 'custom_' . substr(sha1(rand()), 0, 7); | |
141 | $this->click('title'); | |
142 | $this->type('title', $customGroupTitle); | |
143 | ||
144 | //custom group extends | |
145 | $this->click('extends[0]'); | |
146 | $this->select('extends[0]', 'value=ParticipantRole'); | |
147 | ||
148 | $this->click('extends[1][]'); | |
149 | $this->select('extends[1][]', 'value=2'); | |
150 | ||
151 | $this->click("//option[@value='Contact']"); | |
e42c089b | 152 | $this->clickLink('_qf_Group_next'); |
6a488035 TO |
153 | |
154 | //Is custom group created? | |
e42c089b | 155 | $this->checkCRMAlert("Your custom field set '$customGroupTitle' has been added. You can add custom fields now."); |
6a488035 TO |
156 | |
157 | //add custom field - alphanumeric checkbox | |
e42c089b | 158 | $this->waitForAjaxContent(); |
6a488035 TO |
159 | $checkboxFieldLabel = 'custom_field' . substr(sha1(rand()), 0, 4); |
160 | $this->click('label'); | |
161 | $this->type('label', $checkboxFieldLabel); | |
162 | $this->click('data_type[1]'); | |
163 | $this->select('data_type[1]', 'value=CheckBox'); | |
164 | $this->click("//option[@value='CheckBox']"); | |
165 | $checkboxOptionLabel1 = 'optionLabel_' . substr(sha1(rand()), 0, 5); | |
166 | $this->type('option_label_1', $checkboxOptionLabel1); | |
167 | $this->type('option_value_1', '1'); | |
168 | $checkboxOptionLabel2 = 'optionLabel_' . substr(sha1(rand()), 0, 5); | |
169 | $this->type('option_label_2', $checkboxOptionLabel2); | |
170 | $this->type('option_value_2', '2'); | |
171 | $this->click('link=another choice'); | |
172 | $checkboxOptionLabel3 = 'optionLabel_' . substr(sha1(rand()), 0, 5); | |
173 | $this->type('option_label_3', $checkboxOptionLabel3); | |
174 | $this->type('option_value_3', '3'); | |
175 | ||
6a488035 TO |
176 | //enter options per line |
177 | $this->type('options_per_line', '2'); | |
178 | ||
179 | //enter pre help message | |
180 | $this->type('help_pre', 'this is field pre help'); | |
181 | ||
182 | //enter post help message | |
183 | $this->type('help_post', 'this field post help'); | |
184 | ||
185 | //Is searchable? | |
186 | $this->click('is_searchable'); | |
187 | ||
188 | //clicking save | |
e42c089b | 189 | $this->click('_qf_Field_done-bottom'); |
6a488035 TO |
190 | |
191 | //Is custom field created? | |
e42c089b CW |
192 | $this->checkCRMAlert("Custom field '$checkboxFieldLabel' has been saved."); |
193 | $this->waitForAjaxContent(); | |
6a488035 TO |
194 | |
195 | //create another custom field - Integer Radio | |
a5d61f09 | 196 | $this->clickPopupLink('newCustomField', '_qf_Field_cancel'); |
6a488035 TO |
197 | $this->click('data_type[0]'); |
198 | $this->select('data_type[0]', 'value=1'); | |
199 | $this->click("//option[@value='1']"); | |
200 | $this->click('data_type[1]'); | |
201 | $this->select('data_type[1]', 'value=Radio'); | |
202 | $this->click("//option[@value='Radio']"); | |
203 | ||
204 | $radioFieldLabel = 'custom_field' . substr(sha1(rand()), 0, 4); | |
205 | $this->type('label', $radioFieldLabel); | |
206 | $radioOptionLabel1 = 'optionLabel_' . substr(sha1(rand()), 0, 5); | |
207 | $this->type('option_label_1', $radioOptionLabel1); | |
208 | $this->type('option_value_1', '1'); | |
209 | $radioOptionLabel2 = 'optionLabel_' . substr(sha1(rand()), 0, 5); | |
210 | $this->type('option_label_2', $radioOptionLabel2); | |
211 | $this->type('option_value_2', '2'); | |
212 | $this->click('link=another choice'); | |
213 | $radioOptionLabel3 = 'optionLabel_' . substr(sha1(rand()), 0, 5); | |
214 | $this->type('option_label_3', $radioOptionLabel3); | |
215 | $this->type('option_value_3', '3'); | |
216 | ||
217 | //select options per line | |
218 | $this->type('options_per_line', '3'); | |
219 | ||
220 | //enter pre help msg | |
221 | $this->type('help_pre', 'this is field pre help'); | |
222 | ||
223 | //enter post help msg | |
224 | $this->type('help_post', 'this is field post help'); | |
225 | ||
226 | //Is searchable? | |
227 | $this->click('is_searchable'); | |
228 | ||
229 | //clicking save | |
a5d61f09 | 230 | $this->clickAjaxLink('_qf_Field_done-bottom'); |
e42c089b | 231 | |
c038a4f0 | 232 | $this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", "_qf_Participant_upload-bottom"); |
6a488035 | 233 | |
6a488035 TO |
234 | // Type contact last name in contact auto-complete, wait for dropdown and click first result |
235 | $this->webtestFillAutocomplete($firstName); | |
236 | ||
237 | // Select event. Based on label for now. | |
33cf86bd | 238 | $this->select2('event_id', "Rain-forest Cup Youth Soccer Tournament"); |
6a488035 TO |
239 | |
240 | // Select roles | |
673c7418 | 241 | $this->multiselect2('role_id', array('Volunteer', 'Host')); |
6a488035 | 242 | |
a90dac23 | 243 | $this->waitForElementPresent("xpath=//div[@class='custom-group custom-group-$customGroupTitle crm-accordion-wrapper collapsed']"); |
244 | $this->click("xpath=//div[@class='custom-group custom-group-$customGroupTitle crm-accordion-wrapper collapsed']//div[1]"); | |
245 | $this->click("xpath=//div[@class='custom-group custom-group-$customGroupTitle crm-accordion-wrapper']//div[2]//table//tbody//tr[2]//td[2]//table//tbody//tr[1]//td[1]//label"); | |
246 | $this->click("xpath=//div[@class='custom-group custom-group-$customGroupTitle crm-accordion-wrapper']//div[2]//table//tbody//tr[4]//td[2]//table//tbody//tr[1]//td[1]//label"); | |
6a488035 TO |
247 | |
248 | // Choose Registration Date. | |
249 | // Using helper webtestFillDate function. | |
250 | $this->webtestFillDate('register_date', 'now'); | |
251 | $today = date('F jS, Y', strtotime('now')); | |
252 | // May 5th, 2010 | |
253 | ||
254 | // Select participant status | |
33cf86bd | 255 | $this->select('status_id', 'value=1'); |
6a488035 TO |
256 | |
257 | // Setting registration source | |
258 | $this->type('source', 'Event StandaloneAddTest Webtest'); | |
259 | ||
260 | // Since we're here, let's check of screen help is being displayed properly | |
261 | $this->assertTrue($this->isTextPresent('Source for this registration (if applicable).')); | |
262 | ||
263 | // Select an event fee | |
2815a5aa | 264 | $this->waitForElementPresent("xpath=//div[@class='crm-event-form-fee-block']"); |
6a488035 | 265 | |
2861538e | 266 | $this->click("xpath=//input[@class='crm-form-radio']"); |
6a488035 TO |
267 | |
268 | // Enter amount to be paid (note: this should default to selected fee level amount, s/b fixed during 3.2 cycle) | |
66d3f51b | 269 | $this->waitForElementPresent('total_amount'); |
6a488035 TO |
270 | $this->type('total_amount', '800'); |
271 | ||
272 | // Select payment method = Check and enter chk number | |
273 | $this->select('payment_instrument_id', 'value=4'); | |
274 | $this->waitForElementPresent('check_number'); | |
275 | $this->type('check_number', '1044'); | |
276 | ||
277 | // Clicking save. | |
e42c089b | 278 | $this->clickLink('_qf_Participant_upload-bottom'); |
6a488035 TO |
279 | |
280 | // Is status message correct? | |
e42c089b | 281 | $this->checkCRMAlert("Event registration for $displayName has been added"); |
6a488035 | 282 | |
2815a5aa | 283 | $this->waitForElementPresent("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table/tbody/tr[1]/td[8]/span/a[text()='View']"); |
6a488035 | 284 | //click through to the participant view screen |
2815a5aa | 285 | $this->clickAjaxLink("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom'); |
6a488035 TO |
286 | |
287 | $this->webtestVerifyTabularData( | |
288 | array( | |
289 | 'Event' => 'Rain-forest Cup Youth Soccer Tournament', | |
290 | 'Participant Role' => 'Attendee, Volunteer, Host', | |
291 | 'Status' => 'Registered', | |
292 | 'Event Source' => 'Event StandaloneAddTest Webtest', | |
2861538e | 293 | 'Fees' => '$ 800.00', |
6a488035 TO |
294 | ) |
295 | ); | |
296 | ||
297 | $this->assertTrue($this->isTextPresent("$customGroupTitle")); | |
298 | $this->assertTrue($this->isTextPresent("$checkboxOptionLabel1")); | |
299 | $this->assertTrue($this->isTextPresent("$radioOptionLabel1")); | |
300 | ||
301 | // check contribution record as well | |
302 | //click through to the contribution view screen | |
e42c089b | 303 | $this->clickAjaxLink("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ContributionView_cancel-bottom'); |
6a488035 TO |
304 | |
305 | $this->webtestVerifyTabularData( | |
306 | array( | |
307 | 'From' => $displayName, | |
308 | 'Financial Type' => 'Event Fee', | |
6a488035 | 309 | 'Contribution Status' => 'Completed', |
4db803dd | 310 | 'Payment Method' => 'Check', |
6a488035 TO |
311 | 'Check Number' => '1044', |
312 | ) | |
313 | ); | |
ba4a1892 | 314 | $this->verifyText("xpath=//table/tbody/tr/td[text()='Total Amount']/following-sibling::td/strong", preg_quote('$ 800.00')); |
6a488035 TO |
315 | } |
316 | ||
00be9182 | 317 | public function testEventAddMultipleParticipants() { |
6a488035 | 318 | $this->webtestLogin(); |
76e86fd8 | 319 | |
80f3b91d | 320 | $processorId = $this->webtestAddPaymentProcessor(); |
42daf119 | 321 | |
c038a4f0 | 322 | $this->openCiviPage("participant/add", "reset=1&action=add&context=standalone&mode=test&eid=3"); |
76e86fd8 | 323 | |
80f3b91d CW |
324 | $contacts = array(); |
325 | ||
40a03aca | 326 | $this->assertTrue($this->isTextPresent("New Event Registration"), "Page title 'New Event Registration' missing"); |
6a488035 | 327 | $this->assertTrue($this->isTextPresent("A TEST transaction will be submitted"), "test mode status 'A TEST transaction will be submitted' missing"); |
80f3b91d CW |
328 | $contacts[] = $this->_fillParticipantDetails($processorId); |
329 | $this->clickLink('_qf_Participant_upload_new-bottom'); | |
76e86fd8 | 330 | |
40a03aca | 331 | $this->assertTrue($this->isTextPresent("New Event Registration"), "Page title 'New Event Registration' missing"); |
6a488035 | 332 | $this->assertTrue($this->isTextPresent("A TEST transaction will be submitted"), "test mode status 'A TEST transaction will be submitted' missing"); |
80f3b91d CW |
333 | $contacts[] = $this->_fillParticipantDetails($processorId); |
334 | $this->clickLink('_qf_Participant_upload_new-bottom'); | |
76e86fd8 | 335 | |
6a488035 | 336 | //searching the paricipants |
c038a4f0 | 337 | $this->openCiviPage("event/search", "reset=1"); |
80f3b91d | 338 | $this->type('sort_name', 'Individual'); |
6a488035 | 339 | $eventName = "Rain-forest Cup Youth Soccer Tournament"; |
e9322446 | 340 | $this->select2("event_id", $eventName, FALSE, FALSE); |
6a488035 | 341 | $this->check('participant_test'); |
80f3b91d | 342 | $this->clickLink("_qf_Search_refresh", "participantSearch"); |
76e86fd8 | 343 | |
6a488035 | 344 | //verifying the registered participants |
6a488035 | 345 | $status = "Registered (test)"; |
76e86fd8 | 346 | |
22e263ad | 347 | foreach ($contacts as $contact) { |
80f3b91d CW |
348 | $this->verifyText("xpath=//div[@id='participantSearch']//table//tbody//tr/td[@class='crm-participant-sort_name']/a[text()='{$contact['sort_name']}']/../../td[9]", preg_quote($status)); |
349 | $this->verifyText("xpath=//div[@id='participantSearch']//table//tbody//tr/td[@class='crm-participant-sort_name']/a[text()='{$contact['sort_name']}']/../../td[4]/a", preg_quote($eventName)); | |
6c6e6187 | 350 | } |
6a488035 TO |
351 | } |
352 | ||
00be9182 | 353 | public function testAjaxCustomGroupLoad() { |
a49e5dea | 354 | $this->markTestSkipped('Skipping for now as it works fine locally.'); |
c4e6d4e8 PJ |
355 | $this->webtestLogin(); |
356 | ||
357 | $customSets = array( | |
6c6e6187 | 358 | array( |
92915c55 TO |
359 | 'entity' => 'ParticipantEventName', |
360 | 'subEntity' => 'Fall Fundraiser Dinner', | |
8d7a9d07 CB |
361 | 'triggerElement' => array( |
362 | 'name' => "event_id", | |
363 | 'type' => "select2", | |
364 | ), | |
92915c55 TO |
365 | ), |
366 | array( | |
367 | 'entity' => 'ParticipantRole', | |
368 | 'subEntity' => 'Attendee', | |
8d7a9d07 CB |
369 | 'triggerElement' => array( |
370 | 'name' => 'role_id', | |
371 | 'type' => "select", | |
372 | ), | |
92915c55 | 373 | ), |
c4e6d4e8 PJ |
374 | ); |
375 | $pageUrl = array('url' => "participant/add", 'args' => "reset=1&action=add&context=standalone"); | |
e42c089b | 376 | $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, TRUE); |
c4e6d4e8 PJ |
377 | } |
378 | ||
8d7a9d07 | 379 | /** |
63dbed83 | 380 | * Webtest for CRM-10983 |
63dbed83 | 381 | */ |
00be9182 | 382 | public function testCheckDuplicateCustomDataLoad() { |
63dbed83 | 383 | $this->webtestLogin(); |
384 | ||
385 | $customSets = array( | |
6c6e6187 | 386 | array( |
92915c55 TO |
387 | 'entity' => 'ParticipantEventType', |
388 | 'subEntity' => '- Any -', | |
8d7a9d07 CB |
389 | 'triggerElement' => array( |
390 | 'name' => "event_id", | |
391 | 'type' => "select", | |
392 | ), | |
92915c55 | 393 | ), |
6c6e6187 | 394 | array( |
92915c55 TO |
395 | 'entity' => 'ParticipantEventName', |
396 | 'subEntity' => '- Any -', | |
8d7a9d07 CB |
397 | 'triggerElement' => array( |
398 | 'name' => "event_id", | |
399 | 'type' => "select", | |
400 | ), | |
92915c55 | 401 | ), |
6c6e6187 | 402 | array( |
92915c55 TO |
403 | 'entity' => 'ParticipantEventName', |
404 | 'subEntity' => 'Rain-forest Cup Youth Soccer Tournament', | |
8d7a9d07 CB |
405 | 'triggerElement' => array( |
406 | 'name' => "event_id", | |
407 | 'type' => "select", | |
408 | ), | |
409 | ), | |
410 | array( | |
411 | 'entity' => 'ParticipantRole', | |
412 | 'subEntity' => '- Any -', | |
413 | 'triggerElement' => array( | |
414 | 'type' => "checkbox", | |
415 | ), | |
416 | ), | |
417 | array( | |
418 | 'entity' => 'ParticipantRole', | |
419 | 'subEntity' => 'Volunteer', | |
420 | 'triggerElement' => array( | |
421 | 'type' => "checkbox", | |
422 | ), | |
92915c55 | 423 | ), |
63dbed83 | 424 | ); |
425 | ||
426 | $return = $this->addCustomGroupField($customSets); | |
427 | ||
428 | $this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", "_qf_Participant_upload-bottom"); | |
429 | ||
430 | // Select event. | |
33cf86bd | 431 | $this->select2('event_id', "Rain-forest Cup Youth Soccer Tournament"); |
63dbed83 | 432 | |
433 | // Select role. | |
673c7418 | 434 | $this->multiselect2('role_id', array('Volunteer')); |
63dbed83 | 435 | |
80f3b91d | 436 | foreach ($return as $values) { |
63dbed83 | 437 | foreach ($values as $entityType => $customData) { |
438 | //checking for duplicate custom data present or not | |
a90dac23 | 439 | $this->assertElementPresent("xpath=//div[@class='custom-group custom-group-{$customData['cgtitle']} crm-accordion-wrapper ']"); |
440 | $this->assertEquals(1, $this->getXpathCount("//div[@class='custom-group custom-group-{$customData['cgtitle']} crm-accordion-wrapper ']")); | |
63dbed83 | 441 | } |
442 | } | |
443 | } | |
444 | ||
4cbe18b8 | 445 | /** |
100fef9d | 446 | * @param int $processorId |
4cbe18b8 | 447 | */ |
00be9182 | 448 | public function _fillParticipantDetails($processorId) { |
80f3b91d | 449 | $contact = $this->createDialogContact(); |
76e86fd8 | 450 | |
e9322446 | 451 | $event_id = $this->getAttribute("xpath=//*[@id='event_id']@value"); |
dd1e47de | 452 | //check if it is the selected event |
e9322446 | 453 | $this->assertEquals($event_id, 3); |
454 | $this->select("role_id", "value=1"); | |
6a488035 TO |
455 | $this->webtestAddCreditCardDetails(); |
456 | $this->webtestAddBillingDetails(); | |
80f3b91d | 457 | return $contact; |
6a488035 | 458 | } |
96025800 | 459 | |
232624b1 | 460 | } |