3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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_Pledge_ContactContextPledgePaymentAddTest
32 class WebTest_Pledge_ContactContextPledgePaymentAddTest
extends CiviSeleniumTestCase
{
34 protected function setUp() {
38 public function testAddPledgePaymentWithAdjustPledgePaymentSchedule() {
39 $this->webtestLogin();
40 $this->openCiviPage('admin/setting/localization', 'reset=1');
41 $this->select("currencyLimit", "value=FJD");
43 $this->click("_qf_Localization_next-bottom");
44 $this->waitForPageToLoad($this->getTimeoutMsec());
47 $name = substr(sha1(rand()), 0, 7);
48 $firstName = 'Adam' . $name;
49 $lastName = 'Jones' . $name;
52 $this->webtestAddContact($firstName, $lastName, $firstName . "@example.com");
54 // wait for action element
55 $this->waitForElementPresent('crm-contact-actions-link');
57 // now add pledge from contact summary
58 $this->click("xpath=//div[@class='crm-actions-ribbon']/ul[@id='actions']/li[@class='crm-contact-activity crm-summary-block']/div/a[@id='crm-contact-actions-link']");
59 $this->waitForElementPresent('crm-contact-actions-list');
61 // wait for add pledge link
62 $this->waitForElementPresent('link=Add Pledge');
64 $this->click('link=Add Pledge');
66 // wait for pledge form to load completely
67 $this->waitForElementPresent('_qf_Pledge_upload-bottom');
69 // check contact name on pledge form
70 $this->assertElementContainsText('css=tr.crm-pledge-form-block-displayName', "$firstName $lastName");
72 $this->select("currency", "value=FJD");
73 $this->type("amount", "30");
74 $this->type("installments", "3");
75 $this->select("frequency_unit", "value=week");
76 $this->type("frequency_day", "2");
78 $this->webtestFillDate('acknowledge_date', 'now');
79 $this->select("financial_type_id", "label=Donation");
81 $this->select("contribution_page_id", "value=3");
84 $this->click("PaymentReminders");
85 $this->waitForElementPresent("additional_reminder_day");
86 $this->type("initial_reminder_day", "4");
87 $this->type("max_reminders", "2");
88 $this->type("additional_reminder_day", "4");
90 $this->click("_qf_Pledge_upload-bottom");
91 $this->waitForElementPresent('link=Add Pledge');
93 $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
94 $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']//tbody/tr[1]/td[10]/span/a[text()='View']");
95 //click through to the Pledge view screen
96 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
97 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
98 $pledgeDate = date('F jS, Y', strtotime('now'));
100 $this->webtestVerifyTabularData(array(
101 'Pledge By' => $firstName . ' ' . $lastName,
102 'Total Pledge Amount' => '$ 30.00',
103 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
104 'Payments are due on the' => '2 day of the period',
105 'Pledge Made' => $pledgeDate,
106 'Financial Type' => 'Donation',
107 'Pledge Status' => 'Pending',
108 'Initial Reminder Day' => '4 days prior to schedule date',
109 'Maximum Reminders Send' => 2,
110 'Send additional reminders' => '4 days after the last one sent',
114 $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
115 $this->waitForAjaxContent();
116 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[1]/a");
117 $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
118 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
119 $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
120 $this->click("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
121 $this->waitForElementPresent("adjust-option-type");
122 $this->type("total_amount", "5");
123 $this->click("_qf_Contribution_upload");
124 $this->waitForText('crm-notification-container', "The contribution record has been saved.");
126 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
127 $this->waitForAjaxContent();
128 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[1]/a");
130 $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']/tbody/tr[2]/td/div/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
131 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
132 $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
133 $this->click("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
134 $this->waitForElementPresent("adjust-option-type");
135 $this->type("total_amount", "10");
137 $this->click("_qf_Contribution_upload");
138 $this->waitForText('crm-notification-container', "The contribution record has been saved.");
140 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
141 //click through to the Pledge view screen
142 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
143 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
144 $pledgeDate = date('F jS, Y', strtotime('now'));
146 $this->webtestVerifyTabularData(array(
147 'Pledge By' => $firstName . ' ' . $lastName,
148 'Total Pledge Amount' => '$ 30.00',
149 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
150 'Payments are due on the' => '2 day of the period',
151 'Pledge Made' => $pledgeDate,
152 'Financial Type' => 'Donation',
153 'Pledge Status' => 'In Progress',
154 'Initial Reminder Day' => '4 days prior to schedule date',
155 'Maximum Reminders Send' => 2,
156 'Send additional reminders' => '4 days after the last one sent',
160 $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
161 $this->waitForAjaxContent();
162 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[1]/a");
163 $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
164 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
165 $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
167 $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
168 $this->click("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
169 $this->waitForElementPresent("adjust-option-type");
170 $this->type("total_amount", "10");
172 $this->waitForElementPresent("_qf_Contribution_upload");
173 $this->click("_qf_Contribution_upload");
174 $this->waitForText('crm-notification-container', "The contribution record has been saved.");
176 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
177 $this->waitForAjaxContent();
178 $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[1]/a");
179 $this->waitForAjaxContent();
180 $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[5]/td[8]/a[text()='Record Payment']");
181 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[5]/td[8]/a[text()='Record Payment']");
183 $this->waitForElementPresent("_qf_Contribution_upload");
184 $this->click("_qf_Contribution_upload");
185 $this->waitForText('crm-notification-container', "The contribution record has been saved.");
187 $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
188 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[10]/span/a[text()='View']");
190 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
191 $this->webtestVerifyTabularData(array(
192 'Pledge By' => $firstName . ' ' . $lastName,
193 'Total Pledge Amount' => '$ 30.00',
194 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
195 'Payments are due on the' => '2 day of the period',
196 'Pledge Made' => $pledgeDate,
197 'Financial Type' => 'Donation',
198 'Pledge Status' => 'Completed',
199 'Initial Reminder Day' => '4 days prior to schedule date',
200 'Maximum Reminders Send' => 2,
201 'Send additional reminders' => '4 days after the last one sent',
204 $this->openCiviPage('admin/setting/localization', 'reset=1');
205 $this->waitForElementPresent("currencyLimit");
206 $this->select("currencyLimit", "value=FJD");
207 $this->click("remove");
208 $this->click("_qf_Localization_next-bottom");
209 $this->waitForPageToLoad($this->getTimeoutMsec());
212 public function testAddPledgePaymentWithAdjustTotalPledgeAmount() {
213 $this->webtestLogin();
214 // Disable pop-ups for this test. Running test w/ pop-ups causes a spurious failure. dgg
215 $this->enableDisablePopups(FALSE);
217 // create unique name
218 $name = substr(sha1(rand()), 0, 7);
219 $firstName = 'Adam' . $name;
220 $lastName = 'Jones' . $name;
222 // create new contact
223 $this->webtestAddContact($firstName, $lastName, $firstName . "@example.com");
225 // wait for action element
226 $this->waitForElementPresent('crm-contact-actions-link');
228 // now add pledge from contact summary
229 $this->click("xpath=//div[@class='crm-actions-ribbon']/ul[@id='actions']/li[@class='crm-contact-activity crm-summary-block']/div/a[@id='crm-contact-actions-link']");
230 $this->waitForElementPresent('crm-contact-actions-list');
232 // wait for add plegde link
233 $this->waitForElementPresent('link=Add Pledge');
235 $this->click('link=Add Pledge');
237 // wait for pledge form to load completely
238 $this->waitForElementPresent('_qf_Pledge_upload-bottom');
240 // check contact name on pledge form
241 $this->assertElementContainsText('css=tr.crm-pledge-form-block-displayName', "$firstName $lastName");
243 $this->type("amount", "30");
244 $this->type("installments", "3");
245 $this->select("frequency_unit", "value=week");
246 $this->type("frequency_day", "2");
248 $this->webtestFillDate('acknowledge_date', 'now');
250 $this->select("contribution_page_id", "value=3");
253 $this->click("PaymentReminders");
254 $this->waitForElementPresent("additional_reminder_day");
255 $this->type("initial_reminder_day", "4");
256 $this->type("max_reminders", "2");
257 $this->type("additional_reminder_day", "4");
259 $this->click("_qf_Pledge_upload-bottom");
261 $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
263 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
264 //click through to the Pledge view screen
265 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
266 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
267 $pledgeDate = date('F jS, Y', strtotime('now'));
269 $this->webtestVerifyTabularData(array(
270 'Pledge By' => $firstName . ' ' . $lastName,
271 'Total Pledge Amount' => '$ 30.00',
272 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
273 'Payments are due on the' => '2 day of the period',
274 'Pledge Made' => $pledgeDate,
275 'Financial Type' => 'Donation',
276 'Pledge Status' => 'Pending',
277 'Initial Reminder Day' => '4 days prior to schedule date',
278 'Maximum Reminders Send' => 2,
279 'Send additional reminders' => '4 days after the last one sent',
282 $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
283 $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[1]/a");
284 $this->waitForElementPresent("xpath=//table/tbody/tr[2]/td/div/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
285 $this->click("xpath=//table/tbody/tr[2]/td/div/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
286 $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
287 $this->click("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
288 $this->waitForElementPresent("adjust-option-type");
289 $this->waitForElementPresent("CIVICRM_QFID_2_option_type");
290 $this->click("CIVICRM_QFID_2_option_type");
291 $this->type("total_amount", "15");
292 $this->click("_qf_Contribution_upload");
294 $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[10]/span/a[text()='View']");
295 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[1]/a");
296 $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
297 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td/div/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
298 $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
299 $this->click("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
300 $this->waitForElementPresent("adjust-option-type");
301 $this->waitForElementPresent("CIVICRM_QFID_2_option_type");
302 $this->click("CIVICRM_QFID_2_option_type");
303 $this->type("total_amount", "15");
305 $this->click("_qf_Contribution_upload");
307 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
308 //click through to the Pledge view screen
309 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
310 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
311 $pledgeDate = date('F jS, Y', strtotime('now'));
313 $this->webtestVerifyTabularData(array(
314 'Pledge By' => $firstName . ' ' . $lastName,
315 'Total Pledge Amount' => '$ 40.00',
316 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
317 'Payments are due on the' => '2 day of the period',
318 'Pledge Made' => $pledgeDate,
319 'Financial Type' => 'Donation',
320 'Pledge Status' => 'In Progress',
321 'Initial Reminder Day' => '4 days prior to schedule date',
322 'Maximum Reminders Send' => 2,
323 'Send additional reminders' => '4 days after the last one sent',
327 $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
328 $this->waitForAjaxContent();
329 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[1]/a");
330 $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
331 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
333 $this->waitForElementPresent("_qf_Contribution_upload");
334 $this->click("_qf_Contribution_upload");
336 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
337 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
339 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
340 $this->webtestVerifyTabularData(array(
341 'Pledge By' => $firstName . ' ' . $lastName,
342 'Total Pledge Amount' => '$ 40.00',
343 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
344 'Payments are due on the' => '2 day of the period',
345 'Pledge Made' => $pledgeDate,
346 'Financial Type' => 'Donation',
347 'Pledge Status' => 'Completed',
348 'Initial Reminder Day' => '4 days prior to schedule date',
349 'Maximum Reminders Send' => 2,
350 'Send additional reminders' => '4 days after the last one sent',
353 // Re-enable pop-ups to leave things in the same state
354 $this->enableDisablePopups(TRUE);
357 public function testAddPledgePayment() {
358 $this->webtestLogin();
360 // create unique name
361 $name = substr(sha1(rand()), 0, 7);
362 $firstName = 'Adam' . $name;
363 $lastName = 'Jones' . $name;
365 // create new contact
366 $this->webtestAddContact($firstName, $lastName, $firstName . "@example.com");
368 // wait for action element
369 $this->waitForElementPresent('crm-contact-actions-link');
371 // now add pledge from contact summary
372 $this->click("xpath=//div[@class='crm-actions-ribbon']/ul[@id='actions']/li[@class='crm-contact-activity crm-summary-block']/div/a[@id='crm-contact-actions-link']");
373 $this->waitForElementPresent('crm-contact-actions-list');
375 // wait for add plegde link
376 $this->waitForElementPresent('link=Add Pledge');
378 $this->click('link=Add Pledge');
380 // wait for pledge form to load completely
381 $this->waitForElementPresent('_qf_Pledge_upload-bottom');
383 // check contact name on pledge form
384 $this->assertElementContainsText('css=tr.crm-pledge-form-block-displayName', "$firstName $lastName");
386 $this->type("amount", "30");
387 $this->type("installments", "3");
388 $this->select("frequency_unit", "value=week");
389 $this->type("frequency_day", "2");
391 $this->webtestFillDate('acknowledge_date', 'now');
393 $this->select("contribution_page_id", "value=3");
396 $this->click("PaymentReminders");
397 $this->waitForElementPresent("additional_reminder_day");
398 $this->type("initial_reminder_day", "4");
399 $this->type("max_reminders", "2");
400 $this->type("additional_reminder_day", "4");
402 $this->click("_qf_Pledge_upload-bottom");
404 $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
407 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
408 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[1]/a");
409 $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
410 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
411 $this->waitForElementPresent("_qf_Contribution_upload");
412 $this->click("_qf_Contribution_upload");
413 $this->waitForText('crm-notification-container', "The contribution record has been saved.");
415 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
416 $this->waitForAjaxContent();
417 $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[1]/a");
418 $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
419 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
420 $this->waitForElementPresent("_qf_Contribution_upload");
421 $this->click("_qf_Contribution_upload");
423 $this->waitForText('crm-notification-container', "The contribution record has been saved.");
424 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
425 $this->waitForAjaxContent();
426 $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[1]/a");
427 $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
428 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
429 $this->waitForElementPresent("_qf_Contribution_upload");
430 $this->click("_qf_Contribution_upload");
432 $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[10]/span/a[text()='View']");
433 //click through to the Pledge view screen
434 $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[10]/span/a[text()='View']");
435 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
436 $pledgeDate = date('F jS, Y', strtotime('now'));
438 $this->webtestVerifyTabularData(array(
439 'Pledge By' => $firstName . ' ' . $lastName,
440 'Total Pledge Amount' => '$ 30.00',
441 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
442 'Payments are due on the' => '2 day of the period',
443 'Pledge Made' => $pledgeDate,
444 'Financial Type' => 'Donation',
445 'Pledge Status' => 'Completed',
446 'Initial Reminder Day' => '4 days prior to schedule date',
447 'Maximum Reminders Send' => 2,
448 'Send additional reminders' => '4 days after the last one sent',
451 // Re-enable pop-ups to leave things in the same state
452 $this->enableDisablePopups(TRUE);