Make helper fn for enabling components
[civicrm-core.git] / tests / phpunit / WebTest / Campaign / SurveyUsageScenarioTest.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.3 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2013 |
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
27
28 require_once 'CiviTest/CiviSeleniumTestCase.php';
29 class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
30
31 protected function setUp() {
32 parent::setUp();
33 }
34
35 function testSurveyUsageScenario() {
36 $this->webtestLogin();
37
38 // Create new group
39 $title = substr(sha1(rand()), 0, 7);
40 $groupName = $this->WebtestAddGroup();
41
42 // Adding contact
43 $firstName1 = substr(sha1(rand()), 0, 7);
44 $this->webtestAddContact($firstName1, "Smith", "$firstName1.smith@example.org");
45
46 // add contact to group
47 // visit group tab
48 $this->click("css=li#tab_group a");
49 $this->waitForElementPresent("group_id");
50
51 // add to group
52 $this->select("group_id", "label=$groupName");
53 $this->click("_qf_GroupContact_next");
54 $this->waitForPageToLoad($this->getTimeoutMsec());
55
56 $firstName2 = substr(sha1(rand()), 0, 7);
57 $this->webtestAddContact($firstName2, "John", "$firstName2.john@example.org");
58
59 // add contact to group
60 // visit group tab
61 $this->click("css=li#tab_group a");
62 $this->waitForElementPresent("group_id");
63
64 // add to group
65 $this->select("group_id", "label=$groupName");
66 $this->click("_qf_GroupContact_next");
67 $this->waitForPageToLoad($this->getTimeoutMsec());
68
69 $this->enableComponents(array('CiviCampaign'));
70
71 // add the required Drupal permission
72 $permissions = array('edit-2-administer-civicampaign');
73 $this->changePermissions($permissions);
74
75 // Go directly to the URL of the screen that you will be testing
76 $this->openCiviPage("campaign/add", "reset=1", "_qf_Campaign_upload-bottom");
77
78 // Let's start filling the form with values.
79 $this->type("title", "Campaign $title");
80
81 // select the campaign type
82 $this->select("campaign_type_id", "value=2");
83
84 // fill in the description
85 $this->type("description", "This is a test campaign");
86
87 // include groups for the campaign
88 $this->addSelection("includeGroups-f", "label=$groupName");
89 $this->click("//option[@value=4]");
90 $this->click("add");
91
92 // fill the end date for campaign
93 $this->webtestFillDate("end_date", "+1 year");
94
95 // select campaign status
96 $this->select("status_id", "value=2");
97
98 // click save
99 $this->click("_qf_Campaign_upload-bottom");
100 $this->waitForPageToLoad($this->getTimeoutMsec());
101
102 //$this->assertElementContainsText("crm-notification-container", "$title");
103
104 // create a custom data set for activities -> survey
105 $this->openCiviPage('admin/custom/group', "action=add&reset=1", "_qf_Group_next-bottom");
106 // fill in a unique title for the custom group
107 $this->type("title", "Group $title");
108
109 // select the group this custom data set extends
110 $this->select("extends[0]", "value=Activity");
111 $this->waitForElementPresent("//select[@id='extends_1']");
112 $this->select("//select[@id='extends_1']", "label=Survey");
113
114 // save the custom group
115 $this->click("_qf_Group_next-bottom");
116 $this->waitForPageToLoad();
117
118 // add a custom field to the custom group
119 $this->type("label", "Field $title");
120
121 $this->select("data_type[1]", "value=Radio");
122
123 $this->waitForElementPresent("option_label_1");
124
125 // create a set of options
126 $this->type("option_label_1", "Option $title 1");
127 $this->type("option_value_1", "1");
128
129 $this->type("option_label_2", "Option $title 2");
130 $this->type("option_value_2", "2");
131
132 // save the custom field
133 $this->click("_qf_Field_next-bottom");
134
135 $this->waitForElementPresent("newCustomField");
136 $this->assertElementContainsText("crm-notification-container", "$title");
137
138 // create a profile for campaign
139 $this->openCiviPage("admin/uf/group/add", "action=add&reset=1", "_qf_Group_next-bottom");
140
141 // fill in a unique title for the profile
142 $this->type("title", "Profile $title");
143
144 // save the profile
145 $this->click("_qf_Group_next-bottom");
146
147 $this->waitForElementPresent("_qf_Field_next-bottom");
148 $this->assertElementContainsText("crm-notification-container", "$title");
149
150 // add a profile field for activity
151 $this->select("field_name[0]", "value=Activity");
152 $this->waitForElementPresent("field_name[1]");
153 $this->select("field_name[1]", "label=Field $title :: Group $title");
154
155 $this->click("_qf_Field_next-bottom");
156 $this->waitForPageToLoad($this->getTimeoutMsec());
157 $this->assertElementContainsText("crm-notification-container", "$title");
158
159 // create a survey
160 $this->openCiviPage("survey/add", "reset=1", "_qf_Main_upload-bottom");
161
162 // fill in a unique title for the survey
163 $this->type("title", "Survey $title");
164
165 // select the created campaign
166 $this->select("campaign_id", "label=Campaign $title");
167
168 // select the activity type
169 $this->select("activity_type_id", "label=Survey");
170
171 // fill in reserve survey respondents
172 $this->type("default_number_of_contacts", 50);
173
174 // fill in interview survey respondents
175 $this->type("max_number_of_contacts", 100);
176
177 // release frequency
178 $this->type("release_frequency", 2);
179
180 $this->click("_qf_Main_upload-bottom");
181 $this->waitForElementPresent("_qf_Questions_upload_next-bottom");
182
183 //Select the profile for the survey
184 $this->select("//form[@id='Questions']/div[2]/table/tbody/tr[1]/td[2]/div/div/span/select", "label=New Individual");
185
186 // select the question created for the survey
187 $this->select("//form[@id='Questions']/div[2]/table/tbody/tr[2]/td[2]/div/div/span/select", "label=Profile $title");
188 $this->click("_qf_Questions_upload_next-bottom");
189
190 // create a set of options for Survey Responses _qf_Results_upload_done-bottom
191 $this->waitForElementPresent('_qf_Results_upload_done-bottom');
192 $this->type("//input[@id='option_label_1']", "Label $title 1");
193 $this->type("//input[@id='option_value_1']", "1");
194
195 $this->type("//input[@id='option_label_2']", "Label $title 2");
196 $this->type("//input[@id='option_value_2']", "2");
197 $this->click('_qf_Results_upload_done-bottom');
198 $this->waitForElementPresent("//div[@id='search_form_survey']");
199 $this->assertElementContainsText("crm-notification-container", "Results");
200
201 // Reserve Respondents
202 $this->openCiviPage("survey/search", "reset=1&op=reserve", "_qf_Search_refresh");
203
204 // search for the respondents
205 $this->select("campaign_survey_id", "label=Survey $title");
206
207 $this->click("_qf_Search_refresh");
208
209 $this->waitForElementPresent("Go");
210 $this->click("CIVICRM_QFID_ts_all_4");
211 $this->click("Go");
212
213 $this->waitForElementPresent("_qf_Reserve_done_reserve-bottom");
214 $this->click("_qf_Reserve_done_reserve-bottom");
215 $this->waitForPageToLoad($this->getTimeoutMsec());
216 $this->assertElementContainsText("crm-notification-container", "2");
217
218 // Interview Respondents
219 $this->openCiviPage("survey/search", "reset=1&op=interview", "_qf_Search_refresh");
220
221 // search for the respondents
222 $this->select("campaign_survey_id", "label=Survey $title");
223
224 $this->click("_qf_Search_refresh");
225
226 $this->waitForElementPresent("Go");
227 $this->click("CIVICRM_QFID_ts_all_4");
228 $this->click("Go");
229
230 $this->waitForElementPresent("_qf_Interview_cancel_interview");
231
232 $this->click("CIVICRM_QFID_1_2");
233 $this->select("css=#voterRecords .odd .result select", "value=Label $title 1");
234 $this->click("css=#voterRecords .odd td a");
235
236 $this->click("CIVICRM_QFID_2_8");
237 $this->select("css=#voterRecords .even .result select", "value=Label $title 2");
238 $this->click("css=#voterRecords .even td a");
239
240 $this->click("_qf_Interview_cancel_interview");
241 $this->waitForPageToLoad($this->getTimeoutMsec());
242
243 // add a contact to the group to test release respondents
244 $firstName3 = substr(sha1(rand()), 0, 7);
245 $this->webtestAddContact($firstName3, "James", "$firstName3.james@example.org");
246 $url = $this->getLocation();
247 $id = explode('cid=', $url);
248 $sortName3 = "James, $firstName3";
249
250 // add contact to group
251 // visit group tab
252 $this->click("css=li#tab_group a");
253 $this->waitForElementPresent("group_id");
254
255 // add to group
256 $this->select("group_id", "label=$groupName");
257 $this->click("_qf_GroupContact_next");
258 $this->waitForPageToLoad($this->getTimeoutMsec());
259
260 // Reserve Respondents
261 $this->openCiviPage("survey/search", "reset=1&op=reserve", "_qf_Search_refresh");
262
263 // search for the respondents
264 $this->select("campaign_survey_id", "label=Survey $title");
265
266 $this->click("_qf_Search_refresh");
267
268 $this->waitForElementPresent("Go");
269 $this->click("CIVICRM_QFID_ts_all_4");
270 $this->click("Go");
271
272 $this->waitForElementPresent("_qf_Reserve_done_reserve-bottom");
273 $this->click("_qf_Reserve_done_reserve-bottom");
274 $this->waitForPageToLoad($this->getTimeoutMsec());
275 $this->assertElementContainsText("crm-notification-container", "3");
276
277 // Release Respondents
278 $this->openCiviPage("survey/search", "reset=1&op=release", "_qf_Search_refresh");
279
280 // search for the respondents
281 $this->select("campaign_survey_id", "label=Survey $title");
282
283 $this->click("_qf_Search_refresh");
284
285 $this->waitForElementPresent("Go");
286 $this->click("xpath=id('mark_x_$id[1]')");
287
288 $this->waitForElementPresent("Go");
289 $this->click("Go");
290 $this->waitForPageToLoad($this->getTimeoutMsec());
291
292 $this->waitForElementPresent("_qf_Release_done-bottom");
293 $this->click("_qf_Release_done-bottom");
294 $this->waitForPageToLoad($this->getTimeoutMsec());
295 // wait for Access Keys div to appear at bottom of page - since this page may take a while
296 $this->waitForElementPresent('access');
297 $this->assertElementContainsText("crm-notification-container", "released");
298
299 // check whether contact is available for reserving again
300 $this->openCiviPage("survey/search", "reset=1&op=reserve", "_qf_Search_refresh");
301
302 // search for the respondents
303 $this->select("campaign_survey_id", "label=Survey $title");
304
305 $this->click("_qf_Search_refresh");
306 $this->waitForPageToLoad($this->getTimeoutMsec());
307 $this->assertTrue($this->isTextPresent("1 Result"), "Result didn't show up after saving!");
308 }
309
310 function testSurveyReportTest() {
311 $this->webtestLogin();
312
313 // Create new group
314 $title = substr(sha1(rand()), 0, 7);
315 $groupName = $this->WebtestAddGroup();
316
317 // Adding contact
318 // We're using Quick Add block on the main page for this.
319 $firstName1 = substr(sha1(rand()), 0, 7);
320 $this->webtestAddContact($firstName1, "Smith", "$firstName1.smith@example.org");
321 $url1 = explode('cid=', $this->getLocation());
322 $id1 = $url1[1];
323
324 // add contact to group
325 // visit group tab
326 $this->click("css=li#tab_group a");
327 $this->waitForElementPresent('group_id');
328
329 // add to group
330 $this->select("group_id", "label=$groupName");
331 $this->click("_qf_GroupContact_next");
332 $this->waitForPageToLoad($this->getTimeoutMsec());
333
334 $firstName2 = substr(sha1(rand()), 0, 7);
335 $this->webtestAddContact($firstName2, "John", "$firstName2.john@example.org");
336 $url2 = explode('cid=', $this->getLocation());
337 $id2 = $url2[1];
338
339 // add contact to group
340 // visit group tab
341 $this->click("css=li#tab_group a");
342 $this->waitForElementPresent('group_id');
343
344 // add to group
345 $this->select("group_id", "label=$groupName");
346 $this->click("_qf_GroupContact_next");
347 $this->waitForPageToLoad($this->getTimeoutMsec());
348
349 // Create custom group and add custom data fields
350 $this->openCiviPage("admin/custom/group", "reset=1");
351
352 $this->click("link=Add Set of Custom Fields");
353 $this->waitForElementPresent('_qf_Group_cancel-bottom');
354
355 $customGroup = "Custom Group $title";
356 $this->type('title', "$customGroup");
357 $this->select('extends[0]', "value=Contact");
358 $this->click('_qf_Group_next-bottom');
359 $this->waitForElementPresent('_qf_Field_cancel-bottom');
360 $this->assertTrue($this->isTextPresent("Your custom field set '$customGroup' has been added. You can add custom fields now."));
361
362 // Add custom fields
363 $field1 = "Checkbox $title";
364 $this->type('label', $field1);
365 $this->select('data_type[1]', "value=CheckBox");
366 $this->waitForElementPresent('option_label_2');
367
368 // add multiple choice options
369 $label1 = "Check $title One";
370 $value1 = 1;
371 $this->type('option_label_1', $label1);
372 $this->type('option_value_1', $value1);
373
374 $label2 = "Check $title Two";
375 $value2 = 2;
376 $this->type('option_label_2', $label2);
377 $this->type('option_value_2', $value2);
378
379 $this->click("link=another choice");
380
381 $label3 = "Check $title Three";
382 $value3 = 3;
383 $this->type('option_label_3', $label3);
384 $this->type('option_value_3', $value3);
385
386 $this->click('_qf_Field_next-bottom');
387 $this->waitForPageToLoad($this->getTimeoutMsec());
388 $this->assertTrue($this->isTextPresent("Your custom field '$field1' has been saved."));
389
390 // Create a profile for survey
391 $this->openCiviPage("admin/uf/group", "reset=1");
392
393 $this->click("link=Add Profile");
394 $this->waitForElementPresent('_qf_Group_cancel-bottom');
395
396 $surveyProfile = "Survey Profile $title";
397 $this->type('title', $surveyProfile);
398 $this->click('_qf_Group_next-bottom');
399 $this->waitForElementPresent('_qf_Field_cancel-bottom');
400 $this->assertTrue($this->isTextPresent("Your CiviCRM Profile '$surveyProfile' has been added. You can add fields to this profile now. "));
401
402 // Add fields to the profile
403 // Phone ( Primary )
404 $this->select('field_name[0]', "value=Contact");
405 $this->select('field_name[1]', "value=phone");
406 $this->click('field_name[1]');
407 $this->select('visibility', "value=Public Pages and Listings");
408 $this->check('is_searchable');
409 $this->check('in_selector');
410 $this->click('_qf_Field_next_new-bottom');
411 $this->waitForPageToLoad($this->getTimeoutMsec());
412 $this->waitForElementPresent('_qf_Field_cancel-bottom');
413
414 // Custom Data Fields
415 $this->select('field_name[0]', "value=Contact");
416 $this->select('field_name[1]', "label=$field1 :: $customGroup");
417 $this->click('field_name[1]');
418 $this->select('visibility', "value=Public Pages and Listings");
419 $this->check('is_searchable');
420 $this->check('in_selector');
421 $this->click('_qf_Field_next-bottom');
422 $this->waitForPageToLoad($this->getTimeoutMsec());
423
424 // Enable CiviCampaign module if necessary
425 $this->openCiviPage("admin/setting/component", "reset=1");
426
427 $this->waitForElementPresent('_qf_Component_next-bottom');
428 $enabledComponents = $this->getSelectOptions('enableComponents-t');
429 if (!in_array("CiviCampaign", $enabledComponents)) {
430 $this->addSelection('enableComponents-f', "label=CiviCampaign");
431 $this->click("//option[@value='CiviCampaign']");
432 $this->click('add');
433 $this->click('_qf_Component_next-bottom');
434 $this->waitForPageToLoad($this->getTimeoutMsec());
435 $this->assertTrue($this->isTextPresent('Changes Saved.'));
436 }
437
438 // add the required Drupal permission
439 $permissions = array('edit-2-administer-civicampaign');
440 $this->changePermissions($permissions);
441
442 // Create a survey
443 $this->openCiviPage("survey/add", "reset=1", "_qf_Main_upload-bottom");
444
445 // fill in a unique title for the survey
446 $surveyTitle = "Survey $title";
447 $this->type('title', $surveyTitle);
448
449 // select the created campaign
450 //$this->select("campaign_id", "label=Campaign $title");
451
452 // select the activity type
453 $this->select("activity_type_id", "label=Survey");
454
455 // fill in reserve survey respondents
456 $this->type("default_number_of_contacts", 50);
457
458 // fill in interview survey respondents
459 $this->type("max_number_of_contacts", 100);
460
461 // release frequency
462 $this->type("release_frequency", 2);
463
464 $this->click("_qf_Main_upload-bottom");
465 $this->waitForElementPresent("_qf_Questions_upload_next-bottom");
466
467 //Select the profile for the survey
468 $this->select("//form[@id='Questions']/div[2]/table/tbody/tr[1]/td[2]/div/div/span/select", "label=New Individual");
469
470 // select the question created for the survey
471 $this->select("//form[@id='Questions']/div[2]/table/tbody/tr[2]/td[2]/div/div/span/select", "label=$surveyProfile");
472 $this->click("_qf_Questions_upload_next-bottom");
473
474 // create a set of options for Survey Responses _qf_Results_upload_done-bottom
475 $this->waitForElementPresent('_qf_Results_upload_done-bottom');
476 $optionLabel1 = "Label $title 1";
477 $this->type("//input[@id='option_label_1']", "$optionLabel1");
478 $this->type("//input[@id='option_value_1']", "1");
479
480 $optionLabel2 = "Label $title 2";
481 $this->type("//input[@id='option_label_2']", "$optionLabel2");
482 $this->type("//input[@id='option_value_2']", "2");
483 $this->type("//input[@id='report_title']", "Survey $title");
484 $this->click('_qf_Results_upload_done-bottom');
485 $this->waitForElementPresent("//div[@id='search_form_survey']");
486 $this->assertTrue($this->isTextPresent("'Results' have been saved."),
487 "Status message didn't show up after saving survey!"
488 );
489
490 // Reserve Respondents
491 $this->openCiviPage("survey/search", "reset=1&op=reserve", '_qf_Search_refresh');
492
493 // search for the respondents
494 // select survey
495 $this->select('campaign_survey_id', "label=$surveyTitle");
496
497 // need to wait for Groups field to reload dynamically
498 sleep(3);
499
500 // select group
501 $this->click('campaignGroupsSelect1');
502 $this->select('campaignGroupsSelect1', "label=$groupName");
503 $this->click('_qf_Search_refresh');
504
505 $this->waitForElementPresent('_qf_Search_next_print');
506 $this->click("CIVICRM_QFID_ts_all_4");
507 $this->click("Go");
508 $this->waitForElementPresent('_qf_Reserve_done_reserve-bottom');
509
510 $this->click('_qf_Reserve_done_reserve-bottom');
511 $this->waitForPageToLoad($this->getTimeoutMsec());
512 // wait for Access Keys div to appear at bottom of page - since this page may take a while
513 $this->waitForElementPresent('access');
514 $this->assertTrue($this->isTextPresent("Reservation has been added for 2 Contact(s)."));
515
516 $this->openCiviPage("report/survey/detail", "reset=1", '_qf_SurveyDetails_submit');
517
518 // Select columns to be displayed
519 $this->check('fields[survey_id]');
520 $this->check('fields[survey_response]');
521 $this->select('survey_id_value', "label=$surveyTitle");
522 $this->select('status_id_value', "label=Reserved");
523 $this->click('_qf_SurveyDetails_submit');
524 $this->waitForElementPresent('_qf_SurveyDetails_submit_print');
525 $this->assertTrue($this->isTextPresent("Is equal to Reserved"));
526
527 // commenting out the print assertion as print dialog which appears breaks the webtest
528 // as it is OS-related and cannot be handled through webtest
529
530 // $this->click('_qf_SurveyDetails_submit_print');
531 // $this->waitForPageToLoad($this->getTimeoutMsec());
532
533 // $this->assertTrue($this->isTextPresent("Survey Title = $surveyTitle"));
534 // $this->assertTrue($this->isTextPresent("Q1 = $field1"));
535 // $this->assertTrue($this->isTextPresent("$value1 | $value2 | $value3"));
536
537 // Interview Respondents
538 $this->openCiviPage("survey/search", "reset=1&op=interview", '_qf_Search_refresh');
539
540 // search for the respondents
541 // select survey
542 $this->select('campaign_survey_id', "label=$surveyTitle");
543
544 // need to wait for Groups field to reload dynamically
545 sleep(3);
546
547 // select group
548 $this->click('campaignGroupsSelect1');
549 $this->select('campaignGroupsSelect1', "label=$groupName");
550 $this->waitForElementPresent("xpath=//ul[@id='crmasmList1']/li");
551 $this->click('_qf_Search_refresh');
552
553 $this->waitForElementPresent('_qf_Search_next_print');
554 $this->click("xpath=//table[@class='selector']/tbody//tr[@id='rowid{$id1}']/td[1]");
555 $this->click("mark_x_{$id1}");
556 $this->click("Go");
557 $this->waitForElementPresent('_qf_Interview_cancel_interview');
558
559 $this->type("field_{$id1}_phone-Primary-1", 9876543210);
560 $this->click("xpath=//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[5]/input[2]/../label[text()='$label1']");
561 $this->click("xpath=//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[5]/input[6]/../label[text()='$label2']");
562 $this->select("field_{$id1}_result", $optionLabel1);
563 $this->click("interview_voter_button_{$id1}");
564 sleep(3);
565 // Survey Report
566 $this->openCiviPage("report/survey/detail", "reset=1", '_qf_SurveyDetails_submit');
567
568 // Select columns to be displayed
569 $this->check('fields[survey_id]');
570 $this->check('fields[survey_response]');
571 $this->select('survey_id_value', "label=$surveyTitle");
572 $this->select('status_id_value', "label=Interviewed");
573 $this->click('_qf_SurveyDetails_submit');
574 $this->waitForElementPresent('_qf_SurveyDetails_submit_print');
575 $this->assertTrue($this->isTextPresent("Is equal to Interviewed"));
576
577 // commenting out the print assertion as print dialog which appears breaks the webtest
578 // as it is OS-related and cannot be handled through webtest
579
580 // $this->click('_qf_SurveyDetails_submit_print');
581 // $this->waitForPageToLoad($this->getTimeoutMsec());
582
583 // $this->assertTrue($this->isTextPresent("Survey Title = $surveyTitle"));
584 // $this->assertTrue($this->isTextPresent("Q1 = $field1"));
585 // $this->assertTrue($this->isTextPresent("$value1"));
586
587 // use GOTV (campaign/gotv) to mark the respondents as voted
588 $this->openCiviPage("campaign/gotv", "reset=1");
589
590 // search for the respondents
591 // select survey
592 $this->select('campaign_survey_id', "label=$surveyTitle");
593 // need to wait for Groups field to reload dynamically
594 sleep(3);
595
596 // select group
597 $this->click('campaignGroupsSelect1');
598 $this->select('campaignGroupsSelect1', "label=$groupName");
599 $this->waitForElementPresent("xpath=//ul[@id='crmasmList1']/li");
600 $this->click("xpath=//div[@id='search_form_gotv']/div[2]/table/tbody/tr[6]/td/a[text()='Search']");
601
602 $this->waitForElementPresent("xpath=//table[@id='gotvVoterRecords']/tbody/tr/td[7]");
603 $this->check("xpath=//table[@id='gotvVoterRecords']/tbody/tr/td[7]/input");
604
605 // Check title of the activities created
606 $this->openCiviPage("activity/search", "reset=1", '_qf_Search_refresh');
607 $this->select('activity_survey_id', "label=$surveyTitle");
608 $this->click('_qf_Search_refresh');
609 $this->waitForPageToLoad($this->getTimeoutMsec());
610
611 $this->verifyText("xpath=//table[@class='selector']/tbody//tr/td[5]/a[text()='Smith, $firstName1']/../../td[3]",
612 preg_quote("$surveyTitle - Respondent Interview")
613 );
614 $this->verifyText("xpath=//table[@class='selector']/tbody//tr/td[5]/a[text()='John, $firstName2']/../../td[3]",
615 preg_quote("$surveyTitle - Respondent Reservation")
616 );
617 }
618 }
619