// Add new Financial Account
$orgName = 'Alberta '.substr(sha1(rand()), 0, 7);
+ $uniqueName = explode(" ",$orgName);
$financialAccountTitle = 'Financial Account '.substr(sha1(rand()), 0, 4);
$financialAccountDescription = "{$financialAccountTitle} Description";
$accountingCode = 1033;
$this->_testAddFinancialAccount($financialAccountTitle,
$financialAccountDescription,
$accountingCode,
- $orgName,
+ $uniqueName[1],
$financialAccountType,
$taxDeductible,
$isActive,
$this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
- $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom');
+ $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE);
//Varify Data after Adding new Financial Account
$verifyData = array('name' => $financialAccountTitle,
'description' => $financialAccountDescription,
'accounting_code' => $accountingCode,
- 'contact_name' => $orgName,
'tax_rate' => $taxRate,
'is_tax' => 'on',
'is_deductible' => 'off',
'is_default' => 'off'
);
+
+ $this->assertEquals($orgName, $this->getText("xpath=//*[@id='s2id_contact_id']/a/span[1]"));
$this->_assertFinancialAccount($verifyData);
$verifySelectFieldData = array('financial_account_type_id' => $financialAccountType);
if ($orgNameEdit) {
$orgNameEdit = 'NGO '.substr(sha1(rand()), 0, 7);
$this->webtestAddOrganization($orgNameEdit);
+ $uniqueName = explode(" ",$orgNameEdit);
}
$this->_testEditFinancialAccount($editfinancialAccount,
$financialAccountTitle,
$financialAccountDescription,
$accountingCode,
- $orgNameEdit,
+ $uniqueName[1],
$financialAccountType,
$taxDeductible,
$isActive,
$orgName = $orgNameEdit;
}
$this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
- $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom');
+ $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE);
$verifyData = array( 'name' => $financialAccountTitle,
'description' => $financialAccountDescription,
'accounting_code' => $accountingCode,
- 'contact_name' => $orgName,
'tax_rate' => $taxRate,
'is_tax' => 'on',
'is_deductible' => 'off',
'is_default' => 'off',
);
- $verifySelectFieldData = array('financial_account_type_id' => $financialAccountType);
+
+ $this->assertEquals($orgName, $this->getText("xpath=//*[@id='s2id_contact_id']/a/span[1]"));
+
$this->_assertFinancialAccount($verifyData);
+ $verifySelectFieldData = array('financial_account_type_id' => $financialAccountType);
$this->_assertSelectVerify($verifySelectFieldData);
$this->click('_qf_FinancialAccount_cancel-botttom');
$this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Delete']");
),
);
+ $this->waitForElementPresent('newFinancialType');
+ $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[7]/span/a[text()='Accounts']");
+ $this->waitForElementPresent('newfinancialTypeAccount');
+
foreach ($expected as $value => $label) {
- $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='$label[financial_account]']/../td[1]", preg_quote($label['account_relationship']));
+ $this->verifyText("xpath=//div[@id='ltype']/div/table/tbody/tr/td[2][text()='$label[financial_account]']/../td[1]", preg_quote($label['account_relationship']));
}
+
$this->openCiviPage('admin/financial/financialType', 'reset=1', 'newFinancialType');
$this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[3]", 'Accounts Receivable,Banking Fees,Premiums,' . $financialType['name']);
$this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[7]/span/a[text()='Accounts']");
$this->waitForElementPresent('newfinancialTypeAccount');
- $this->click("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='Banking Fees']/../td[7]/span/a[text()='Edit']");
+ $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
$this->select('account_relationship', "label=Premiums Inventory Account is");
$this->select('financial_account_id', "label=Premiums inventory");
$this->click('_qf_FinancialTypeAccount_next');
- $this->waitForElementPresent("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[7]/span/a[text()='Edit']");
- $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[1]", preg_quote('Premiums Inventory Account is'));
- $this->clickLink("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[7]/span/a[text()='Delete']", '_qf_FinancialTypeAccount_next-botttom');
+ $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->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent("newfinancialTypeAccount");
$this->waitForText('crm-notification-container', 'Selected financial type account has been deleted.');
//edit financial type
$this->typeKeys('css=input#sort_name_navigation', $firstName1);
// Wait for result list.
- $this->waitForElementPresent("css=div.ac_results-inner li");
+ $this->waitForElementPresent("css=ul.ui-autocomplete li");
// Visit contact summary page.
- $this->click("css=div.ac_results-inner li");
+ $this->click("css=ul.ui-autocomplete li");
$this->waitForPageToLoad($this->getTimeoutMsec());
foreach($customDataParams['customFields'] as $key => $value){
$this->click('_qf_Field_next-bottom');
$this->waitForElementPresent('newCustomField');
- $this->waitForText('crm-notification-container',"Your custom field '{$customField}' has been saved.");
+ $this->waitForText('crm-notification-container',"Custom field '{$customField}' has been saved.");
$customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField']/../../td[8]/span/a@href"));
$customFieldId = $customFieldId[1];
// create custom field - Integer
$this->click("newCustomField");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('_qf_Field_next-bottom');
$customField1 = 'Customfield_int ' . substr(sha1(rand()), 0, 4);
$this->type('label', $customField1);
$this->select("data_type[0]","value=1");
// clicking save
$this->click('_qf_Field_next-bottom');
$this->waitForElementPresent('newCustomField');
- $this->waitForText('crm-notification-container', "Your custom field '{$customField1}' has been saved.");
+ $this->waitForText('crm-notification-container', "Custom field '{$customField1}' has been saved.");
+ $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField1']");
$customFieldId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField1']/../../td[8]/span/a@href"));
$customFieldId1 = $customFieldId1[1];
// create custom field - Number
$this->click("newCustomField");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('_qf_Field_next-bottom');
$customField2 = 'Customfield_Number ' . substr(sha1(rand()), 0, 4);
$this->type('label', $customField2);
$this->select("data_type[0]","value=2");
// clicking save
$this->click('_qf_Field_next-bottom');
$this->waitForElementPresent('newCustomField');
- $this->waitForText('crm-notification-container', "Your custom field '{$customField2}' has been saved.");
+ $this->waitForText('crm-notification-container', "Custom field '{$customField2}' has been saved.");
+ $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField2']");
$customFieldId2 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField2']/../../td[8]/span/a@href"));
$customFieldId2 = $customFieldId2[1];
// create custom field - "alphanumeric select"
$this->click("newCustomField");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('_qf_Field_next-bottom');
$customField3 = 'Customfield_alp_select' . substr(sha1(rand()), 0, 4);
$customFieldId3 = $this->_createMultipleValueCustomField($customField3,'Select');
// create custom field - "alphanumeric radio"
$this->click("newCustomField");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('_qf_Field_next-bottom');
$customField4 = 'Customfield_alp_radio' . substr(sha1(rand()), 0, 4);
$customFieldId4 = $this->_createMultipleValueCustomField($customField4,'Radio');
// create custom field - "alphanumeric checkbox"
$this->click("newCustomField");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('_qf_Field_next-bottom');
$customField5 = 'Customfield_alp_checkbox' . substr(sha1(rand()), 0, 4);
$customFieldId5 = $this->_createMultipleValueCustomField($customField5,'CheckBox');
// create custom field - "alphanumeric multiselect"
$this->click("newCustomField");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('_qf_Field_next-bottom');
$customField6 = 'Customfield_alp_multiselect' . substr(sha1(rand()), 0, 4);
$customFieldId6 = $this->_createMultipleValueCustomField($customField6,'Multi-Select');
// create custom field - "alphanumeric advmultiselect"
$this->click("newCustomField");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('_qf_Field_next-bottom');
$customField7 = 'Customfield_alp_advmultiselect' . substr(sha1(rand()), 0, 4);
$customFieldId7 = $this->_createMultipleValueCustomField($customField7,'AdvMulti-Select');
// create custom field - "alphanumeric autocompleteselect"
$this->click("newCustomField");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('_qf_Field_next-bottom');
$customField8 = 'Customfield_alp_autocompleteselect' . substr(sha1(rand()), 0, 4);
$customFieldId8 = $this->_createMultipleValueCustomField($customField8,'Autocomplete-Select');
// create custom field - Money
$this->click("newCustomField");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('_qf_Field_next-bottom');
$customField9 = 'Customfield_Money' . substr(sha1(rand()), 0, 4);
$this->type('label', $customField9);
$this->select("data_type[0]","value=3");
// clicking save
$this->click('_qf_Field_next-bottom');
$this->waitForElementPresent('newCustomField');
- $this->waitForText('crm-notification-container', "Your custom field '{$customField9}' has been saved.");
+ $this->waitForText('crm-notification-container', "Custom field '{$customField9}' has been saved.");
+ $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField9']");
$customFieldId9 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField9']/../../td[8]/span/a@href"));
$customFieldId9 = $customFieldId9[1];
// create custom field - Date
$this->click("newCustomField");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('_qf_Field_next-bottom');
$customField10 = 'Customfield_Date' . substr(sha1(rand()), 0, 4);
$this->type('label', $customField10);
$this->select("data_type[0]","value=5");
// clicking save
$this->click('_qf_Field_next-bottom');
$this->waitForElementPresent('newCustomField');
- $this->waitForText('crm-notification-container', "Your custom field '{$customField10}' has been saved.");
+ $this->waitForText('crm-notification-container', "Custom field '{$customField10}' has been saved.");
+ $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField10']");
$customFieldId10 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField10']/../../td[8]/span/a@href"));
$customFieldId10 = $customFieldId10[1];
// clicking save
$this->click('_qf_Field_next-bottom');
$this->waitForElementPresent('newCustomField');
- $this->waitForText('crm-notification-container', "Your custom field '{$customFieldName}' has been saved.");
+ $this->waitForText('crm-notification-container', "Custom field '{$customFieldName}' has been saved.");
+ $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customFieldName']");
$customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customFieldName']/../../td[8]/span/a@href"));
$customFieldId = $customFieldId[1];
return $customFieldId;