version fixes
[civicrm-core.git] / tests / phpunit / WebTest / Pledge / ContactContextPledgePaymentAddTest.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
39de6fd5 4 | CiviCRM version 4.6 |
6a488035 5 +--------------------------------------------------------------------+
e7112fa7 6 | Copyright CiviCRM LLC (c) 2004-2015 |
6a488035
TO
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 +--------------------------------------------------------------------+
d25dd0ee 25 */
6a488035 26
6a488035 27require_once 'CiviTest/CiviSeleniumTestCase.php';
e9479dcf
EM
28
29/**
30 * Class WebTest_Pledge_ContactContextPledgePaymentAddTest
31 */
6a488035
TO
32class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTestCase {
33
34 protected function setUp() {
35 parent::setUp();
36 }
37
00be9182 38 public function testAddPledgePaymentWithAdjustPledgePaymentSchedule() {
6a488035 39 $this->webtestLogin();
d2771e94 40 $this->openCiviPage('admin/setting/localization', 'reset=1');
6c6e6187 41 $this->select("currencyLimit-f", "value=FJD");
6a488035
TO
42 $this->click("add");
43 $this->click("_qf_Localization_next-bottom");
44 $this->waitForPageToLoad($this->getTimeoutMsec());
48b420d7 45
d8d3508a
DG
46 // Disable pop-ups for this test. Running test w/ pop-ups causes a spurious failure. dgg
47 $this->enableDisablePopups(FALSE);
76e86fd8 48
6a488035 49 // create unique name
92915c55 50 $name = substr(sha1(rand()), 0, 7);
6a488035 51 $firstName = 'Adam' . $name;
92915c55 52 $lastName = 'Jones' . $name;
6a488035
TO
53
54 // create new contact
55 $this->webtestAddContact($firstName, $lastName, $firstName . "@example.com");
56
57 // wait for action element
58 $this->waitForElementPresent('crm-contact-actions-link');
59
60 // now add pledge from contact summary
61 $this->click("//a[@id='crm-contact-actions-link']/span/div");
62
d8d3508a 63 // wait for add pledge link
6a488035
TO
64 $this->waitForElementPresent('link=Add Pledge');
65
66 $this->click('link=Add Pledge');
67
68 // wait for pledge form to load completely
69 $this->waitForElementPresent('_qf_Pledge_upload-bottom');
70
71 // check contact name on pledge form
d2771e94 72 $this->assertElementContainsText('css=tr.crm-pledge-form-block-displayName', "$firstName $lastName");
6a488035 73
6c6e6187 74 $this->select("currency", "value=FJD");
6a488035
TO
75 $this->type("amount", "30");
76 $this->type("installments", "3");
77 $this->select("frequency_unit", "value=week");
78 $this->type("frequency_day", "2");
79
80 $this->webtestFillDate('acknowledge_date', 'now');
481a74f4 81 $this->select("financial_type_id", "label=Donation");
6a488035
TO
82
83 $this->select("contribution_page_id", "value=3");
84
6a488035
TO
85 //PaymentReminders
86 $this->click("PaymentReminders");
87 $this->waitForElementPresent("additional_reminder_day");
88 $this->type("initial_reminder_day", "4");
89 $this->type("max_reminders", "2");
90 $this->type("additional_reminder_day", "4");
91
92 $this->click("_qf_Pledge_upload-bottom");
45fabf8e 93 $this->waitForElementPresent('link=Add Pledge');
6a488035 94
6c5f7368 95 $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
6a488035 96
45fabf8e 97 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035 98 //click through to the Pledge view screen
45fabf8e 99 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035
TO
100 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
101 $pledgeDate = date('F jS, Y', strtotime('now'));
102
103 $this->webtestVerifyTabularData(array(
104 'Pledge By' => $firstName . ' ' . $lastName,
105 'Total Pledge Amount' => '$ 30.00',
106 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
107 'Payments are due on the' => '2 day of the period',
108 'Pledge Made' => $pledgeDate,
109 'Financial Type' => 'Donation',
110 'Pledge Status' => 'Pending',
6a488035
TO
111 'Initial Reminder Day' => '4 days prior to schedule date',
112 'Maximum Reminders Send' => 2,
113 'Send additional reminders' => '4 days after the last one sent',
114 )
115 );
116
45fabf8e 117 $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
118 $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
d8d3508a
DG
119 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
120 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
6a488035
TO
121 $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
122 $this->click("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
123 $this->waitForElementPresent("adjust-option-type");
124 $this->type("total_amount", "5");
125 $this->click("_qf_Contribution_upload");
126
45fabf8e 127 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
128 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[1]/span/a");
6a488035 129
d8d3508a
DG
130 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
131 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
6a488035
TO
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");
136
137 $this->click("_qf_Contribution_upload");
138
45fabf8e 139 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035 140 //click through to the Pledge view screen
45fabf8e 141 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035
TO
142 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
143 $pledgeDate = date('F jS, Y', strtotime('now'));
144
145 $this->webtestVerifyTabularData(array(
146 'Pledge By' => $firstName . ' ' . $lastName,
147 'Total Pledge Amount' => '$ 30.00',
148 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
149 'Payments are due on the' => '2 day of the period',
150 'Pledge Made' => $pledgeDate,
151 'Financial Type' => 'Donation',
152 'Pledge Status' => 'In Progress',
6a488035
TO
153 'Initial Reminder Day' => '4 days prior to schedule date',
154 'Maximum Reminders Send' => 2,
155 'Send additional reminders' => '4 days after the last one sent',
156 )
157 );
158
45fabf8e 159 $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
160 $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
d8d3508a
DG
161 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
162 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
6a488035
TO
163 $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
164
165 $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
166 $this->click("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
167 $this->waitForElementPresent("adjust-option-type");
168 $this->type("total_amount", "10");
169
170 $this->waitForElementPresent("_qf_Contribution_upload");
171 $this->click("_qf_Contribution_upload");
172
45fabf8e 173 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
174 $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
6a488035 175
d8d3508a
DG
176 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[5]/td[8]/a[text()='Record Payment']");
177 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[5]/td[8]/a[text()='Record Payment']");
6a488035
TO
178
179 $this->waitForElementPresent("_qf_Contribution_upload");
180 $this->click("_qf_Contribution_upload");
181
45fabf8e 182 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
183 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035
TO
184
185 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
186 $this->webtestVerifyTabularData(array(
187 'Pledge By' => $firstName . ' ' . $lastName,
188 'Total Pledge Amount' => '$ 30.00',
189 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
190 'Payments are due on the' => '2 day of the period',
191 'Pledge Made' => $pledgeDate,
192 'Financial Type' => 'Donation',
193 'Pledge Status' => 'Completed',
6a488035
TO
194 'Initial Reminder Day' => '4 days prior to schedule date',
195 'Maximum Reminders Send' => 2,
196 'Send additional reminders' => '4 days after the last one sent',
197 )
198 );
d2771e94 199 $this->openCiviPage('admin/setting/localization', 'reset=1');
6c6e6187 200 $this->select("currencyLimit-t", "value=FJD");
d2771e94
RN
201 $this->click("remove");
202 $this->click("_qf_Localization_next-bottom");
203 $this->waitForPageToLoad($this->getTimeoutMsec());
d8d3508a
DG
204 // Re-enable pop-ups to leave things in the same state
205 $this->enableDisablePopups(TRUE);
6a488035
TO
206 }
207
00be9182 208 public function testAddPledgePaymentWithAdjustTotalPledgeAmount() {
6a488035 209 $this->webtestLogin();
d8d3508a
DG
210 // Disable pop-ups for this test. Running test w/ pop-ups causes a spurious failure. dgg
211 $this->enableDisablePopups(FALSE);
6a488035
TO
212
213 // create unique name
92915c55 214 $name = substr(sha1(rand()), 0, 7);
6a488035 215 $firstName = 'Adam' . $name;
92915c55 216 $lastName = 'Jones' . $name;
6a488035
TO
217
218 // create new contact
219 $this->webtestAddContact($firstName, $lastName, $firstName . "@example.com");
220
221 // wait for action element
222 $this->waitForElementPresent('crm-contact-actions-link');
223
224 // now add pledge from contact summary
225 $this->click("//a[@id='crm-contact-actions-link']/span/div");
226
227 // wait for add plegde link
228 $this->waitForElementPresent('link=Add Pledge');
229
230 $this->click('link=Add Pledge');
231
232 // wait for pledge form to load completely
233 $this->waitForElementPresent('_qf_Pledge_upload-bottom');
234
235 // check contact name on pledge form
d2771e94 236 $this->assertElementContainsText('css=tr.crm-pledge-form-block-displayName', "$firstName $lastName");
6a488035 237
6a488035
TO
238 $this->type("amount", "30");
239 $this->type("installments", "3");
240 $this->select("frequency_unit", "value=week");
241 $this->type("frequency_day", "2");
242
243 $this->webtestFillDate('acknowledge_date', 'now');
244
245 $this->select("contribution_page_id", "value=3");
246
6a488035
TO
247 //PaymentReminders
248 $this->click("PaymentReminders");
249 $this->waitForElementPresent("additional_reminder_day");
250 $this->type("initial_reminder_day", "4");
251 $this->type("max_reminders", "2");
252 $this->type("additional_reminder_day", "4");
253
254 $this->click("_qf_Pledge_upload-bottom");
6a488035 255
6c5f7368 256 $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
6a488035 257
45fabf8e 258 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035 259 //click through to the Pledge view screen
45fabf8e 260 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035
TO
261 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
262 $pledgeDate = date('F jS, Y', strtotime('now'));
263
264 $this->webtestVerifyTabularData(array(
265 'Pledge By' => $firstName . ' ' . $lastName,
266 'Total Pledge Amount' => '$ 30.00',
267 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
268 'Payments are due on the' => '2 day of the period',
269 'Pledge Made' => $pledgeDate,
270 'Financial Type' => 'Donation',
271 'Pledge Status' => 'Pending',
6a488035
TO
272 'Initial Reminder Day' => '4 days prior to schedule date',
273 'Maximum Reminders Send' => 2,
274 'Send additional reminders' => '4 days after the last one sent',
275 )
276 );
277
45fabf8e 278 $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
279 $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
d8d3508a
DG
280 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
281 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
6a488035
TO
282 $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
283 $this->click("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
284 $this->waitForElementPresent("adjust-option-type");
285 $this->waitForElementPresent("CIVICRM_QFID_2_option_type");
286 $this->click("CIVICRM_QFID_2_option_type");
287 $this->type("total_amount", "15");
288 $this->click("_qf_Contribution_upload");
289
45fabf8e 290 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
291 $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
6a488035 292
d8d3508a
DG
293 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
294 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
6a488035
TO
295 $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
296 $this->click("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
297 $this->waitForElementPresent("adjust-option-type");
298 $this->waitForElementPresent("CIVICRM_QFID_2_option_type");
299 $this->click("CIVICRM_QFID_2_option_type");
300 $this->type("total_amount", "15");
301
302 $this->click("_qf_Contribution_upload");
303
45fabf8e 304 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035 305 //click through to the Pledge view screen
45fabf8e 306 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035
TO
307 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
308 $pledgeDate = date('F jS, Y', strtotime('now'));
309
310 $this->webtestVerifyTabularData(array(
311 'Pledge By' => $firstName . ' ' . $lastName,
312 'Total Pledge Amount' => '$ 40.00',
313 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
314 'Payments are due on the' => '2 day of the period',
315 'Pledge Made' => $pledgeDate,
316 'Financial Type' => 'Donation',
317 'Pledge Status' => 'In Progress',
6a488035
TO
318 'Initial Reminder Day' => '4 days prior to schedule date',
319 'Maximum Reminders Send' => 2,
320 'Send additional reminders' => '4 days after the last one sent',
321 )
322 );
323
45fabf8e 324 $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
325 $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
d8d3508a
DG
326 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
327 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
6a488035
TO
328
329 $this->waitForElementPresent("_qf_Contribution_upload");
330 $this->click("_qf_Contribution_upload");
331
45fabf8e 332 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
333 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035
TO
334
335 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
336 $this->webtestVerifyTabularData(array(
337 'Pledge By' => $firstName . ' ' . $lastName,
338 'Total Pledge Amount' => '$ 40.00',
339 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
340 'Payments are due on the' => '2 day of the period',
341 'Pledge Made' => $pledgeDate,
342 'Financial Type' => 'Donation',
343 'Pledge Status' => 'Completed',
6a488035
TO
344 'Initial Reminder Day' => '4 days prior to schedule date',
345 'Maximum Reminders Send' => 2,
346 'Send additional reminders' => '4 days after the last one sent',
347 )
348 );
d8d3508a
DG
349 // Re-enable pop-ups to leave things in the same state
350 $this->enableDisablePopups(TRUE);
6a488035
TO
351 }
352
00be9182 353 public function testAddPledgePayment() {
6a488035 354 $this->webtestLogin();
d8d3508a
DG
355 // Disable pop-ups for this test. Running test w/ pop-ups causes a spurious failure. dgg
356 $this->enableDisablePopups(FALSE);
6a488035
TO
357
358 // create unique name
92915c55 359 $name = substr(sha1(rand()), 0, 7);
6a488035 360 $firstName = 'Adam' . $name;
92915c55 361 $lastName = 'Jones' . $name;
6a488035
TO
362
363 // create new contact
364 $this->webtestAddContact($firstName, $lastName, $firstName . "@example.com");
365
366 // wait for action element
367 $this->waitForElementPresent('crm-contact-actions-link');
368
369 // now add pledge from contact summary
370 $this->click("//a[@id='crm-contact-actions-link']/span/div");
371
372 // wait for add plegde link
373 $this->waitForElementPresent('link=Add Pledge');
374
375 $this->click('link=Add Pledge');
376
377 // wait for pledge form to load completely
378 $this->waitForElementPresent('_qf_Pledge_upload-bottom');
379
380 // check contact name on pledge form
d2771e94 381 $this->assertElementContainsText('css=tr.crm-pledge-form-block-displayName', "$firstName $lastName");
6a488035 382
6a488035
TO
383 $this->type("amount", "30");
384 $this->type("installments", "3");
385 $this->select("frequency_unit", "value=week");
386 $this->type("frequency_day", "2");
387
388 $this->webtestFillDate('acknowledge_date', 'now');
389
390 $this->select("contribution_page_id", "value=3");
391
6a488035
TO
392 //PaymentReminders
393 $this->click("PaymentReminders");
394 $this->waitForElementPresent("additional_reminder_day");
395 $this->type("initial_reminder_day", "4");
396 $this->type("max_reminders", "2");
397 $this->type("additional_reminder_day", "4");
398
399 $this->click("_qf_Pledge_upload-bottom");
6a488035 400
6c5f7368 401 $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
6a488035
TO
402
403 //Add payments
45fabf8e 404 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
405 $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
d8d3508a
DG
406 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
407 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
6a488035
TO
408 $this->waitForElementPresent("_qf_Contribution_upload");
409 $this->click("_qf_Contribution_upload");
410
45fabf8e 411 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
412 $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
d8d3508a
DG
413 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
414 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[3]/td[8]/a[text()='Record Payment']");
6a488035
TO
415 $this->waitForElementPresent("_qf_Contribution_upload");
416 $this->click("_qf_Contribution_upload");
417
45fabf8e 418 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
419 $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
d8d3508a
DG
420 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
421 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[4]/td[8]/a[text()='Record Payment']");
6a488035
TO
422 $this->waitForElementPresent("_qf_Contribution_upload");
423 $this->click("_qf_Contribution_upload");
424
45fabf8e 425 $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035 426 //click through to the Pledge view screen
45fabf8e 427 $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
6a488035
TO
428 $this->waitForElementPresent("_qf_PledgeView_next-bottom");
429 $pledgeDate = date('F jS, Y', strtotime('now'));
430
431 $this->webtestVerifyTabularData(array(
432 'Pledge By' => $firstName . ' ' . $lastName,
433 'Total Pledge Amount' => '$ 30.00',
434 'To be paid in' => '3 installments of $ 10.00 every 1 week(s)',
435 'Payments are due on the' => '2 day of the period',
436 'Pledge Made' => $pledgeDate,
437 'Financial Type' => 'Donation',
438 'Pledge Status' => 'Completed',
6a488035
TO
439 'Initial Reminder Day' => '4 days prior to schedule date',
440 'Maximum Reminders Send' => 2,
441 'Send additional reminders' => '4 days after the last one sent',
442 )
443 );
d8d3508a
DG
444 // Re-enable pop-ups to leave things in the same state
445 $this->enableDisablePopups(TRUE);
6a488035 446 }
96025800 447
6a488035 448}