Merge pull request #7227 from yashodha/CRM-17563
[civicrm-core.git] / tests / phpunit / WebTest / Member / InheritedMembershipTest.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_Member_InheritedMembershipTest
31 */
32 class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase {
33 protected function setUp() {
34 parent::setUp();
35 }
36
37 public function testInheritedMembership() {
38 $this->markTestSkipped('Skipping for now as it works fine locally.');
39 // Log in using webtestLogin() method
40 $this->webtestLogin();
41
42 $this->openCiviPage('contact/add', 'reset=1&ct=Organization', '_qf_Contact_cancel');
43
44 $title = substr(sha1(rand()), 0, 7);
45 $this->type('organization_name', "Organization $title");
46 $this->type('email_1_email', "$title@org.com");
47 $this->click('_qf_Contact_upload_view');
48 $this->waitForPageToLoad($this->getTimeoutMsec());
49 $this->waitForText('crm-notification-container', "Organization {$title} has been created.");
50
51 $this->openCiviPage('admin/member/membershipType', 'reset=1&action=browse');
52
53 $this->click('link=Add Membership Type');
54 $this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
55
56 $this->type('name', "Membership Type $title");
57
58 $this->select2('member_of_contact_id', $title);
59
60 $this->type('minimum_fee', '100');
61 $this->select('financial_type_id', 'value=2');
62 $this->type('duration_interval', 1);
63 $this->select('duration_unit', 'label=year');
64
65 $this->select('period_type', 'value=rolling');
66
67 $this->select2('relationship_type_id', 'Employer of', TRUE);
68 $this->type('max_related', '5');
69
70 $this->click('_qf_MembershipType_upload-bottom');
71 $this->waitForElementPresent('link=Add Membership Type');
72 $this->waitForText('crm-notification-container', "Membership Type $title");
73
74 $this->openCiviPage('contact/add', 'reset=1&ct=Organization', '_qf_Contact_cancel');
75
76 // creating another Orgnization
77 $title1 = substr(sha1(rand()), 0, 7);
78 $this->type('organization_name', "Organization $title1");
79 $this->type('email_1_email', "$title1@org.com");
80 $this->click('_qf_Contact_upload_view');
81 $this->waitForPageToLoad($this->getTimeoutMsec());
82
83 // click through to the membership view screen
84 $this->click('css=li#tab_member a');
85
86 $this->waitForElementPresent('link=Add Membership');
87 $this->click('link=Add Membership');
88
89 $this->waitForElementPresent('_qf_Membership_cancel-bottom');
90
91 // fill in Membership Organization and Type
92 $this->select('membership_type_id[0]', "label=Organization $title");
93 $this->select('membership_type_id[1]', "label=Membership Type $title");
94
95 $sourceText = 'Membership ContactAddTest with Fixed Membership Type';
96 // fill in Source
97 $this->type('source', $sourceText);
98
99 // Clicking save.
100 $this->click('_qf_Membership_upload');
101 $this->waitForElementPresent('link=Add Membership');
102
103 // page was loaded
104 $this->waitForTextPresent($sourceText);
105
106 // Is status message correct?
107 $this->waitForText('crm-notification-container', "Membership Type $title");
108
109 // click through to the membership view screen
110 $this->click("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']");
111 $this->waitForElementPresent('_qf_MembershipView_cancel-bottom');
112
113 $joinDate = date('Y-m-d');
114 $startDate = date('Y-m-d');
115 $endDate = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d') - 1, date('Y') + 1));
116 $configVars = new CRM_Core_Config_Variables();
117 foreach (array(
118 'joinDate',
119 'startDate',
120 'endDate',
121 ) as $date) {
122 $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
123 }
124
125 $this->webtestVerifyTabularData(
126 array(
127 'Membership Type' => "Membership Type $title",
128 'Status' => 'New',
129 'Source' => $sourceText,
130 'Member Since' => $joinDate,
131 'Start date' => $startDate,
132 'End date' => $endDate,
133 'Max related' => "5",
134 )
135 );
136
137 // Adding contact
138 // We're using Quick Add block on the main page for this.
139 $firstName = substr(sha1(rand()), 0, 7);
140 $this->webtestAddContact($firstName, 'Anderson', "$firstName@anderson.name");
141
142 // visit relationship tab
143 $this->click('css=li#tab_rel a');
144 $this->waitForElementPresent('css=div.action-link');
145 $this->click("//div[@class='action-link']/a/span");
146 $this->waitForElementPresent('_qf_Relationship_cancel-bottom');
147 $this->click('relationship_type_id');
148 $this->select('relationship_type_id', 'label=Employee of');
149
150 $this->select2('related_contact_id', $title1, TRUE);
151
152 $description = 'Well here is some description !!!!';
153 $this->type('description', $description);
154
155 //save the relationship
156 $this->click('_qf_Relationship_upload-bottom');
157 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']");
158 //check the status message
159 $this->waitForText('crm-notification-container', 'Relationship created.');
160
161 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody//tr/td[9]/span/a[text()='View']");
162
163 // click through to the membership view screen
164 $this->click('css=li#tab_member a');
165 $this->waitForElementPresent('css=div#memberships');
166
167 // click through to the membership view screen
168 $this->click("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']");
169 $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
170
171 $this->webtestVerifyTabularData(
172 array(
173 'Membership Type' => "Membership Type $title",
174 'Status' => 'New',
175 'Source' => $sourceText,
176 'Member Since' => $joinDate,
177 'Start date' => $startDate,
178 'End date' => $endDate,
179 )
180 );
181 $this->click("_qf_MembershipView_cancel-bottom");
182 $this->waitForElementPresent('css=div#memberships');
183
184 //1. change relationship status on form
185 $this->click('css=li#tab_rel a');
186 $this->waitForElementPresent('css=div.action-link');
187
188 $this->click("//li[@id='tab_rel']/a");
189 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody//tr/td[9]/span/a[text()='Edit']");
190 $id = explode('&id=', $this->getAttribute("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody//tr/td[9]/span/a@href"));
191 $id = explode('&', $id[0]);
192 $id = explode('=', $id[2]);
193 $id = $id[1];
194 $this->click("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody//tr/td[9]/span/a[text()='Edit']");
195
196 $this->waitForElementPresent('is_active');
197 //disable relationship
198 if ($this->isChecked('is_active')) {
199 $this->click('is_active');
200 }
201 $this->click('_qf_Relationship_upload');
202 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']");
203 //check the status message
204 $this->waitForText('crm-notification-container', 'Relationship record has been updated');
205
206 // click through to the membership view screen
207 $this->click('css=li#tab_member a');
208
209 //verify inherited membership has been removed
210 $this->openCiviPage("contact/view", "reset=1&cid=$id&selectedChild=member", "xpath=//div[@class='view-content']/div[3]");
211 $this->waitForTextPresent("No memberships have been recorded for this contact.");
212
213 // visit relationship tab and re-enable the relationship
214 $this->click('css=li#tab_rel a');
215 $this->waitForElementPresent('css=div.action-link');
216 $this->click("//li[@id='tab_rel']/a");
217
218 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-past']/div/table/tbody//tr/td[9]/span/a[text()='Edit']");
219 $this->click("xpath=//div[@class='crm-contact-relationship-past']/div/table/tbody//tr/td[9]/span/a[text()='Edit']");
220 $this->waitForElementPresent('is_active');
221 if (!$this->isChecked('is_active')) {
222 $this->click('is_active');
223 }
224 $this->click('_qf_Relationship_upload');
225 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']");
226 //check the status message
227 $this->waitForText('crm-notification-container', 'Relationship record has been updated.');
228
229 //check for memberships
230 $this->click('css=li#tab_member a');
231 $this->waitForElementPresent('css=div#memberships');
232
233 //2 . visit relationship tab and disable the relationship (by links)
234 //disable relationship
235 $this->click('css=li#tab_rel a');
236 $this->waitForElementPresent('css=div.action-link');
237 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody//tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Disable']");
238 $this->click("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody//tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Disable']");
239 $this->waitForTextPresent('Are you sure you want to disable this relationship?');
240 $this->click("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Yes']");
241 // Because it tends to cause problems, all uses of sleep() must be justified in comments
242 // Sleep should never be used for wait for anything to load from the server
243 // Justification for this instance: FIXME
244 sleep(10);
245
246 //verify inherited membership has been removed
247 $this->openCiviPage("contact/view", "reset=1&cid={$id}&selectedChild=member", "xpath=//div[@class='view-content']/div[3]");
248 $this->waitForTextPresent("No memberships have been recorded for this contact.");
249
250 //enable relationship
251 $this->click('css=li#tab_rel a');
252 $this->waitForElementPresent('css=div.action-link');
253
254 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-past']/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Enable']");
255 $this->click("xpath=//div[@class='crm-contact-relationship-past']/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Enable']");
256
257 //verify membership
258 $this->click('css=li#tab_member a');
259 $this->waitForTextPresent("No memberships have been recorded for this contact.");
260 }
261
262 /**
263 * Webtest for CRM-10146
264 */
265 public function testInheritedMembershipActivity() {
266 // Log in using webtestLogin() method
267 $this->webtestLogin();
268
269 $this->openCiviPage('contact/add', 'reset=1&ct=Organization', '_qf_Contact_cancel');
270
271 $title = substr(sha1(rand()), 0, 7);
272 $this->type('organization_name', "Organization $title");
273 $this->type('email_1_email', "$title@org.com");
274 $this->clickLink('_qf_Contact_upload_view');
275 $this->waitForText('crm-notification-container', "Organization {$title} has been created.");
276
277 $this->openCiviPage('admin/member/membershipType', 'reset=1&action=browse');
278
279 $this->click('link=Add Membership Type');
280 $this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
281
282 $this->type('name', "Membership Type $title");
283
284 $this->select2('member_of_contact_id', $title);
285
286 $this->type('minimum_fee', '100');
287 $this->select('financial_type_id', 'label=Member Dues');
288 $this->type('duration_interval', 1);
289 $this->select('duration_unit', 'label=year');
290
291 $this->select('period_type', 'value=rolling');
292
293 $this->select2('relationship_type_id', 'Employer of', TRUE);
294 $this->type('max_related', '5');
295
296 $this->click('_qf_MembershipType_upload-bottom');
297 $this->waitForElementPresent('link=Add Membership Type');
298 $this->waitForText('crm-notification-container', "Membership Type $title");
299
300 // creating another Organization
301 $this->openCiviPage('contact/add', 'reset=1&ct=Organization', '_qf_Contact_cancel');
302 $org1 = substr(sha1(rand()), 0, 7);
303 $this->type('organization_name', "Organization $org1");
304 $this->type('email_1_email', "$org1@org.com");
305 $this->clickLink('_qf_Contact_upload_view');
306
307 // click through to the membership view screen
308 $this->click('css=li#tab_member a');
309
310 $this->waitForElementPresent('link=Add Membership');
311 $this->click('link=Add Membership');
312
313 $this->waitForElementPresent('_qf_Membership_cancel-bottom');
314
315 // fill in Membership Organization and Type
316 $this->select('membership_type_id[0]', "label=Organization $title");
317 $this->select('membership_type_id[1]', "label=Membership Type $title");
318
319 $sourceText = 'Membership ContactAddTest with Rolling Membership Type';
320 // fill in Source
321 $this->type('source', $sourceText);
322
323 // Clicking save.
324 $this->click('_qf_Membership_upload');
325
326 // page was loaded
327 $this->waitForTextPresent($sourceText);
328
329 // Is status message correct?
330 $this->waitForText('crm-notification-container', "Membership Type $title");
331
332 // Adding contact
333 $this->openCiviPage('contact/add', 'reset=1&ct=Individual', '_qf_Contact_cancel-bottom');
334 $firstName = substr(sha1(rand()), 0, 7);
335 $lastName = 'Anderson';
336 $email = "$firstName@anderson.name";
337 $this->type("first_name", $firstName);
338 $this->type("last_name", $lastName);
339
340 // Set Current Employer
341 $this->select2('employer_id', $org1);
342 $this->waitForText('s2id_employer_id', $org1);
343
344 $this->type("email_1_email", $email);
345 $this->clickLink("_qf_Contact_upload_view-bottom");
346 $cid = $this->urlArg('cid');
347
348 // click through to the membership view screen
349 $this->click('css=li#tab_member a');
350 $this->waitForElementPresent("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']");
351
352 // check number of membership for contact
353 $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_member']/a/em"));
354
355 $url = $this->parseURL($this->getAttribute("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']@href"));
356 $expectedMembershipId = $url['queryString']['id'];
357
358 // click through to the activity view screen
359 $this->click('css=li#tab_activity a');
360 $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr/td[8]/span/a[text()='View']");
361
362 // check number of activity for contact
363 $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_activity']/a/em"));
364
365 $url = $this->parseURL($this->getAttribute("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr/td[8]/span/a[text()='View']@href"));
366 $expectedMembershipActivityId = $url['queryString']['id'];
367
368 // verify membership id with membership activity id
369 $this->assertEquals($expectedMembershipId, $expectedMembershipActivityId);
370
371 // click through to the relationship view screen
372 $this->click('css=li#tab_rel a');
373 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody/tr/td[2]/a");
374 $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody/tr/td[2]/a[text()='Organization $org1']"));
375 $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_rel']/a/em"));
376
377 // Edit Contact but do not change any field
378 $this->waitForElementPresent("xpath=//ul[@id='actions']/li[2]/a/span");
379 $this->clickLink("xpath=//ul[@id='actions']/li[2]/a/span");
380 $this->waitForElementPresent('_qf_Contact_cancel-bottom');
381 $this->clickLink("_qf_Contact_upload_view-top");
382
383 // click through to the membership view screen after edit
384 $this->click('css=li#tab_member a');
385 $this->waitForElementPresent("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']");
386 $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_member']/a/em"));
387
388 $url = $this->parseURL($this->getAttribute("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']@href"));
389 $actualMembershipId1 = $url['queryString']['id'];
390
391 // click through to the activity view screen after edit
392 $this->click('css=li#tab_activity a');
393 $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr/td[8]/span/a[text()='View']");
394 $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_activity']/a/em"));
395 $url = $this->parseURL($this->getAttribute("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr/td[8]/span/a[text()='View']@href"));
396 $actualMembershipActivityId1 = $url['queryString']['id'];
397
398 // verify membership id and membership activity id with previous one
399 // FIXME: These 2 lines are currently failing because the inherited membership and signup activity or being recreated when contact is edited/saved. dgg
400 $this->assertEquals($expectedMembershipId, $actualMembershipId1);
401 $this->assertEquals($expectedMembershipActivityId, $actualMembershipActivityId1);
402
403 // click through to the relationship view screen after edit
404 $this->click('css=li#tab_rel a');
405 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody/tr/td[2]/a");
406 $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody/tr/td[2]/a[text()='Organization $org1']"));
407 $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_rel']/a/em"));
408
409 // change the current employer of the contact
410 // creating another membership type
411 $this->openCiviPage('admin/member/membershipType', 'reset=1&action=browse');
412
413 $this->click('link=Add Membership Type');
414 $this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
415
416 $this->type('name', "Membership Type Another $title");
417
418 $this->select2('member_of_contact_id', $title);
419
420 $this->type('minimum_fee', '100');
421 $this->select('financial_type_id', 'label=Member Dues');
422 $this->type('duration_interval', 1);
423 $this->select('duration_unit', 'label=year');
424
425 $this->select('period_type', 'value=rolling');
426
427 $this->select2('relationship_type_id', 'Employer of', TRUE);
428 $this->type('max_related', '5');
429
430 $this->click('_qf_MembershipType_upload-bottom');
431 $this->waitForElementPresent('link=Add Membership Type');
432 $this->waitForText('crm-notification-container', "Membership Type Another $title");
433
434 // creating another Orgnization
435 $this->openCiviPage('contact/add', 'reset=1&ct=Organization', '_qf_Contact_cancel');
436 $org2 = substr(sha1(rand()), 0, 7);
437 $this->type('organization_name', "Organization $org2");
438 $this->type('email_1_email', "$org2@org.com");
439 $this->clickLink('_qf_Contact_upload_view');
440
441 // click through to the membership view screen
442 $this->click('css=li#tab_member a');
443 $this->waitForElementPresent('link=Add Membership');
444 $this->click('link=Add Membership');
445 $this->waitForElementPresent('_qf_Membership_cancel-bottom');
446
447 // fill in Membership Organization and Type
448 $this->select('membership_type_id[0]', "label=Organization $title");
449 $this->select('membership_type_id[1]', "label=Membership Type Another $title");
450
451 $sourceText = 'Membership ContactAddTest with Rolling Membership Type';
452 $this->type('source', $sourceText);
453 $this->clickLink('_qf_Membership_upload', 'link=Add Membership', FALSE);
454 $this->waitForTextPresent($sourceText);
455
456 // Is status message correct?
457 $this->waitForText('crm-notification-container', "Membership Type Another $title");
458
459 // edit contact
460 $this->openCiviPage("contact/add", "reset=1&action=update&cid=$cid", "_qf_Contact_cancel-bottom");
461
462 // change Current Employer
463 $this->select2('employer_id', $org2);
464 $this->clickLink("_qf_Contact_upload_view-bottom");
465
466 // click through to the membership view screen
467 $this->click('css=li#tab_member a');
468 $this->waitForElementPresent("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']");
469 $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_member']/a/em"));
470 $url = $this->parseURL($this->getAttribute("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']@href"));
471 $actualMembershipId2 = $url['queryString']['id'];
472
473 // click through to the activity view screen
474 $this->click('css=li#tab_activity a');
475 $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr/td[8]/span/a[text()='View']");
476 $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_activity']/a/em"));
477 $url = $this->parseURL($this->getAttribute("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr/td[8]/span/a[text()='View']@href"));
478 $actualMembershipActivityId2 = $url['queryString']['id'];
479
480 // verify membership id and membership activity id with previous one
481 $this->assertNotEquals($expectedMembershipId, $actualMembershipId2);
482 $this->assertNotEquals($expectedMembershipId, $actualMembershipActivityId2);
483
484 // click through to the relationship view screen
485 $this->click('css=li#tab_rel a');
486 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody/tr/td[2]/a");
487 $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody/tr/td[2]/a[text()='Organization $org2']"));
488 $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_rel']/a/em"));
489
490 // creating another Orgnization with no membership
491 $this->openCiviPage('contact/add', 'reset=1&ct=Organization', '_qf_Contact_cancel');
492 $org3 = substr(sha1(rand()), 0, 7);
493 $this->type('organization_name', "Organization $org3");
494 $this->type('email_1_email', "$org3@org.com");
495 $this->clickLink('_qf_Contact_upload_view');
496
497 // edit contact
498 $this->openCiviPage("contact/add", "reset=1&action=update&cid=$cid", "_qf_Contact_cancel-bottom");
499
500 // change Current Employer
501 $this->select2('employer_id', $org3);
502 $this->clickLink("_qf_Contact_upload_view-bottom");
503
504 // click through to the membership view screen
505 $this->click('css=li#tab_member a');
506
507 $this->waitForAjaxContent();
508 $this->waitForTextPresent("No memberships have been recorded for this contact.");
509 $this->assertEquals(0, $this->getText("xpath=//li[@id='tab_member']/a/em"));
510
511 // click through to the activity view screen
512 $this->click('css=li#tab_activity a');
513 $this->waitForText("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td", "No matches found.");
514 $this->assertEquals(0, $this->getText("xpath=//li[@id='tab_activity']/a/em"));
515
516 // click through to the relationship view screen
517 $this->click('css=li#tab_rel a');
518 $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody/tr/td[2]/a");
519 $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div/table/tbody/tr/td[2]/a[text()='Organization $org3']"));
520 $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_rel']/a/em"));
521 }
522
523 }