Merge pull request #12026 from michaelmcandrew/pass-mailingJobId-to-hookTokenValues
[civicrm-core.git] / tests / phpunit / WebTest / Contact / SearchBuilderTest.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 5 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2018 |
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_Contact_SearchBuilderTest
31 */
32 class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase {
33
34 protected function setUp() {
35 parent::setUp();
36 }
37
38 public function testSearchBuilderOptions() {
39 $this->webtestLogin();
40
41 $groupName = $this->WebtestAddGroup();
42
43 // Open the search builder
44 $this->openCiviPage('contact/search/builder', 'reset=1');
45
46 $this->enterValues(1, 1, 'Contacts', 'Group(s)', NULL, '=', array($groupName));
47 $this->enterValues(1, 2, 'Contacts', 'Country', NULL, '=', array('UNITED STATES'));
48 $this->enterValues(1, 3, 'Individual', 'Gender', NULL, '=', array('Male'));
49 $this->click('_qf_Builder_refresh');
50 $this->waitForPageToLoad();
51
52 // We should get no results. But check the options are all still set
53 $this->waitForTextPresent('No matches found for:');
54 foreach (array($groupName, 'UNITED STATES', 'Male') as $i => $label) {
55 $this->waitForElementPresent("//span[@id='crm_search_value_1_$i']/select/option[2]");
56 $this->assertSelectedLabel("//span[@id='crm_search_value_1_$i']/select", $label);
57 }
58 }
59
60 public function testSearchBuilderRLIKE() {
61 $this->webtestLogin();
62
63 // Adding contact
64 // We're using Quick Add block on the main page for this.
65 $firstName = substr(sha1(rand()), 0, 7);
66 $this->createDetailContact($firstName);
67
68 $sortName = "adv$firstName, $firstName";
69 $displayName = "$firstName adv$firstName";
70
71 $this->_searchBuilder("Postal Code", "100[0-9]", $sortName, "RLIKE");
72 }
73
74 /**
75 * function to create contact with details (contact details, address, Constituent information ...)
76 * @param null $firstName
77 */
78 public function createDetailContact($firstName = NULL) {
79
80 if (!$firstName) {
81 $firstName = substr(sha1(rand()), 0, 7);
82 }
83
84 // create contact type Individual with subtype
85 // with most of values to required to search
86 $Subtype = "Student";
87 $this->openCiviPage('contact/add', array('reset' => 1, 'ct' => 'Individual'), '_qf_Contact_cancel');
88
89 // --- fill few values in Contact Detail block
90 $this->type("first_name", "$firstName");
91 $this->type("middle_name", "mid$firstName");
92 $this->type("last_name", "adv$firstName");
93 $this->select("contact_sub_type", "label=$Subtype");
94 $this->type("email_1_email", "$firstName@advsearch.co.in");
95 $this->type("phone_1_phone", "123456789");
96 $this->type("external_identifier", "extid$firstName");
97
98 // --- fill few values in address
99 $this->click("//form[@id='Contact']/div[2]/div[4]/div[1]");
100 $this->waitForElementPresent("address_1_geo_code_2");
101 $this->type("address_1_street_address", "street 1 $firstName");
102 $this->type("address_1_supplemental_address_1", "street supplement 1 $firstName");
103 $this->type("address_1_supplemental_address_2", "street supplement 2 $firstName");
104 $this->type("address_1_supplemental_address_3", "street supplement 3 $firstName");
105 $this->type("address_1_city", "city$firstName");
106 $this->type("address_1_postal_code", "100100");
107 $this->select("address_1_country_id", "UNITED STATES");
108 $this->select("address_1_state_province_id", "Alaska");
109
110 // save contact
111 $this->click("_qf_Contact_upload_view");
112 $this->waitForPageToLoad($this->getTimeoutMsec());
113 $this->assertTrue($this->isTextPresent("$firstName adv$firstName"));
114 }
115
116 public function testSearchBuilderContacts() {
117 $this->webtestLogin();
118
119 //Individual
120 $firstName = substr(sha1(rand()), 0, 7);
121 $streetName = "street $firstName";
122 $sortName = "adv$firstName, $firstName";
123 $this->_createContact('Individual', $firstName, "$firstName@advsearch.co.in", $streetName);
124 // search using search builder and advanced search
125 $this->_searchBuilder('Street Address', $streetName, $sortName, '=', '1');
126 $this->_advancedSearch($streetName, $sortName, 'Individual', '1', 'street_address');
127
128 //Organization
129 $orgName = substr(sha1(rand()), 0, 7) . "org";
130 $orgEmail = "ab" . rand() . "@{$orgName}.com";
131 $this->_createContact('Organization', $orgName, $orgEmail, "street $orgName");
132 // search using search builder and advanced search
133 $this->_searchBuilder('Email', $orgEmail, $orgName, '=', '1');
134 $this->_advancedSearch($orgEmail, $orgName, 'Organization', '1', 'email');
135
136 //Household
137 $householdName = "household" . substr(sha1(rand()), 0, 7);
138 $householdEmail = "h1" . rand() . "@{$householdName}.com";
139 $this->_createContact('Household', $householdName, $householdEmail, "street $householdName");
140 // search using search builder and advanced search
141 $this->_searchBuilder('Email', $householdEmail, $householdName, '=', '1');
142 $this->_advancedSearch($householdEmail, $householdName, 'Household', '1', 'email');
143
144 $this->openCiviPage("contact/add", "reset=1&ct=Individual");
145
146 // searching contacts whose email is not set
147 $firstName1 = "00a1" . substr(sha1(rand()), 0, 7);
148 $this->type("first_name", $firstName1);
149 $this->type("last_name", "01adv$firstName1");
150 // save contact
151 $this->click("_qf_Contact_upload_view");
152 $this->waitForPageToLoad($this->getTimeoutMsec());
153 $this->openCiviPage("contact/add", "reset=1&ct=Individual");
154
155 $firstName2 = "00a2" . substr(sha1(rand()), 0, 7);
156 $this->type("first_name", $firstName2);
157 $this->type("last_name", "02adv$firstName2");
158 // save contact
159 $this->click("_qf_Contact_upload_view");
160 $this->waitForPageToLoad($this->getTimeoutMsec());
161 $this->openCiviPage("contact/add", "reset=1&ct=Individual");
162
163 $firstName3 = "00a3" . substr(sha1(rand()), 0, 7);
164 $this->type("first_name", $firstName3);
165 $this->type("last_name", "03adv$firstName3");
166 // save contact
167 $this->click("_qf_Contact_upload_view");
168 $this->waitForPageToLoad($this->getTimeoutMsec());
169 $this->_searchBuilder('Email', NULL, NULL, 'IS NULL');
170 $names = array(
171 1 => $firstName1,
172 2 => $firstName2,
173 3 => $firstName3,
174 );
175 foreach ($names as $key => $value) {
176 $this->assertTrue($this->isTextPresent($value));
177 }
178 //searching contacts whose phone field is empty
179 $this->_searchBuilder('Phone', NULL, NULL, 'IS EMPTY');
180 foreach ($names as $key => $value) {
181 $this->assertTrue($this->isTextPresent($value));
182 }
183 //searching contacts whose phone field is not empty
184 $this->_searchBuilder('Phone', NULL, $firstName, 'IS NOT EMPTY');
185 $this->assertTrue($this->isTextPresent($firstName));
186
187 $firstName4 = "AB" . substr(sha1(rand()), 0, 7);
188 $postalCode = rand();
189 $this->_createContact('Individual', $firstName4, "$firstName4@advsearch.co.in", NULL, $postalCode);
190 $firstName5 = "CD" . substr(sha1(rand()), 0, 7);
191 $this->_createContact('Individual', $firstName5, "$firstName5@advsearch.co.in", NULL, $postalCode);
192 $firstName6 = "EF" . substr(sha1(rand()), 0, 7);
193 $this->_createContact('Organization', $firstName6, "$firstName6@advsearch.co.in", NULL, $postalCode);
194 $firstName7 = "GH" . substr(sha1(rand()), 0, 7);
195 $this->_createContact('Household', $firstName7, "$firstName7@advsearch.co.in", NULL, $postalCode);
196
197 // check if the resultset of search builder and advanced search match for the postal code
198 $this->_searchBuilder('Postal Code', $postalCode, NULL, 'LIKE', '4');
199 $this->_advancedSearch($postalCode, NULL, NULL, '4', 'postal_code');
200
201 $firstName8 = "abcc" . substr(sha1(rand()), 0, 7);
202 $this->_createContact('Individual', $firstName8, "$firstName8@advsearch.co.in", NULL);
203 $this->_searchBuilder('Note(s): Body and Subject', "this is notes by $firstName8 adv$firstName8", $firstName8, 'LIKE');
204 $this->_searchBuilder('Note(s): Subject Only', "this is subject by $firstName8 adv$firstName8", $firstName8, 'LIKE');
205 $this->_searchBuilder('Note(s): Body Only', "this is notes by $firstName8 adv$firstName8", $firstName8, 'LIKE');
206 $this->_advancedSearch("this is notes by $firstName8 adv$firstName8", $firstName8, NULL, NULL, 'note_body', 'notes');
207 $this->_advancedSearch("this is subject by $firstName8 adv$firstName8", $firstName8, NULL, NULL, 'note_subject', 'notes');
208 $this->_advancedSearch("this is notes by $firstName8 adv$firstName8", $firstName8, NULL, NULL, 'note_both', 'notes');
209 $this->_advancedSearch("this is notes by $firstName8 adv$firstName8", $firstName8, NULL, NULL, 'note_both', 'notes');
210 }
211
212 /**
213 * @param $field
214 * @param null $fieldValue
215 * @param null $name
216 * @param string $op
217 * @param null $count
218 */
219 public function _searchBuilder($field, $fieldValue = NULL, $name = NULL, $op = '=', $count = NULL) {
220 // search builder using contacts(not using contactType)
221 $this->openCiviPage("contact/search/builder", "reset=1");
222 $this->enterValues(1, 1, 'Contacts', $field, NULL, $op, "$fieldValue");
223 $this->click("id=_qf_Builder_refresh");
224 $this->waitForPageToLoad($this->getTimeoutMsec());
225 if (($op == '=' || $op == 'LIKE') && $fieldValue) {
226 $this->assertElementContainsText('css=.crm-search-results > table.row-highlight', "$fieldValue");
227 }
228 if ($name) {
229 $this->assertElementContainsText('css=.crm-search-results > table.row-highlight', "$name");
230 }
231 if ($count) {
232 $this->assertElementContainsText('search-status', "$count Contact");
233 }
234 }
235
236 /**
237 * Enter form values in a Search Builder row.
238 * @param $set
239 * @param $row
240 * @param $entity
241 * @param $field
242 * @param $loc
243 * @param $op
244 * @param string $value
245 */
246 public function enterValues($set, $row, $entity, $field, $loc, $op, $value = '') {
247 if ($set > 1 && $row == 1) {
248 $this->click('addBlock');
249 }
250 if ($row > 1) {
251 $this->click("addMore_{$set}");
252 }
253 // In the DOM rows are 0 indexed and sets are 1 indexed, so normalizing
254 $row--;
255
256 $this->waitForElementPresent("mapper_{$set}_{$row}_0");
257 $this->select("mapper_{$set}_{$row}_0", "label=$entity");
258 $this->select("mapper_{$set}_{$row}_1", "label=$field");
259 if ($loc) {
260 $this->select("mapper_{$set}_{$row}_2", "label=$loc");
261 }
262 $this->select("operator_{$set}_{$row}", "value=$op");
263 if (is_array($value)) {
264 $this->waitForElementPresent("css=#crm_search_value_{$set}_{$row} select option + option");
265 foreach ($value as $val) {
266 if ($op != 'IN') {
267 $select = 'select';
268
269 }
270 else {
271 $select = 'addSelection';
272
273 }
274 $this->$select("css=#crm_search_value_{$set}_{$row} select", "label=$val");
275 }
276 }
277 elseif ($value && substr($value, 0, 5) == 'date:') {
278 $this->webtestFillDate("value_{$set}_{$row}", trim(substr($value, 5)));
279 }
280 elseif ($value) {
281 $this->type("value_{$set}_{$row}", $value);
282 }
283 }
284
285 /**
286 * @param null $fieldValue
287 * @param null $name
288 * @param null $contactType
289 * @param null $count
290 * @param $field
291 */
292 public function _advancedSearch($fieldValue = NULL, $name = NULL, $contactType = NULL, $count = NULL, $field) {
293 //advanced search by selecting the contactType
294 $this->openCiviPage("contact/search/advanced", "reset=1");
295 if (isset($contactType)) {
296 $this->select("id=contact_type", "value=$contactType");
297 }
298 if (substr($field, 0, 5) == 'note_') {
299 $this->click("notes");
300 $this->waitForElementPresent("xpath=//div[@id='notes-search']/table/tbody/tr/td[2]/input[3]");
301 if ($field == 'note_body') {
302 $this->click("CIVICRM_QFID_2_note_option");
303 }
304 elseif ($field == 'note_subject') {
305 $this->click("CIVICRM_QFID_3_note_option");
306 }
307 else {
308 $this->click("CIVICRM_QFID_6_note_option");
309 }
310 $this->type("note", $fieldValue);
311 }
312 else {
313 $this->click("location");
314 $this->waitForElementPresent("$field");
315 if ($contactType == 'Individual') {
316 $this->type("$field", $fieldValue);
317 }
318 else {
319 $this->type("$field", $fieldValue);
320 }
321 }
322 $this->click("_qf_Advanced_refresh");
323 $this->waitForPageToLoad($this->getTimeoutMsec());
324
325 //the search result should be same as the one that we got in search builder
326 if ($fieldValue) {
327 $this->assertElementContainsText('Advanced', "$fieldValue");
328 }
329 if ($name) {
330 $this->assertElementContainsText('css=.crm-search-results > table.row-highlight', "$name");
331 }
332 if ($count) {
333 $this->assertElementContainsText('search-status', "$count Contact");
334 }
335 }
336
337 /**
338 * @param $contactType
339 * @param string $name
340 * @param $email
341 * @param null $streetName
342 * @param null $postalCode
343 */
344 public function _createContact($contactType, $name, $email, $streetName = NULL, $postalCode = NULL) {
345 $this->openCiviPage('contact/add', array('reset' => 1, 'ct' => $contactType), '_qf_Contact_cancel');
346
347 if ($contactType == 'Individual') {
348 $this->type("first_name", "$name");
349 $this->type("last_name", "adv$name");
350 $name = "$name adv$name";
351 }
352 elseif ($contactType == 'Organization') {
353 $this->type("organization_name", $name);
354 }
355 else {
356 $this->type("household_name", $name);
357 }
358 $this->click("//form[@id='Contact']/div[2]/div[4]/div[1]");
359 $this->waitForElementPresent("address_1_geo_code_2");
360 $this->type("email_1_email", $email);
361 $this->type("phone_1_phone", "9876543210");
362 $this->type("address_1_street_address", $streetName);
363 $this->select("address_1_country_id", "UNITED STATES");
364 $this->select("address_1_state_province_id", "Alaska");
365 $this->type("address_1_postal_code", $postalCode);
366
367 $this->click("//form[@id='Contact']/div[2]/div[6]/div[1]");
368 $this->waitForElementPresent("note");
369 $this->type("subject", "this is subject by $name");
370 $this->type("note", "this is notes by $name");
371
372 // save contact
373 $this->click("_qf_Contact_upload_view");
374 $this->waitForPageToLoad($this->getTimeoutMsec());
375 $this->assertTrue($this->isTextPresent("$name has been created."));
376 }
377
378 /**
379 * Webtest for CRM-12148
380 */
381 public function testSearchBuilderfinancialType() {
382 $this->webtestLogin();
383
384 // add financial type
385 $financialTypeName1 = 'Financial Type' . substr(sha1(rand()), 0, 5);;
386 $financialTypeName2 = 'Financial Type' . substr(sha1(rand()), 0, 5);;
387 $financialType = array(
388 'name' => $financialTypeName1,
389 'is_reserved' => FALSE,
390 'is_deductible' => FALSE,
391 );
392 $this->addeditFinancialType($financialType);
393 $financialType['name'] = $financialTypeName2;
394 $this->addeditFinancialType($financialType);
395 //create 6 contribution
396 $this->openCiviPage("contribute/add", "reset=1&action=add&context=standalone", "_qf_Contribution_upload");
397 for ($i = 1; $i <= 6; $i++) {
398 if ($i % 2 == 0) {
399 $financialType = $financialTypeName1;
400 }
401 else {
402 $financialType = $financialTypeName2;
403 }
404 // create new contact using dialog
405 $this->createDialogContact();
406 $this->select('financial_type_id', $financialType);
407 $this->type('total_amount', 100 * $i);
408 $this->clickLink('_qf_Contribution_upload_new', '_qf_Contribution_upload_new');
409 }
410 $this->openCiviPage("contact/search/builder", "reset=1", "_qf_Builder_refresh");
411
412 $this->enterValues(1, 1, 'Contribution', 'Financial Type', NULL, '=', array($financialTypeName1));
413 $this->clickLink('_qf_Builder_refresh');
414
415 $this->assertTrue($this->isTextPresent('3 Contacts'), 'Missing text: ' . '3 Contacts');
416
417 $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
418 $this->enterValues(1, 1, 'Contribution', 'Financial Type', NULL, '=', array($financialTypeName2));
419 $this->clickLink('_qf_Builder_refresh');
420
421 $this->assertTrue($this->isTextPresent('3 Contacts'), 'Missing text: ' . '3 Contacts');
422
423 $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
424 $this->enterValues(1, 1, 'Contribution', 'Financial Type', NULL, 'IN', array(
425 $financialTypeName1,
426 $financialTypeName2,
427 ));
428 $this->clickLink('_qf_Builder_refresh');
429
430 $this->assertTrue($this->isTextPresent('6 Contacts'), 'Missing text: ' . '6 Contacts');
431 }
432
433 /**
434 * Webtest for CRM-12588
435 */
436 public function testSearchBuilderMembershipType() {
437 $this->webtestLogin();
438
439 // create first contact
440 $firstName1 = substr(sha1(rand()), 0, 7);
441 $this->webtestAddContact($firstName1, "Memberson", "Memberson{$firstName1}@memberson.name");
442 $contactName1 = "Memberson, $firstName1";
443
444 // create Second contact
445 $firstName2 = substr(sha1(rand()), 0, 7);
446 $this->webtestAddContact($firstName2, "Memberson", "Memberson{$firstName2}@memberson.name");
447 $contactName2 = "Memberson, $firstName2";
448
449 // add membership type
450 $membershipTypes = $this->webtestAddMembershipType();
451
452 // now add membership
453 $this->openCiviPage("member/add", "reset=1&action=add&context=standalone", "_qf_Membership_upload");
454
455 // select contact
456 $this->webtestFillAutocomplete($firstName1);
457
458 // fill in Membership Organization
459 $this->waitForElementPresent("membership_type_id[0]");
460 $this->select("membership_type_id[0]", "label={$membershipTypes['member_of_contact']}");
461
462 // select membership type
463 $this->waitForElementPresent("membership_type_id[1]");
464 $this->select("membership_type_id[1]", "label={$membershipTypes['membership_type']}");
465
466 // fill in Source
467 $this->type("source", "Membership StandaloneAddTest Webtest");
468
469 // fill in Start Date
470 $this->webtestFillDate('start_date');
471
472 // Clicking save.
473 $this->clickLink("_qf_Membership_upload");
474
475 // page was loaded
476 $this->waitForTextPresent("Membership StandaloneAddTest Webtest");
477
478 // now add membership for second contact
479 $this->openCiviPage("member/add", "reset=1&action=add&context=standalone", "_qf_Membership_upload");
480 $this->webtestFillAutocomplete($firstName2);
481 $this->select("membership_type_id[0]", "label={$membershipTypes['member_of_contact']}");
482 $this->select("membership_type_id[1]", "label={$membershipTypes['membership_type']}");
483 $this->type("source", "Membership StandaloneAddTest Webtest");
484 $this->webtestFillDate('start_date');
485
486 // fill in Status Override?
487 $this->click("is_override");
488 $this->waitForElementPresent("status_id");
489 $this->select("status_id", "label=Grace");
490
491 // Clicking save.
492 $this->clickLink("_qf_Membership_upload");
493 $this->waitForTextPresent("Membership StandaloneAddTest Webtest");
494
495 // Open the search builder
496 $this->openCiviPage('contact/search/builder', 'reset=1');
497 $this->enterValues(1, 1, 'Membership', 'Membership Type', NULL, '=', array($membershipTypes['membership_type']));
498
499 $this->clickLink('_qf_Builder_refresh');
500 $this->waitForAjaxContent();
501 $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td", "2 Contacts");
502
503 $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
504 $this->enterValues(1, 2, 'Membership', 'Membership Status', NULL, '=', array('New'));
505 $this->clickLink('_qf_Builder_refresh');
506 $this->waitForAjaxContent();
507 $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td", "1 Contact");
508
509 $this->enterValues(1, 2, 'Membership', 'Membership Status', NULL, '=', array('Grace'));
510 $this->clickLink('_qf_Builder_refresh');
511 $this->waitForAjaxContent();
512 $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td", "1 Contact");
513
514 $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
515 $this->waitForElementPresent("xpath=//div[@id='map-field']/div[1]/table/tbody/tr[2]/td/a");
516 $this->click("xpath=//div[@id='map-field']/div[1]/table/tbody/tr[2]/td/a");
517 $this->enterValues(1, 2, 'Membership', 'Membership Status', NULL, 'IN', array('New', 'Grace'));
518 $this->clickLink('_qf_Builder_refresh');
519 $this->waitForAjaxContent();
520 $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td", "2 Contacts");
521
522 $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
523 $this->waitForElementPresent("xpath=//div[@id='map-field']/div[1]/table/tbody/tr[2]/td/a");
524 $this->click("xpath=//div[@id='map-field']/div[1]/table/tbody/tr[2]/td/a");
525 $this->enterValues(1, 2, 'Membership', 'Membership Status', NULL, 'IN', array('Current', 'Expired'));
526 $this->clickLink('_qf_Builder_refresh');
527 $this->waitForText("xpath=//form[@id='Builder']/div[3]/div/div", "No matches found for");
528
529 // Find Membership
530 $this->openCiviPage("member/search", "reset=1", "_qf_Search_refresh");
531 $this->select2('membership_type_id', $membershipTypes['membership_type'], TRUE);
532 $this->clickLink('_qf_Search_refresh');
533 $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[1]", "2 Result");
534
535 $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
536 $this->multiselect2("membership_status_id", array("New", "Grace"));
537 $this->clickLink('_qf_Search_refresh');
538 $this->waitForAjaxContent();
539 $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td", "2 Results");
540
541 $this->openCiviPage("member/search", "reset=1", "_qf_Search_refresh");
542 $this->waitForAjaxContent();
543 $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
544 $this->select2('membership_type_id', $membershipTypes['membership_type'], TRUE);
545 $this->multiselect2("membership_status_id", array("New"));
546 $this->click('_qf_Search_refresh');
547 $this->waitForAjaxContent();
548 $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td", "1 Result");
549 }
550
551 }