$this->type('billing_city-5', 'San Bernadino');
$this->select('billing_country_id-5', 'value=1228');
$this->click('billing_state_province_id-5');
+ $this->waitForVisible('billing_state_province_id-5');
$this->select('billing_state_province_id-5', 'label=California');
$this->type('billing_postal_code-5', '93245');
$text = "Your Financial \"{$financialType['name']}\" Type has been created, along with a corresponding income account \"{$financialType['name']}\". That income account, along with standard financial accounts \"Accounts Receivable\", \"Banking Fees\" and \"Premiums\" have been linked to the financial type. You may edit or replace those relationships here.";
}
else {
- $text = "The financial type '{$financialType['name']}' has been saved.";
+ $text = "The financial type \"{$financialType['name']}\" has been updated.";
}
- $this->waitForText("xpath=//div[@class='notify-content']", $text);
+ $this->waitForElementPresent("xpath=//div[@class='notify-content']");
+ $this->assertElementContainsText('crm-notification-container', $text);
}
/**
* @param $financialType
*/
function addPremium($name, $sku, $amount, $price, $cost, $financialType) {
- $this->waitForElementPresent("_qf_ManagePremiums_upload-bottom");
+ $this->waitForElementPresent("_qf_ManagePremiums_next-bottom");
$this->type("name", $name);
$this->type("sku", $sku);
$this->click("CIVICRM_QFID_noImage_16");
if ($financialType) {
$this->select("financial_type_id", "label={$financialType}");
}
- $this->click("_qf_ManagePremiums_upload-bottom");
+ $this->click("_qf_ManagePremiums_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
}
$this->type('description', $description);
$this->click('_qf_RelationshipType_next-bottom');
- $this->waitForText("xpath=//*[@id='RelationshipType']/div[2]/table/tbody/tr[1]/td[2]/label[@class='error']", 'This field is required.');
+ $this->waitForText("xpath=//*[@id='RelationshipType']/div[2]/table/tbody/tr[1]/td[2]/label[@class='crm-inline-error']", 'This field is required.');
//enter the relationship type values.
$labelAB = 'Test Relationship Type A - B - DUPLICATE TO BE' . rand();
$this->type('sort_name', "$firstName $lastName");
$this->check('contribution_test');
$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' => "{$firstName} {$lastName}",
'Financial Type' => 'Donation',
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click("xpath=//div[@id='contributionSearch']/table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span/a[text()='View']");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
$expected = array(
'Received Into' => "Deposit Bank Account",
'Contribution Status' => "Completed",
$this->click("xpath=//div[@id='ltype']/div/table/tbody/tr/td[2][text()='Banking Fees']/../td[7]/span/a[text()='Edit']");
$this->waitForElementPresent('_qf_FinancialTypeAccount_next');
$this->select('account_relationship', "value=select");
- // Because it tends to cause problems, all uses of sleep() must be justified in comments
- // Sleep should never be used for wait for anything to load from the server
- // Justification for this instance: FIXME
- sleep(1);
+ $this->waitForElementPresent("xpath=//select[@id='account_relationship']/option[text()='- Select Financial Account Relationship -']");
$this->select('account_relationship', "label=Premiums Inventory Account is");
+ $this->waitForElementPresent("xpath=//select[@id='financial_account_id']/option[3][text()='Deposit Bank Account']");
$this->select('financial_account_id', "label=Premiums inventory");
$this->click('_qf_FinancialTypeAccount_next');
$this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[7]/span/a[text()='Edit']");
$this->verifyText("xpath=//div[@id='ltype']/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[1]", preg_quote('Premiums Inventory Account is'));
$this->clickLink("xpath=//div[@id='ltype']/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[7]/span/a[text()='Delete']", '_qf_FinancialTypeAccount_next-botttom', FALSE);
$this->click('_qf_FinancialTypeAccount_next-botttom');
- $this->waitForElementPresent("newfinancialTypeAccount");
$this->waitForText('crm-notification-container', 'Selected financial type account has been deleted.');
//edit financial type
'Pledge Status' => 'Pending',
)
);
- $this->clickLink('_qf_PledgeView_next-bottom', "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
- $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
//Edit and add the first payment for 300.00
- $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody//tr//td/table/tbody/tr[2]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
+ $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->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//td/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
$this->click("xpath=//div[@class='view-content']//table//tbody//tr//td/table/tbody/tr[2]/td[8]/a");
$this->waitForElementPresent("xpath=//form[@id='Contribution']//div[2]/table/tbody/tr[3]/td[2]/a");
$this->click("xpath=//form[@id='Contribution']//div[2]/table/tbody/tr[3]/td[2]/a");
$this->type('total_amount', '300.00');
$this->click('_qf_Contribution_upload-bottom');
- $this->waitForPageToLoad("30000");
$this->waitForText('crm-notification-container', "The contribution record has been saved.");
$this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
$this->waitForElementPresent("_qf_Contribution_upload-bottom");
$this->select('contribution_status_id', 'value=3');
$this->click("_qf_Contribution_upload-bottom");
+ $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
+ $this->click("_qf_ContributionView_cancel-bottom");
$this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
$this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[1]/span/a");