$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created?
- $this->waitForText('crm-notification-container', "Your custom field '$checkboxFieldLabel' has been saved.");
+ $this->waitForText('crm-notification-container', "Custom field '$checkboxFieldLabel' has been saved.");
//create another custom field - Integer Radio
- $this->click("//a[@id='newCustomField']/span");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink("//a[@id='newCustomField']/span", '_qf_Field_cancel', FALSE);
$this->click("data_type[0]");
$this->select("data_type[0]", "value=1");
$this->click("//option[@value='1']");
//clicking save
$this->click("_qf_Field_next");
- $this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created
- $this->waitForText('crm-notification-container', "Your custom field '$radioFieldLabel' has been saved.");
+ $this->waitForText('crm-notification-container', "Custom field '$radioFieldLabel' has been saved.");
// Go to the URL to create an Individual contact.
$this->openCiviPage("contact/add", "reset=1&ct=Individual");
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created?
- $this->waitForText('crm-notification-container', "Your custom field '$moneyTextFieldLabel' has been saved.");
+ $this->waitForText('crm-notification-container', "Custom field '$moneyTextFieldLabel' has been saved.");
//Get the customFieldsetID
$this->openCiviPage('admin/custom/group', 'reset=1');
$this->select("id=data_type_0", "value=0");
$this->click("id=_qf_Field_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForText('crm-notification-container', "Your custom field '$customField' has been saved.");
+ $this->waitForText('crm-notification-container', "Custom field '$customField' has been saved.");
$this->openCiviPage('contact/add', 'reset=1&ct=Individual');
$this->click("css=#tab_log a");
//check the changed log
- $this->waitForElementPresent("xpath=//div[@id='instance_data']/div[2]/table/tbody/tr[1]/td[4]/a[contains(text(), '$firstName $lastName')]");
- $this->waitForElementPresent("xpath=//div[@id='instance_data']/div[2]/table/tbody/tr[1]/td/a[2]");
- $this->click("xpath=//div[@id='instance_data']/div[2]/table/tbody/tr[1]/td/a[2]");
+ $this->waitForElementPresent("xpath=//div[@id='changeLog']/div[2]/div/form/div[2]/table/tbody/tr[1]/td[4]/a[contains(text(), '$firstName $lastName')]");
+ $this->waitForElementPresent("xpath=//div[@id='changeLog']/div[2]/div/form/div[2]/table/tbody/tr[1]/td/a[2]");
+ $this->click("xpath=//div[@id='changeLog']/div[2]/div/form/div[2]/table/tbody/tr[1]/td/a[2]");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertTrue($this->isElementPresent("xpath=//form[@id='LoggingDetail']/div[2]/table/tbody/tr/td[2][contains(text(), '$value')]"));
$this->assertTrue($this->isElementPresent("xpath=//form[@id='LoggingDetail']/div[2]/table/tbody/tr/td[3][contains(text(), '$value1')]"));
$this->type("total", 500);
$this->click("_qf_Batch_next");
$this->waitForPageToLoad($this->getTimeoutMsec());
+ $softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);
+ $softCreditAmount = array(1 => 50, 2 => 60, 3 => 40, 4 => 70, 5 => 35);
// Add Contact Details
$data = array();
for ($i = 1; $i <= $itemCount; $i++) {
'last_name' => 'An' . substr(sha1(rand()), 0, 7),
'financial_type' => 'Donation',
'amount' => 100,
+ 'soft_credit_first_name' => 'Ar' . substr(sha1(rand()), 0, 7),
+ 'soft_credit_last_name' => 'Ki' . substr(sha1(rand()), 0, 7),
+ 'soft_credit_amount' => $softCreditAmount[$i],
+ 'soft_credit_type' => $softCreditTypes[$i],
);
$this->_fillData($data[$i], $i, "Contribution");
function testBatchAddMembership() {
$this->webtestLogin();
$itemCount = 5;
+ $softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);
+ $softCreditAmount = array(1 => 50, 2 => 60, 3 => 40, 4 => 70, 5 => 35);
// create contact
$contact = array();
$batchTitle = 'Batch-' . substr(sha1(rand()), 0, 7);
'membership_type' => 'General',
'amount' => 100,
'financial_type' => 'Member Dues',
+ 'soft_credit_first_name' => 'Ar' . substr(sha1(rand()), 0, 7),
+ 'soft_credit_last_name' => 'Ki' . substr(sha1(rand()), 0, 7),
+ 'soft_credit_amount' => $softCreditAmount[$i],
+ 'soft_credit_type' => $softCreditTypes[$i],
);
$this->_fillData($data[$i], $i, "Membership");
}
function _fillData($data, $row, $type) {
$email = $data['first_name'] . '@example.com';
$this->webtestNewDialogContact($data['first_name'], $data['last_name'], $email, 4,
- "primary_profiles_{$row}", $row, 'primary');
+ "s2id_primary_contact_id_{$row}", $row, 'primary');
if ($type == "Contribution") {
$this->select("field_{$row}_financial_type", $data['financial_type']);
$this->click("field[{$row}][send_receipt]");
$this->click("field_{$row}_invoice_id");
$this->type("field_{$row}_invoice_id", substr(sha1(rand()), 0, 10));
+ $softcreditemail = $data['soft_credit_first_name'] . '@example.com';
+ $this->webtestNewDialogContact($data['soft_credit_first_name'],
+ $data['soft_credit_last_name'],
+ $softcreditemail, 4,
+ "s2id_soft_credit_contact_id_{$row}",
+ $row,
+ 'soft_credit'
+ );
+ $this->type("soft_credit_amount_{$row}", $data['soft_credit_amount']);
+ $this->select("field_{$row}_soft_credit_type", $data['soft_credit_type']);
}
elseif ($type == "Membership") {
$this->select("field_{$row}_payment_instrument", "Check");
$this->type("field_{$row}_check_number", rand());
$this->select("field_{$row}_contribution_status_id", "Completed");
+ $softcreditemail = $data['soft_credit_first_name'] . '@example.com';
+ $this->webtestNewDialogContact($data['soft_credit_first_name'],
+ $data['soft_credit_last_name'],
+ $softcreditemail, 4,
+ "s2id_soft_credit_contact_id_{$row}",
+ $row, 'soft_credit'
+ );
+ $this->type("soft_credit_amount_{$row}", $data['soft_credit_amount']);
}
}
$this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
$this->type("sort_name", "{$data['first_name']} {$data['last_name']}");
$this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
- $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom");
+ $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
$expected = array(
'From' => "{$data['first_name']} {$data['last_name']}",
'Financial Type' => $data['financial_type'],
);
$this->webtestVerifyTabularData($expected);
+ $expectedSoft = array(
+ 'Soft Credit To' => "{$data['soft_credit_first_name']} {$data['soft_credit_last_name']}",
+ 'Amount (Soft Credit Type)' => $data['soft_credit_amount'],
+ 'Soft Credit Type' => $data['soft_credit_type'],
+ );
+ foreach ($expectedSoft as $value) {
+ $this->verifyText("css=table.crm-soft-credit-listing", preg_quote($value));
+ }
}
elseif ($type == "Membership") {
$this->openCiviPage("member/search", "reset=1", "member_join_date_low");
);
$this->webtestVerifyTabularData($expected);
+ $expectedSoft = array(
+ 'Soft Credit To' => "{$data['soft_credit_first_name']} {$data['soft_credit_last_name']}",
+ 'Amount (Soft Credit Type)' => $data['soft_credit_amount'],
+ );
+ foreach ($expectedSoft as $value) {
+ $this->verifyText("css=table.crm-soft-credit-listing", preg_quote($value));
+ }
}
}