Merge pull request #196 from dlobo/CRM-12151
[civicrm-core.git] / tests / phpunit / WebTest / Mailing / MailingTest.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_Mailing_MailingTest extends CiviSeleniumTestCase {
30
31 protected function setUp() {
32 parent::setUp();
33 }
34
35 function testAddMailing() {
36 $this->open($this->sboxPath);
37 $this->webtestLogin();
38
39 //----do create test mailing group
40
41 // Go directly to the URL of the screen that you will be testing (New Group).
42 $this->openCiviPage("group/add", "reset=1", "_qf_Edit_upload");
43
44 // make group name
45 $groupName = 'group_' . substr(sha1(rand()), 0, 7);
46
47 // fill group name
48 $this->type("title", $groupName);
49
50 // fill description
51 $this->type("description", "New mailing group for Webtest");
52
53 // enable Mailing List
54 $this->click("group_type[2]");
55
56 // select Visibility as Public Pages
57 $this->select("visibility", "value=Public Pages");
58
59 // Clicking save.
60 $this->click("_qf_Edit_upload");
61 $this->waitForPageToLoad($this->getTimeoutMsec());
62
63 // Is status message correct?
64 $this->assertElementContainsText('crm-notification-container', "The Group '$groupName' has been saved.");
65
66 //---- create mailing contact and add to mailing Group
67 $firstName = substr(sha1(rand()), 0, 7);
68 $this->webtestAddContact($firstName, "Mailson", "mailino$firstName@mailson.co.in");
69
70 // Get contact id from url.
71 $matches = array();
72 preg_match('/cid=([0-9]+)/', $this->getLocation(), $matches);
73 $contactId = $matches[1];
74
75 // go to group tab and add to mailing group
76 $this->click("css=li#tab_group a");
77 $this->waitForElementPresent("_qf_GroupContact_next");
78 $this->select("group_id", "$groupName");
79 $this->click("_qf_GroupContact_next");
80 $this->waitForPageToLoad($this->getTimeoutMsec());
81 $this->waitForElementPresent("_qf_GroupContact_next");
82
83 // configure default mail-box
84 $this->openCiviPage("admin/mailSettings", "action=update&id=1&reset=1", '_qf_MailSettings_cancel-bottom');
85 $this->type('name', 'Test Domain');
86 $this->type('domain', 'example.com');
87 $this->select('protocol', 'value=1');
88 $this->click('_qf_MailSettings_next-bottom');
89 $this->waitForPageToLoad($this->getTimeoutMsec());
90
91 // Go directly to Schedule and Send Mailing form
92 $this->openCiviPage("mailing/send", "reset=1", "_qf_Group_cancel");
93
94 //-------select recipients----------
95
96 // fill mailing name
97 $mailingName = substr(sha1(rand()), 0, 7);
98 $this->type("name", "Mailing $mailingName Webtest");
99
100 // Add the test mailing group
101 $this->select("includeGroups-f", "$groupName");
102 $this->click("add");
103
104 // click next
105 $this->click("_qf_Group_next");
106 $this->waitForElementPresent("_qf_Settings_cancel");
107
108 //--------track and respond----------
109
110 // check for default settings options
111 $this->assertChecked("url_tracking");
112 $this->assertChecked("open_tracking");
113
114 // do check count for Recipient
115 $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
116
117 // no need tracking for this test
118
119 // click next with default settings
120 $this->click("_qf_Settings_next");
121 $this->waitForElementPresent("_qf_Upload_cancel");
122
123 //--------Mailing content------------
124 // let from email address be default
125
126 // fill subject for mailing
127 $this->type("subject", "Test subject {$mailingName} for Webtest");
128
129 // check for default option enabled
130 $this->assertChecked("CIVICRM_QFID_1_upload_type");
131
132 // HTML format message
133 $HTMLMessage = "This is HTML formatted content for Mailing {$mailingName} Webtest.";
134 $this->fillRichTextField("html_message", $HTMLMessage);
135
136 // Open Plain-text Format pane and type text format msg
137 $this->click("//fieldset[@id='compose_id']/div[2]/div[1]");
138 $this->type("text_message", "This is text formatted content for Mailing {$mailingName} Webtest.");
139
140 // select default header and footer ( with label )
141 $this->select("header_id", "label=Mailing Header");
142 $this->select("footer_id", "label=Mailing Footer");
143
144 // do check count for Recipient
145 $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
146
147 // click next with nominal content
148 $this->click("_qf_Upload_upload");
149 $this->waitForElementPresent("_qf_Test_cancel");
150
151 //---------------Test------------------
152
153 ////////--Commenting test mailing and mailing preview (test mailing and preview not presently working).
154
155 // send test mailing
156 //$this->type("test_email", "mailino@mailson.co.in");
157 //$this->click("sendtest");
158
159 // verify status message
160 //$this->assertTrue($this->isTextPresent("Your test message has been sent. Click 'Next' when you are ready to Schedule or Send your live mailing (you will still have a chance to confirm or cancel sending this mailing on the next page)."));
161
162 // check mailing preview
163 //$this->click("//form[@id='Test']/div[2]/div[4]/div[1]");
164 //$this->assertTrue($this->isTextPresent("this is test content for Mailing $mailingName Webtest"));
165
166 ////////
167
168 // do check count for Recipient
169 $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
170
171 // click next
172 $this->click("_qf_Test_next");
173 $this->waitForElementPresent("_qf_Schedule_cancel");
174
175 //----------Schedule or Send------------
176
177 // do check for default option enabled
178 $this->assertChecked("now");
179
180 // do check count for Recipient
181 $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
182
183 // finally schedule the mail by clicking submit
184 $this->click("_qf_Schedule_next");
185 $this->waitForPageToLoad($this->getTimeoutMsec());
186
187 //----------end New Mailing-------------
188
189 //check redirected page to Scheduled and Sent Mailings and verify for mailing name
190 $this->assertElementContainsText('page-title', "Scheduled and Sent Mailings");
191 $this->assertElementContainsText("xpath=//table[@class='selector']/tbody//tr//td", "Mailing $mailingName Webtest");
192
193 //--------- mail delivery verification---------
194 // test undelivered report
195
196 // click report link of created mailing
197 $this->click("xpath=//table//tbody/tr[td[1]/text()='Mailing $mailingName Webtest']/descendant::a[text()='Report']");
198 $this->waitForPageToLoad($this->getTimeoutMsec());
199
200 // verify undelivered status message
201 $this->assertElementContainsText('css=.messages', "Delivery has not yet begun for this mailing. If the scheduled delivery date and time is past, ask the system administrator or technical support contact for your site to verify that the automated mailer task ('cron job') is running - and how frequently.");
202
203 // do check for recipient group
204 $this->assertElementContainsText("xpath=//fieldset/legend[text()='Recipients']/../table/tbody//tr/td", "Members of $groupName");
205
206 // directly send schedule mailing -- not working right now
207 $this->openCiviPage("mailing/queue", "reset=1");
208
209 //click report link of created mailing
210 $this->click("xpath=//table//tbody/tr[td[1]/text()='Mailing $mailingName Webtest']/descendant::a[text()='Report']");
211 $this->waitForPageToLoad($this->getTimeoutMsec());
212
213 // do check again for recipient group
214 $this->assertElementContainsText("xpath=//fieldset/legend[text()='Recipients']/../table/tbody//tr/td", "Members of $groupName");
215
216 // verify intended recipients
217 $this->verifyText("xpath=//table//tr[td/a[text()='Intended Recipients']]/descendant::td[2]", preg_quote("1"));
218
219 // verify successful deliveries
220 $this->verifyText("xpath=//table//tr[td/a[text()='Successful Deliveries']]/descendant::td[2]", preg_quote("1 (100.00%)"));
221
222 // verify status
223 $this->verifyText("xpath=//table//tr[td[1]/text()='Status']/descendant::td[2]", preg_quote("Complete"));
224
225 // verify mailing name
226 $this->verifyText("xpath=//table//tr[td[1]/text()='Mailing Name']/descendant::td[2]", preg_quote("Mailing $mailingName Webtest"));
227
228 // verify mailing subject
229 $this->verifyText("xpath=//table//tr[td[1]/text()='Subject']/descendant::td[2]", preg_quote("Test subject $mailingName for Webtest"));
230
231 //---- check for delivery detail--
232
233 $this->click("link=Successful Deliveries");
234 $this->waitForPageToLoad($this->getTimeoutMsec());
235
236 // check for open page
237 $this->assertElementContainsText( 'page-title', "Successful Deliveries");
238
239 // verify email
240 $this->verifyText("xpath=//table[@id='mailing_event']/tbody//tr/td[2]", preg_quote("mailino$firstName@mailson.co.in"));
241
242 require_once 'CRM/Mailing/Event/DAO/Queue.php';
243 $eventQueue = new CRM_Mailing_Event_DAO_Queue();
244 $eventQueue->contact_id = $contactId;
245 $eventQueue->find(TRUE);
246
247 $permission = array('edit-1-access-civimail-subscribeunsubscribe-pages');
248 $this->changePermissions($permission);
249 $this->openCiviPage('logout', 'reset=1', NULL);
250
251 // build forward url
252 $forwardUrl = array("mailing/forward", "reset=1&jid={$eventQueue->job_id}&qid={$eventQueue->id}&h={$eventQueue->hash}");
253 $this->openCiviPage($forwardUrl[0], $forwardUrl[1], NULL);
254
255 $this->type("email_0", substr(sha1(rand()), 0, 7) . '@example.com');
256 $this->type("email_1", substr(sha1(rand()), 0, 7) . '@example.com');
257
258 $this->click("comment_show");
259 $this->type("forward_comment", "Test Message");
260
261 $this->click("_qf_ForwardMailing_next-bottom");
262 $this->waitForPageToLoad($this->getTimeoutMsec());
263 $this->assertElementContainsText('css=div.messages', 'Mailing is forwarded successfully to 2 email addresses');
264
265 $this->open($this->sboxPath);
266 $this->waitForPageToLoad($this->getTimeoutMsec());
267 $this->webtestLogin();
268
269 $this->openCiviPage("mailing/browse/scheduled", "reset=1&scheduled=true");
270
271 //click report link of created mailing
272 $this->click("xpath=//table//tbody/tr[td[1]/text()='Mailing $mailingName Webtest']/descendant::a[text()='Report']");
273 $this->waitForPageToLoad($this->getTimeoutMsec());
274
275 // verify successful forwards
276 $this->verifyText("xpath=//table//tr[td/a[text()='Forwards']]/descendant::td[2]", "2");
277
278 // Mailing is forwarded successfully to 2 email addresses.
279 //------end delivery verification---------
280
281 // //------ check with unsubscribe -------
282 // // FIX ME: there is an issue with DSN setting for Webtest, need to handle by seperate DSN setting for Webtests
283 // // build unsubscribe link
284 // require_once 'CRM/Mailing/Event/DAO/Queue.php';
285 // $eventQueue = new CRM_Mailing_Event_DAO_Queue( );
286 // $eventQueue->contact_id = $contactId;
287 // $eventQueue->find(true);
288
289 // // unsubscribe link
290 // $unsubscribeUrl = "civicrm/mailing/optout?reset=1&jid={$eventQueue->job_id}&qid={$eventQueue->id}&h={$eventQueue->hash}&confirm=1";
291
292 // // logout to unsubscribe
293 // $this->open($this->sboxPath . 'civicrm/logout?reset=1');
294 // $this->waitForPageToLoad($this->getTimeoutMsec());
295
296 // // click(visit) unsubscribe path
297 // $this->open($this->sboxPath . $unsubscribeUrl);
298 // $this->waitForPageToLoad($this->getTimeoutMsec());
299
300 // $this->assertTrue($this->isTextPresent('Optout'));
301 // $this->assertTrue($this->isTextPresent("mailino$firstName@mailson.co.in"));
302
303 // // unsubscribe
304 // $this->click('_qf_optout_next');
305 // $this->waitForPageToLoad($this->getTimeoutMsec());
306
307 // $this->assertTrue($this->isTextPresent('Optout'));
308 // $this->assertTrue($this->isTextPresent("mailino$firstName@mailson.co.in"));
309 // $this->assertTrue($this->isTextPresent('has been successfully opted out.'));
310
311 // //------ end unsubscribe -------
312 }
313
314 function testAdvanceSearchAndReportCheck() {
315
316 $this->open($this->sboxPath);
317 $this->webtestLogin();
318
319 // Go directly to the URL of the screen that you will be testing (New Group).
320 $this->openCiviPage("group/add", "reset=1", "_qf_Edit_upload");
321
322 // make group name
323 $groupName = 'group_' . substr(sha1(rand()), 0, 7);
324
325 // fill group name
326 $this->type("title", $groupName);
327
328 // fill description
329 $this->type("description", "New mailing group for Webtest");
330
331 // enable Mailing List
332 $this->click("group_type[2]");
333
334 // select Visibility as Public Pages
335 $this->select("visibility", "value=Public Pages");
336
337 // Clicking save.
338 $this->click("_qf_Edit_upload");
339 $this->waitForPageToLoad($this->getTimeoutMsec());
340
341 // Is status message correct?
342 $this->assertElementContainsText('crm-notification-container', "The Group '$groupName' has been saved.");
343
344 //---- create mailing contact and add to mailing Group
345 $firstName = substr(sha1(rand()), 0, 7);
346 $this->webtestAddContact($firstName, "Mailson", "mailino$firstName@mailson.co.in");
347
348 // Get contact id from url.
349 $matches = array();
350 preg_match('/cid=([0-9]+)/', $this->getLocation(), $matches);
351 $contactId = $matches[1];
352
353 // go to group tab and add to mailing group
354 $this->click("css=li#tab_group a");
355 $this->waitForElementPresent("_qf_GroupContact_next");
356 $this->select("group_id", "$groupName");
357 $this->click("_qf_GroupContact_next");
358 $this->waitForPageToLoad($this->getTimeoutMsec());
359 $this->waitForElementPresent("_qf_GroupContact_next");
360
361 // configure default mail-box
362 $this->openCiviPage("admin/mailSettings", "action=update&id=1&reset=1", '_qf_MailSettings_cancel-bottom');
363 $this->type('name', 'Test Domain');
364 $this->type('domain', 'example.com');
365 $this->select('protocol', 'value=1');
366 $this->click('_qf_MailSettings_next-bottom');
367 $this->waitForPageToLoad($this->getTimeoutMsec());
368
369 // Go directly to Schedule and Send Mailing form
370 $this->openCiviPage('mailing/send', 'reset=1', '_qf_Group_cancel');
371
372 //-------select recipients----------
373
374 // fill mailing name
375 $mailingName = substr(sha1(rand()), 0, 7);
376 $this->type("name", "Mailing $mailingName Webtest");
377
378 // Add the test mailing group
379 $this->select("includeGroups-f", "$groupName");
380 $this->click("add");
381
382 // click next
383 $this->click("_qf_Group_next");
384 $this->waitForElementPresent("_qf_Settings_cancel");
385
386 //--------track and respond----------
387
388 // check for default settings options
389 $this->assertChecked("url_tracking");
390 $this->assertChecked("open_tracking");
391
392 // do check count for Recipient
393 $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
394
395 // click next with default settings
396 $this->click("_qf_Settings_next");
397 $this->waitForElementPresent("_qf_Upload_cancel");
398
399 // fill subject for mailing
400 $this->type("subject", "Test subject {$mailingName} for Webtest");
401
402 // check for default option enabled
403 $this->assertChecked("CIVICRM_QFID_1_upload_type");
404
405 // HTML format message
406 $HTMLMessage = "This is HTML formatted content for Mailing {$mailingName} Webtest.";
407 $this->fillRichTextField("html_message", $HTMLMessage);
408
409 // Open Plain-text Format pane and type text format msg
410 $this->click("//fieldset[@id='compose_id']/div[2]/div[1]");
411 $this->type("text_message", "This is text formatted content for Mailing {$mailingName} Webtest.");
412
413 // select default header and footer ( with label )
414 $this->select("header_id", "label=Mailing Header");
415 $this->select("footer_id", "label=Mailing Footer");
416
417 // do check count for Recipient
418 $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
419
420 // click next with nominal content
421 $this->click("_qf_Upload_upload");
422 $this->waitForElementPresent("_qf_Test_cancel");
423
424 // do check count for Recipient
425 $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
426
427 // click next
428 $this->click("_qf_Test_next");
429 $this->waitForElementPresent("_qf_Schedule_cancel");
430
431 //----------Schedule or Send------------
432
433 // do check for default option enabled
434 $this->assertChecked("now");
435
436 // do check count for Recipient
437 $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
438
439 // finally schedule the mail by clicking submit
440 $this->click("_qf_Schedule_next");
441 $this->waitForPageToLoad($this->getTimeoutMsec());
442
443 //----------end New Mailing-------------
444
445 //check redirected page to Scheduled and Sent Mailings and verify for mailing name
446 $this->assertElementContainsText('page-title', "Scheduled and Sent Mailings");
447 $this->assertElementContainsText("xpath=//table[@class='selector']/tbody//tr//td", "Mailing $mailingName Webtest");
448
449 // directly send schedule mailing -- not working right now
450 $this->openCiviPage("mailing/queue", "reset=1");
451
452 //click report link of created mailing
453 $this->click("xpath=//table//tbody/tr[td[1]/text()='Mailing $mailingName Webtest']/descendant::a[text()='Report']");
454 $this->waitForPageToLoad($this->getTimeoutMsec());
455
456 $mailingReportUrl = $this->getLocation();
457 // do check again for recipient group
458 $this->assertElementContainsText("xpath=//fieldset/legend[text()='Recipients']/../table/tbody//tr/td", "Members of $groupName");
459
460 // verify successful deliveries
461 $this->verifyText("xpath=//table//tr[td/a[text()='Successful Deliveries']]/descendant::td[2]", preg_quote("1 (100.00%)"));
462
463 $summaryInfoLinks = array('Intended Recipients', 'Successful Deliveries', 'Tracked Opens', 'Click-throughs', 'Forwards', 'Replies', 'Bounces', 'Unsubscribe Requests','Opt-out Requests');
464
465 //check for report and adv search links
466 foreach($summaryInfoLinks as $value) {
467 $this->assertTrue($this->isElementPresent("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$value}']]/descendant::td[3]/span/a[1][text()='Report']"), "Report link missing for {$value}");
468 $this->assertTrue($this->isElementPresent("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$value}']]/descendant::td[3]/span/a[2][text()='Advanced Search']"), "Advance Search link missing for {$value}");
469 }
470 // verify mailing name
471 $this->verifyText("xpath=//table//tr[td[1]/text()='Mailing Name']/descendant::td[2]", preg_quote("Mailing $mailingName Webtest"));
472
473 // verify mailing subject
474 $this->verifyText("xpath=//table//tr[td[1]/text()='Subject']/descendant::td[2]", preg_quote("Test subject $mailingName for Webtest"));
475
476 // after asserts do clicks and confirm filters
477 $criteriaCheck =
478 array(
479 'Intended Recipients' =>
480 array(
481 'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest"),
482 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest")
483 ),
484 'Successful Deliveries' =>
485 array(
486 'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest",
487 "Delivery Status" => " Successful"),
488 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing Delivery -' => "Successful")
489 ),
490 'Tracked Opens' =>
491 array(
492 'report' => array('report_name' => 'Mail Opened', 'Mailing' => "Mailing $mailingName Webtest"),
493 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: Trackable Opens -' => "Opened")
494 ),
495 'Click-throughs' =>
496 array(
497 'report' => array('report_name' => 'Mail Clickthroughs', 'Mailing' => "Mailing $mailingName Webtest"),
498 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: Trackable URL Clicks -' => "Clicked")
499 ),
500 'Forwards' =>
501 array(
502 'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest",
503 'Forwarded' => 'Is equal to Yes'),
504 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: -' => "Forwards")
505 ),
506 'Replies' =>
507 array(
508 'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest",
509 'Replied' => 'Is equal to Yes'),
510 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: Trackable Replies -' => "Replied")
511 ),
512 'Bounces' =>
513 array(
514 'report' => array('report_name' => 'Mail Bounces', 'Mailing' => "Mailing $mailingName Webtest"),
515 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing Delivery -' => "Bounced")
516 ),
517 'Unsubscribe Requests' =>
518 array(
519 'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest",
520 'Unsubscribed' => 'Is equal to Yes'),
521 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: -' => "Unsubscribe Requests")
522 ),
523 'Opt-out Requests' =>
524 array(
525 'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest",
526 'Opted-out' => 'Is equal to Yes'),
527 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: -' => "Opt-out Requests")
528 ),
529 );
530 $this->criteriaCheck($criteriaCheck, $mailingReportUrl);
531 }
532
533 function criteriaCheck($criteriaCheck, $mailingReportUrl) {
534 foreach($criteriaCheck as $key => $infoFilter) {
535 foreach($infoFilter as $entity => $dataToCheck) {
536 $this->open($mailingReportUrl);
537 if ($entity == "report") {
538 $this->click("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$key}']]/descendant::td[3]/span/a[1][text()='Report']");
539 } else {
540 $this->click("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$key}']]/descendant::td[3]/span/a[2][text()='Advanced Search']");
541 }
542 $this->waitForPageToLoad($this->getTimeoutMsec());
543 $this-> _verifyCriteria($key, $dataToCheck, $entity);
544 }
545 }
546 }
547
548 function _verifyCriteria($summaryInfo, $dataToCheck, $entity) {
549 foreach($dataToCheck as $key => $value) {
550 if ($entity == 'report') {
551 if ($key == 'report_name') {
552 $this->assertElementContainsText('page-title', "{$value}");
553 continue;
554 }
555 $this->assertTrue($this->isElementPresent("xpath=//form//div[3]/table/tbody//tr/th[contains(text(),'{$key}')]/../td[contains(text(),'{$value}')]"),"Criteria check for {$key} failed for Report for {$summaryInfo}");
556 } else {
557 $this->assertElementContainsText('page-title', "Advanced Search");
558 $assertedValue = $this->isElementPresent("xpath=//div[@class='crm-results-block']//div[@class='qill'][contains(text(),'{$key} {$value}')]");
559 if (!$assertedValue) {
560 $assertedValue = $this->isTextPresent("{$key} {$value}");
561 }
562 $this->assertTrue($assertedValue,"Criteria check for {$key} failed for Advance Search for {$summaryInfo}");
563 }
564 }
565 }
566 }