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