commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / tests / phpunit / WebTest / Mailing / MailingTest.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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("xpath=//ul/li/a[text()='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("xpath=//ul/li/a[text()='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 seperate 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->type('name', 'Test Domain');
330 $this->type('domain', 'example.com');
331 $this->select('protocol', 'value=1');
332 $this->clickLink('_qf_MailSettings_next-bottom');
333
334 $this->openCiviPage("a/#/mailing/new");
335
336 //-------select recipients----------
337 $tokens = ' {domain.address}{action.optOutUrl}';
338
339 // fill mailing name
340 $mailingName = substr(sha1(rand()), 0, 7);
341 $this->waitForElementPresent("xpath=//input[@name='mailingName']");
342 $this->type("xpath=//input[@name='mailingName']", "Mailing $mailingName Webtest");
343
344 // Add the test mailing group
345 $this->select2("s2id_crmUiId_8", $groupName, TRUE);
346
347 // do check count for Recipient
348 $this->waitForTextPresent("~1 recipient");
349
350 // fill subject for mailing
351 $this->type("xpath=//input[@name='subject']", "Test subject {$mailingName} for Webtest");
352
353 // HTML format message
354 $HTMLMessage = "This is HTML formatted content for Mailing {$mailingName} Webtest.";
355 $this->fillRichTextField("crmUiId_1", $HTMLMessage . $tokens);
356
357 // FIXME: Selenium can't access content in an iframe
358 //$this->click("xpath=//div[@class='preview-popup']//a[text()='Preview as HTML']");
359 //$this->waitForElementPresent($HTMLMessage);
360 //$this->waitForAjaxContent();
361 //$this->click("xpath=//button[@title='Close']");
362
363 // Open Plain-text Format pane and type text format msg
364 $this->click("//div[starts-with(text(),'Plain Text')]");
365 $this->type("xpath=//*[@name='body_text']", "This is text formatted content for Mailing {$mailingName} Webtest.$tokens");
366
367 $this->click("xpath=//div[@class='preview-popup']//a[text()='Preview as Plain Text']");
368 $this->waitForTextPresent("This is text formatted content for Mailing {$mailingName} Webtest.");
369 $this->waitForAjaxContent();
370 $this->click("xpath=//button[@title='Close']");
371
372 // select default header and footer ( with label )
373 $this->click("xpath=//ul/li/a[text()='Header and Footer']");
374 $this->select2("s2id_crmUiId_10", "Mailing Header");
375 $this->select2("s2id_crmUiId_11", "Mailing Footer");
376
377 //--------track and respond----------
378
379 // check for default settings options
380 $this->click("xpath=//ul/li/a[text()='Tracking']");
381 $this->assertChecked("url_tracking");
382 $this->assertChecked("open_tracking");
383
384 // click next with default settings
385 $this->click("xpath=//div[@class='crm-wizard-buttons']/button[text()='Next']");
386
387 $this->waitForTextPresent("Mailing $mailingName Webtest");
388 $this->click("xpath=//div[@class='content']//a[text()='~1 recipient']");
389 $this->webtestVerifyTabularData(array("$firstName Mailson" => "mailino$firstName@mailson.co.in"));
390 $this->click("xpath=//button[@title='Close']");
391 $this->waitForTextPresent("(Include: $groupName)");
392
393 //----------Schedule or Send------------
394
395 // do check for default option enabled
396 $this->assertChecked("xpath=//input[@id='schedule-send-now']");
397
398 // click next with nominal content
399 $this->click("xpath=//center/a/div[text()='Submit Mailing']");
400
401 //----------end New Mailing-------------
402
403 //check redirected page to Scheduled and Sent Mailings and verify for mailing name
404 $this->waitForTextPresent("Find Mailings");
405 $this->assertElementContainsText("xpath=//form[@class='CRM_Mailing_Form_Search']/table[@class='selector row-highlight']/tbody//tr//td", "Mailing $mailingName Webtest");
406
407 // directly send schedule mailing -- not working right now
408 $this->openCiviPage("mailing/queue", "reset=1");
409
410 //click report link of created mailing
411 $this->clickLink("xpath=//table//tbody/tr[td[1]/text()='Mailing $mailingName Webtest']/descendant::a[text()='Report']");
412
413 $mailingReportUrl = $this->getLocation();
414 // do check again for recipient group
415 $this->assertElementContainsText("xpath=//fieldset/legend[text()='Recipients']/../table/tbody//tr/td", "Members of $groupName");
416
417 // verify successful deliveries
418 $this->verifyText("xpath=//table//tr[td/a[text()='Successful Deliveries']]/descendant::td[2]", preg_quote("1 (100.00%)"));
419
420 $summaryInfoLinks = array(
421 'Intended Recipients',
422 'Successful Deliveries',
423 'Tracked Opens',
424 'Click-throughs',
425 'Forwards',
426 'Replies',
427 'Bounces',
428 'Unsubscribe Requests',
429 'Opt-out Requests',
430 );
431
432 //check for report and adv search links
433 foreach ($summaryInfoLinks as $value) {
434 $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}");
435 $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}");
436 }
437 // verify mailing name
438 $this->verifyText("xpath=//table//tr[td[1]/text()='Mailing Name']/descendant::td[2]", preg_quote("Mailing $mailingName Webtest"));
439
440 // verify mailing subject
441 $this->verifyText("xpath=//table//tr[td[1]/text()='Subject']/descendant::td[2]", preg_quote("Test subject $mailingName for Webtest"));
442
443 // after asserts do clicks and confirm filters
444 $criteriaCheck = array(
445 'Intended Recipients' => array(
446 'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest"),
447 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest"),
448 ),
449 'Successful Deliveries' => array(
450 'report' => array(
451 'report_name' => 'Mailing Details',
452 'Mailing' => "Mailing $mailingName Webtest",
453 "Delivery Status" => " Successful",
454 ),
455 'search' => array(
456 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
457 'Mailing Delivery -' => "Successful",
458 ),
459 ),
460 'Tracked Opens' => array(
461 'report' => array('report_name' => 'Mail Opened', 'Mailing' => "Mailing $mailingName Webtest"),
462 'search' => array(
463 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
464 'Mailing: Trackable Opens -' => "Opened",
465 ),
466 ),
467 'Click-throughs' => array(
468 'report' => array('report_name' => 'Mail Click-Throughs', 'Mailing' => "Mailing $mailingName Webtest"),
469 'search' => array(
470 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
471 'Mailing: Trackable URL Clicks -' => "Clicked",
472 ),
473 ),
474 'Forwards' => array(
475 'report' => array(
476 'report_name' => 'Mailing Details',
477 'Mailing' => "Mailing $mailingName Webtest",
478 'Forwarded' => 'Is equal to Yes',
479 ),
480 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: -' => "Forwards"),
481 ),
482 'Replies' => array(
483 'report' => array(
484 'report_name' => 'Mailing Details',
485 'Mailing' => "Mailing $mailingName Webtest",
486 'Replied' => 'Is equal to Yes',
487 ),
488 'search' => array(
489 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
490 'Mailing: Trackable Replies -' => "Replied",
491 ),
492 ),
493 'Bounces' => array(
494 'report' => array('report_name' => 'Mail Bounces', 'Mailing' => "Mailing $mailingName Webtest"),
495 'search' => array(
496 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
497 'Mailing Delivery -' => "Bounced",
498 ),
499 ),
500 'Unsubscribe Requests' => array(
501 'report' => array(
502 'report_name' => 'Mailing Details',
503 'Mailing' => "Mailing $mailingName Webtest",
504 'Unsubscribed' => 'Is equal to Yes',
505 ),
506 'search' => array(
507 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
508 'Mailing: -' => "Unsubscribe Requests",
509 ),
510 ),
511 'Opt-out Requests' => array(
512 'report' => array(
513 'report_name' => 'Mailing Details',
514 'Mailing' => "Mailing $mailingName Webtest",
515 'Opted-out' => 'Is equal to Yes',
516 ),
517 'search' => array(
518 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
519 'Mailing: -' => "Opt-out Requests",
520 ),
521 ),
522 );
523 $this->criteriaCheck($criteriaCheck, $mailingReportUrl);
524 }
525
526 /**
527 * @param $criteriaCheck
528 * @param $mailingReportUrl
529 */
530 public function criteriaCheck($criteriaCheck, $mailingReportUrl) {
531 foreach ($criteriaCheck as $key => $infoFilter) {
532 foreach ($infoFilter as $entity => $dataToCheck) {
533 $this->open($mailingReportUrl);
534 if ($entity == "report") {
535 $this->clickLink("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$key}']]/descendant::td[3]/span/a[1][text()='Report']");
536 }
537 else {
538 $this->clickLink("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$key}']]/descendant::td[3]/span/a[2][text()='Advanced Search']");
539 }
540 $this->_verifyCriteria($key, $dataToCheck, $entity);
541 }
542 }
543 }
544
545 /**
546 * @param $summaryInfo
547 * @param $dataToCheck
548 * @param $entity
549 */
550 public function _verifyCriteria($summaryInfo, $dataToCheck, $entity) {
551 foreach ($dataToCheck as $key => $value) {
552 if ($entity == 'report') {
553 if ($key == 'report_name') {
554 $this->waitForTextPresent("{$value}");
555 continue;
556 }
557 $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}");
558 }
559 else {
560 $this->waitForTextPresent("Advanced Search");
561 $assertedValue = $this->isElementPresent("xpath=//div[@class='crm-results-block']//div[@class='qill'][contains(text(),'{$key} {$value}')]");
562 if (!$assertedValue) {
563 $assertedValue = $this->isTextPresent("{$key} {$value}");
564 }
565 $this->assertTrue($assertedValue, "Criteria check for {$key} failed for Advance Search for {$summaryInfo}");
566 }
567 }
568 }
569
570 }