3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.5 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
27 require_once 'CiviTest/CiviSeleniumTestCase.php';
30 * Class WebTest_Member_OnlineMembershipRenewTest
32 class WebTest_Member_OnlineMembershipRenewTest
extends CiviSeleniumTestCase
{
34 protected function setUp() {
39 * FIXME: This test tries to update a contribution page (id=2) that may not exist :(
41 function testOnlineMembershipRenew() {
42 // a random 7-char string and an even number to make this pass unique
43 $hash = substr(sha1(rand()), 0, 7);
44 $rand = 2 * rand(2, 50);
46 // Log in using webtestLogin() method
47 $this->webtestLogin();
49 // We need a payment processor
50 $processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7);
51 $this->webtestAddPaymentProcessor($processorName);
53 $this->openCiviPage("admin/contribute/amount", "reset=1&action=update&id=2", "_qf_Amount_next");
54 // this contribution page for membership signup
55 // select newly created processor
56 $xpath = "xpath=//label[text() = '{$processorName}']/preceding-sibling::input[1]";
57 $this->waitForText('css=.crm-contribution-contributionpage-amount-form-block-payment_processor', $processorName);
61 $this->waitForElementPresent("_qf_Amount_next");
62 $this->clickLink('_qf_Amount_next');
64 // go to Membership block
65 $this->click('css=#tab_membership a');
66 $this->waitForElementPresent("member_is_active");
67 $this->check("member_is_active");
69 $this->waitForElementPresent("new_title");
71 if ($this->isElementPresent("member_price_set_id")) {
72 $this->waitForElementPresent("member_price_set_id");
74 $this->select("member_price_set_id", "label=- none -");
77 $this->waitForElementPresent("membership_type-block");
78 $this->check("xpath=//tr[@id='membership_type-block']/td[2]/table/tbody/tr/td/label[text()='General']/../input[2]");
79 $this->check("xpath=//tr[@id='membership_type-block']/td[2]/table/tbody/tr/td/label[text()='Student']/../input[2]");
80 $this->click("_qf_MembershipBlock_next-bottom");
81 $this->waitForTextPresent("'MembershipBlock' information has been saved");
84 $this->click('css=#tab_custom a');
87 $this->waitForElementPresent('custom_pre_id');
88 $this->select('css=tr.crm-contribution-contributionpage-custom-form-block-custom_pre_id span.crm-profile-selector-select select', 'value=1');
91 $this->click('_qf_Custom_upload_done');
92 $this->waitForPageToLoad();
94 $firstName = 'Ma' . substr(sha1(rand()), 0, 4);
95 $lastName = 'An' . substr(sha1(rand()), 0, 7);
96 $email = $firstName . "@example.com";
99 $this->webtestLogout();
101 //Go to online membership signup page
102 $this->openCiviPage("contribute/transact", "reset=1&id=2", "_qf_Main_upload-bottom");
104 $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
106 //Type first name and last name and email
107 $this->type("first_name", $firstName);
108 $this->type("last_name", $lastName);
109 $this->type("email-5", $email);
110 $this->select("state_province-1", "value=1001");
113 $this->select("credit_card_type", "value=Visa");
114 $this->select("credit_card_type", "label=Visa");
115 $this->type("credit_card_number", "4111111111111111");
116 $this->type("cvv2", "000");
117 $this->select("credit_card_exp_date[M]", "value=1");
118 $this->select("credit_card_exp_date[Y]", "value=2020");
121 $this->type("billing_first_name", $firstName . "billing");
122 $this->type("billing_last_name", $lastName . "billing");
123 $this->type("billing_street_address-5", "15 Main St.");
124 $this->type(" billing_city-5", "San Jose");
125 $this->select("billing_country_id-5", "value=1228");
126 $this->select("billing_state_province_id-5", "value=1004");
127 $this->type("billing_postal_code-5", "94129");
129 $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
131 $this->click("_qf_Confirm_next-bottom");
133 // Log in using webtestLogin() method
134 $this->webtestLogin();
136 $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
138 $this->type("sort_name", "$firstName $lastName");
139 $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item:first-child');
140 $this->click('css=#memberSearch table tbody tr td span a.action-item:first-child');
141 $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
143 //View Membership Record
144 $verifyMembershipData = array(
145 'Member' => $firstName . ' ' . $lastName,
146 'Membership Type' => 'Student',
148 'Source' => 'Online Contribution: Member Signup and Renewal',
150 foreach ($verifyMembershipData as $label => $value) {
151 $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",
157 $this->webtestLogout();
159 $this->openCiviPage("contribute/transact", "reset=1&id=2", "_qf_Main_upload-bottom");
161 $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
163 //Type first name and last name and email
164 $this->type("first_name", $firstName);
165 $this->type("last_name", $lastName);
166 $this->type("email-5", $email);
167 $this->select("state_province-1", "value=1001");
170 $this->select("credit_card_type", "value=Visa");
171 $this->select("credit_card_type", "label=Visa");
172 $this->type("credit_card_number", "4111111111111111");
173 $this->type("cvv2", "000");
174 $this->select("credit_card_exp_date[M]", "value=1");
175 $this->select("credit_card_exp_date[Y]", "value=2020");
178 $this->type("billing_first_name", $firstName . "billing");
179 $this->type("billing_last_name", $lastName . "billing");
180 $this->type("billing_street_address-5", "15 Main St.");
181 $this->type(" billing_city-5", "San Jose");
182 $this->select("billing_country_id-5", "value=1228");
183 $this->select("billing_state_province_id-5", "value=1004");
184 $this->type("billing_postal_code-5", "94129");
186 $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
187 $this->click("_qf_Confirm_next-bottom");
189 $this->webtestLogin();
191 $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
193 $this->type("sort_name", "$firstName $lastName");
194 $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item:first-child');
195 $this->click('css=#memberSearch table tbody tr td span a.action-item:first-child');
196 $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
198 //View Membership Record
199 $verifyMembershipData = array(
200 'Member' => $firstName . ' ' . $lastName,
201 'Membership Type' => 'Student',
203 'Source' => 'Online Contribution: Member Signup and Renewal',
205 foreach ($verifyMembershipData as $label => $value) {
206 $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",
213 * FIXME: This test tries to update a contribution page (id=2) that may not exist :(
215 function testOnlineMembershipRenewChangeType() {
216 // a random 7-char string and an even number to make this pass unique
217 $hash = substr(sha1(rand()), 0, 7);
218 $rand = 2 * rand(2, 50);
220 // Log in using webtestLogin() method
221 $this->webtestLogin();
223 // We need a payment processor
224 $processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7);
225 $this->webtestAddPaymentProcessor($processorName);
227 $this->openCiviPage("admin/contribute/amount", "reset=1&action=update&id=2", '_qf_Amount_next');
229 //this contribution page for membership signup
230 $xpath = "xpath=//label[text() = '{$processorName}']/preceding-sibling::input[1]";
231 $this->waitForText('css=.crm-contribution-contributionpage-amount-form-block-payment_processor', $processorName);
232 $this->check($xpath);
235 $this->waitForElementPresent('_qf_Amount_next');
236 $this->click('_qf_Amount_next');
237 $this->waitForPageToLoad();
239 // go to Membership block
240 $this->click('css=#tab_membership a');
241 $this->waitForElementPresent("member_is_active");
242 $this->check("member_is_active");
244 $this->waitForElementPresent("new_title");
245 if ($this->isElementPresent("member_price_set_id")) {
246 $this->waitForElementPresent("member_price_set_id");
248 $this->select("member_price_set_id", "label=- none -");
251 $this->waitForElementPresent("membership_type-block");
252 $this->check("xpath=//tr[@id='membership_type-block']/td[2]/table/tbody/tr/td/label[text()='General']/../input[2]");
253 $this->check("xpath=//tr[@id='membership_type-block']/td[2]/table/tbody/tr/td/label[text()='Student']/../input[2]");
254 $this->click("_qf_MembershipBlock_next-bottom");
255 $this->waitForTextPresent("'MembershipBlock' information has been saved");
258 $this->click('css=#tab_custom a');
261 $this->waitForElementPresent('custom_pre_id');
262 $this->select('css=tr.crm-contribution-contributionpage-custom-form-block-custom_pre_id span.crm-profile-selector-select select', 'value=1');
265 $this->click('_qf_Custom_upload_done');
266 $this->waitForPageToLoad();
268 $firstName = 'Ma' . substr(sha1(rand()), 0, 4);
269 $lastName = 'An' . substr(sha1(rand()), 0, 7);
271 //Go to online membership signup page
272 $this->openCiviPage("contribute/transact", "reset=1&id=2", "_qf_Main_upload-bottom");
273 $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'General')]");
274 //Type first name and last name
275 $this->type("first_name", $firstName);
276 $this->type("last_name", $lastName);
278 $this->select("state_province-1", "value=1001");
280 $this->select("credit_card_type", "value=Visa");
281 $this->select("credit_card_type", "label=Visa");
282 $this->type("credit_card_number", "4111111111111111");
283 $this->type("cvv2", "000");
284 $this->select("credit_card_exp_date[M]", "value=1");
285 $this->select("credit_card_exp_date[Y]", "value=2020");
288 $this->type("billing_first_name", $firstName . "billing");
289 $this->type("billing_last_name", $lastName . "billing");
290 $this->type("billing_street_address-5", "15 Main St.");
291 $this->type(" billing_city-5", "San Jose");
292 $this->select("billing_country_id-5", "value=1228");
293 $this->select("billing_state_province_id-5", "value=1004");
294 $this->type("billing_postal_code-5", "94129");
296 $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
298 $this->click("_qf_Confirm_next-bottom");
299 $this->waitForPageToLoad($this->getTimeoutMsec());
302 $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
304 $this->type("sort_name", "$firstName $lastName");
305 $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item:first-child');
306 $this->click('css=#memberSearch table tbody tr td span a.action-item:first-child');
307 $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
309 $membershipCreatedId = $this->urlArg('id');
311 $memberSince = date('F jS, Y');
313 //View Membership Record
314 $verifyMembershipData = array(
315 'Member' => $firstName . ' ' . $lastName,
316 'Membership Type' => 'General',
318 'Source' => 'Online Contribution: Member Signup and Renewal',
320 foreach ($verifyMembershipData as $label => $value) {
321 $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",
325 $this->openCiviPage("contribute/transact", "reset=1&id=2", "_qf_Main_upload-bottom");
326 $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
329 $this->select("credit_card_type", "value=Visa");
330 $this->select("credit_card_type", "label=Visa");
331 $this->type("credit_card_number", "4111111111111111");
332 $this->type("cvv2", "000");
333 $this->select("credit_card_exp_date[M]", "value=1");
334 $this->select("credit_card_exp_date[Y]", "value=2020");
335 $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
336 $this->click("_qf_Confirm_next-bottom");
337 $this->waitForPageToLoad($this->getTimeoutMsec());
340 $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
342 $this->type("sort_name", "$firstName $lastName");
343 $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item:first-child');
344 $this->click('css=#memberSearch table tbody tr td span a.action-item:first-child');
345 $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
347 $membershipRenewedId = $this->urlArg('id');
349 //View Membership Record
350 $verifyMembershipData = array(
351 'Member' => $firstName . ' ' . $lastName,
352 'Membership Type' => 'Student',
354 'Source' => 'Online Contribution: Member Signup and Renewal',
355 'Member Since' => $memberSince,
357 foreach ($verifyMembershipData as $label => $value) {
358 $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",
362 $this->assertEquals($membershipCreatedId, $membershipRenewedId);
365 function testUpdateInheritedMembershipOnBehalfOfRenewal() {
367 $this->webtestLogin('admin');
369 $this->enableComponents('CiviMember');
371 //check for online contribution and profile listings permissions
372 $permissions = array("edit-1-make-online-contributions", "edit-1-profile-listings-and-forms");
373 $this->changePermissions($permissions);
375 // Log in as normal user
376 $this->webtestLogin();
378 $this->openCiviPage("contact/add", "reset=1&ct=Organization", '_qf_Contact_cancel');
380 $title = substr(sha1(rand()), 0, 7);
381 $this->type('organization_name', "Organization $title");
382 $this->type('email_1_email', "$title@org.com");
383 $this->click('_qf_Contact_upload_view');
384 $this->waitForPageToLoad($this->getTimeoutMsec());
386 $this->waitForText('crm-notification-container', "Organization $title has been created.");
388 $this->openCiviPage("admin/member/membershipType", "reset=1&action=browse");
390 $this->click('link=Add Membership Type');
391 $this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
393 $membershipTypeTitle = "Membership Type $title";
394 $this->type('name', "Membership Type $title");
396 $this->select2('member_of_contact_id', $title);
398 $this->type('minimum_fee', '100');
399 $this->select( 'financial_type_id', 'value=2' );
400 $this->type('duration_interval', 1);
401 $this->select('duration_unit', 'label=year');
402 $this->select('period_type', 'value=rolling');
404 $this->removeSelection('relationship_type_id', 'label=- select -');
405 $this->addSelection('relationship_type_id', 'label=Employer of');
407 $this->click('_qf_MembershipType_upload-bottom');
408 $this->waitForElementPresent('link=Add Membership Type');
409 $this->waitForText('crm-notification-container', "The membership type 'Membership Type $title' has been saved.");
411 $this->waitForElementPresent("xpath=//div[@id='membership_type']/table/tbody//tr/td[1][text()='{$membershipTypeTitle}']/../td[12]/span/a[3][text()='Delete']/@href");
412 $url = $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1][text()='{$membershipTypeTitle}']/../td[12]/span/a[3][text()='Delete']/@href");
414 preg_match('/id=([0-9]+)/', $url, $matches);
415 $membershipTypeId = $matches[1];
417 // We need a payment processor
418 $processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7);
420 // create contribution page with randomized title and default params
421 $hash = substr(sha1(rand()), 0, 7);
422 $rand = 2 * rand(2, 50);
423 $amountSection = FALSE;
428 $memberships = FALSE;
429 $memPriceSetId = NULL;
432 $profilePostId = NULL;
437 $contributionTitle = "Title $hash";
438 $pageId = $this->webtestAddContributionPage($hash,
441 array($processorName => 'Dummy'),
458 $hash = substr(sha1(rand()), 0, 7);
459 $this->openCiviPage("admin/contribute/settings", "reset=1&action=update&id=$pageId");
461 $this->click('link=Title');
462 $this->waitForElementPresent('_qf_Settings_cancel-bottom');
463 $this->click('is_organization');
464 $this->select("xpath=//input[@id='onbehalf_profile_id']/parent::td/div/div/span/select", "value=9");
465 $this->type('for_organization', "On behalf $hash");
466 $this->click('_qf_Settings_next-bottom');
467 $this->waitForPageToLoad($this->getTimeoutMsec());
469 $this->click('link=Memberships');
470 $this->waitForElementPresent('_qf_MembershipBlock_cancel-bottom');
471 $this->click('member_is_active');
472 $this->type('new_title', "Title - New Membership $hash");
473 $this->type('renewal_title', "Title - Renewals $hash");
474 $this->click("membership_type_{$membershipTypeId}");
475 $this->click('is_required');
476 $this->click('_qf_MembershipBlock_next-bottom');
477 $this->waitForPageToLoad($this->getTimeoutMsec());
480 $this->webtestLogout();
482 //get Url for Live Contribution Page
483 $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", '_qf_Main_upload-bottom');
484 $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'$membershipTypeTitle')]");
485 $firstName = 'Eia' . substr(sha1(rand()), 0, 4);
486 $lastName = 'Ande' . substr(sha1(rand()), 0, 4);
487 $name = $firstName . ' ' . $lastName;
488 $organisationName = 'TestOrg' . substr(sha1(rand()), 0, 7);
490 $email = $firstName . '@example.com';
491 $this->type('email-5', $email);
492 $this->click('is_for_organization');
493 $this->type('onbehalf_organization_name', $organisationName);
494 $this->type('onbehalf_phone-3-1', '2222-222222');
495 $this->type('onbehalf_email-3', $organisationName . '@example.com');
496 $this->type('onbehalf_street_address-3', '54A Excelsior Ave. Apt 1C');
497 $this->type('onbehalf_city-3', 'Driftwood');
498 $this->type('onbehalf_postal_code-3', '75653');
499 $this->select('onbehalf_country-3', "value=1228");
500 $this->select('onbehalf_state_province-3', "value=1061");
502 $this->type('first_name', $firstName);
503 $this->type('last_name', $lastName);
504 $this->select("state_province-1", "value=1001");
507 $this->select("credit_card_type", "value=Visa");
508 $this->select("credit_card_type", "label=Visa");
509 $this->type("credit_card_number", "4111111111111111");
510 $this->type("cvv2", "000");
511 $this->select("credit_card_exp_date[M]", "value=1");
512 $this->select("credit_card_exp_date[Y]", "value=2020");
515 $this->type("billing_first_name", $firstName . "billing");
516 $this->type("billing_last_name", $lastName . "billing");
517 $this->type("billing_street_address-5", "15 Main St.");
518 $this->type(" billing_city-5", "San Jose");
519 $this->select("billing_country_id-5", "value=1228");
520 $this->select("billing_state_province_id-5", "value=1004");
521 $this->type("billing_postal_code-5", "94129");
522 $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
524 $this->click("_qf_Confirm_next-bottom");
525 $this->waitForPageToLoad($this->getTimeoutMsec());
527 // Log in using webtestLogin() method
528 $this->webtestLogin();
531 $endDate = date('F jS, Y', strtotime(" +1 year -1 day"));
532 $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
534 $this->type("sort_name", "$organisationName");
535 $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item:first-child');
536 $this->click('css=#memberSearch table tbody tr td span a.action-item:first-child');
537 $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
539 //View Membership Record
540 $verifyMembershipData = array(
541 'Member' => $organisationName,
542 'Membership Type' => $membershipTypeTitle,
544 'End date' => $endDate,
547 foreach ($verifyMembershipData as $label => $value) {
548 $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",
553 $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
555 $this->type("sort_name", "$lastName, $firstName");
556 $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item:first-child');
557 $this->click('css=#memberSearch table tbody tr td span a.action-item:first-child');
558 $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
560 //View Membership Record
561 $verifyMembershipData = array(
563 'Membership Type' => $membershipTypeTitle,
565 'End date' => $endDate,
568 foreach ($verifyMembershipData as $label => $value) {
569 $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",
575 $this->webtestLogout();
577 $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom");
579 $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'$membershipTypeTitle')]");
580 $this->type("email-5", $email);
581 $this->click('is_for_organization');
582 $this->type('onbehalf_organization_name', $organisationName);
583 $this->type('onbehalf_phone-3-1', '2222-222222');
584 $this->type('onbehalf_email-3', $organisationName . '@example.com');
585 $this->type('onbehalf_street_address-3', '22A Excelsior Ave. Unit 1h');
586 $this->type('onbehalf_city-3', 'Driftwood');
587 $this->type('onbehalf_postal_code-3', '75653');
588 $this->select('onbehalf_country-3', "value=1228");
589 $this->select('onbehalf_state_province-3', "value=1061");
591 $this->type('first_name', $firstName);
592 $this->type('last_name', $lastName);
593 $this->select("state_province-1", "value=1001");
596 $this->select("credit_card_type", "value=Visa");
597 $this->select("credit_card_type", "label=Visa");
598 $this->type("credit_card_number", "4111111111111111");
599 $this->type("cvv2", "000");
600 $this->select("credit_card_exp_date[M]", "value=1");
601 $this->select("credit_card_exp_date[Y]", "value=2020");
604 $this->type("billing_first_name", $firstName . "billing");
605 $this->type("billing_last_name", $lastName . "billing");
606 $this->type("billing_street_address-5", "15 Main St.");
607 $this->type(" billing_city-5", "San Jose");
608 $this->select("billing_country_id-5", "value=1228");
609 $this->select("billing_state_province_id-5", "value=1004");
610 $this->type("billing_postal_code-5", "94129");
612 $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
614 $this->click("_qf_Confirm_next-bottom");
615 $this->waitForPageToLoad($this->getTimeoutMsec());
617 // Log in using webtestLogin() method
618 $this->webtestLogin();
621 $endDate = date('F jS, Y', strtotime(" +2 year -1 day"));
622 $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
624 $this->type("sort_name", "$organisationName");
625 $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item:first-child');
626 $this->click('css=#memberSearch table tbody tr td span a.action-item:first-child');
627 $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
629 //View Membership Record
630 $verifyMembershipData = array(
631 'Member' => $organisationName,
632 'Membership Type' => $membershipTypeTitle,
633 'End date' => $endDate,
636 foreach ($verifyMembershipData as $label => $value) {
637 $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",
642 $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
644 $this->type("sort_name", "$lastName, $firstName");
645 $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item:first-child');
646 $this->click('css=#memberSearch table tbody tr td span a.action-item:first-child');
647 $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
649 //View Membership Record
650 $verifyMembershipData = array(
652 'Membership Type' => $membershipTypeTitle,
653 'End date' => $endDate,
656 foreach ($verifyMembershipData as $label => $value) {
657 $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",