case 'payment_instrument_id':
case 'contribution_payment_instrument_id':
case 'contribution_page_id':
+ case 'contribution_status_id':
case 'contribution_id':
case 'contribution_currency_type':
case 'contribution_currency':
$this->click("xpath=//div[@class='messages status no-popup']/a[text()='add one']");
$this->waitForElementPresent('_qf_AddProduct_cancel-bottom');
$this->select('product_id', "value=1");
+ $this->select('financial_type_id', "value=1");
$this->click('_qf_AddProduct_next-bottom');
$this->waitForElementPresent('_qf_Premium_cancel-bottom');
$this->click('_qf_Premium_next-bottom');
//$this->assertEquals(0, $apiResult['is_error']);
}
+ /**
+ * Add a pledge
+ *
+ * @return array
+ */
+ public function webtestStandalonePledgeAdd() {
+ $this->webtestLogin();
+
+ $this->openCiviPage('pledge/add', 'reset=1&context=standalone', '_qf_Pledge_upload');
+
+ // create new contact using dialog
+ $contact = $this->createDialogContact();
+
+ $this->type('amount', '100');
+ $this->type('installments', '10');
+ $this->select('frequency_unit', 'value=week');
+ $this->type('frequency_day', '2');
+
+ $this->webtestFillDate('acknowledge_date', 'now');
+
+ $this->select('contribution_page_id', 'value=3');
+
+ //PaymentReminders
+ $this->click('PaymentReminders');
+ $this->waitForElementPresent('additional_reminder_day');
+ $this->type('initial_reminder_day', '4');
+ $this->type('max_reminders', '2');
+ $this->type('additional_reminder_day', '4');
+
+ $this->click('_qf_Pledge_upload-bottom');
+
+ $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
+
+ // verify if Pledge is created
+ $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
+
+ //click through to the Pledge view screen
+ $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
+ $this->waitForElementPresent('_qf_PledgeView_next-bottom');
+ $pledgeDate = date('F jS, Y', strtotime('now'));
+
+ $this->webtestVerifyTabularData(array(
+ 'Pledge By' => $contact['display_name'],
+ 'Total Pledge Amount' => '$ 100.00',
+ 'To be paid in' => '10 installments of $ 10.00 every 1 week(s)',
+ 'Payments are due on the' => '2 day of the period',
+ 'Pledge Made' => $pledgeDate,
+ 'Financial Type' => 'Donation',
+ 'Pledge Status' => 'Pending',
+ 'Initial Reminder Day' => '4 days prior to schedule date',
+ 'Maximum Reminders Send' => 2,
+ 'Send additional reminders' => '4 days after the last one sent',
+ )
+ );
+ $this->clickLink('_qf_PledgeView_next-bottom', "xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a", FALSE);
+ $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
+ $this->waitForAjaxContent();
+ $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
+ $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span[2]/a");
+ $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
+ return $contact;
+ }
+
}
$this->webtestLogin();
// create a new pledge for contact
- $contact = WebTest_Pledge_StandaloneAddTest::testStandalonePledgeAdd();
+ $contact = $this->webtestStandalonePledgeAdd();
$itemCount = 2;
$softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);
//Find Contribution
$this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
$this->type("sort_name", "$email");
+ $this->click("xpath=//tr/td[1]/label[contains(text(), 'Contribution is a Test?')]/../../td[2]/label[contains(text(), 'Yes')]/preceding-sibling::input[1]");
$this->waitForAjaxContent();
$this->click("xpath=//div[@class='crm-accordion-wrapper crm-contribution_search_form-accordion ']/div[2]/table/tbody/tr[8]/td[1]/table/tbody/tr[3]/td[2]/label[1]");
$this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", FALSE);
$this->click('radio_ts', 'ts_all');
- $this->select('task', "label=Update Pending Contribution Status");
+ $this->select('task', "label=Update pending contribution status");
$this->clickLink("_qf_Search_next_action");
$this->select('contribution_status_id', 'label=Completed');
$this->click('_qf_Status_next');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click('radio_ts', 'ts_all');
- $this->select('task', "label=Update Pending Contribution Status");
+ $this->select('task', "label=Update pending contribution status");
$this->waitForElementPresent("_qf_Search_next_action");
$this->click("_qf_Search_next_action");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
$this->click("xpath=//tr/td[1]/label[contains(text(), 'Contribution is a Test?')]/../../td[2]/label[contains(text(), 'Yes')]/preceding-sibling::input[1]");
$this->type("sort_name", $contact['sort_name']);
- $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[2]/td[11]/span/a[text()='View']");
- $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[2]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
+ $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[2]/td[11]/span/a[text()='View']", FALSE);
+ $this->click("xpath=//div[@id='contributionSearch']/table/tbody/tr//td/a[text()='{$contact['sort_name']}']/../td[11]/span/a[text()='View']");
// View Contribution Record and test for expected values
$expected = array(
'From' => $contact['display_name'],
* @return array
*/
public function testStandalonePledgeAdd() {
- $this->webtestLogin();
-
- $this->openCiviPage('pledge/add', 'reset=1&context=standalone', '_qf_Pledge_upload');
-
- // create new contact using dialog
- $contact = $this->createDialogContact();
-
- $this->type('amount', '100');
- $this->type('installments', '10');
- $this->select('frequency_unit', 'value=week');
- $this->type('frequency_day', '2');
-
- $this->webtestFillDate('acknowledge_date', 'now');
-
- $this->select('contribution_page_id', 'value=3');
-
- //PaymentReminders
- $this->click('PaymentReminders');
- $this->waitForElementPresent('additional_reminder_day');
- $this->type('initial_reminder_day', '4');
- $this->type('max_reminders', '2');
- $this->type('additional_reminder_day', '4');
-
- $this->click('_qf_Pledge_upload-bottom');
-
- $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
-
- // verify if Pledge is created
- $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
-
- //click through to the Pledge view screen
- $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
- $this->waitForElementPresent('_qf_PledgeView_next-bottom');
- $pledgeDate = date('F jS, Y', strtotime('now'));
-
- $this->webtestVerifyTabularData(array(
- 'Pledge By' => $contact['display_name'],
- 'Total Pledge Amount' => '$ 100.00',
- 'To be paid in' => '10 installments of $ 10.00 every 1 week(s)',
- 'Payments are due on the' => '2 day of the period',
- 'Pledge Made' => $pledgeDate,
- 'Financial Type' => 'Donation',
- 'Pledge Status' => 'Pending',
- 'Initial Reminder Day' => '4 days prior to schedule date',
- 'Maximum Reminders Send' => 2,
- 'Send additional reminders' => '4 days after the last one sent',
- )
- );
- $this->clickLink('_qf_PledgeView_next-bottom', "xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a", FALSE);
- $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
- $this->waitForAjaxContent();
- $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
- $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span[2]/a");
- $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
- return $contact;
+ $this->webtestStandalonePledgeAdd();
}
}