$this->click("_qf_Contact_upload_view");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->_searchBuilder('Email', NULL, NULL, 'IS NULL');
- $this->type("xpath=//*[@id='Builder-rows-per-page-select']", '100');
- $this->waitForElementPresent("xpath=//*[@id='Builder-rows-per-page-select']");
+ $this->type('CRM_Contact_Form_Search_Builder-rows-per-page-select', '100');
+ $this->waitForElementPresent('CRM_Contact_Form_Search_Builder-rows-per-page-select');
$names = array(
1 => $firstName1,
2 => $firstName2,
}
//searching contacts whose phone field is not empty
$this->_searchBuilder('Phone', NULL, $firstName, 'IS NOT EMPTY');
- $this->type("xpath=//*[@id='Builder-rows-per-page-select']", '100');
- $this->waitForElementPresent("xpath=//*[@id='Builder-rows-per-page-select']");
+ $this->type('CRM_Contact_Form_Search_Builder-rows-per-page-select', '100');
+ $this->waitForElementPresent('CRM_Contact_Form_Search_Builder-rows-per-page-select');
$this->assertTrue($this->isTextPresent($firstName));
$firstName4 = "AB" . substr(sha1(rand()), 0, 7);
}
else {
$this->click("location");
- $this->waitForElementPresent("xpath=//div[@id='location']/table/tbody/tr[2]/td/table/tbody/tr[4]/td[2]/select");
+ $this->waitForElementPresent("$field");
if ($contactType == 'Individual') {
$this->type("$field", $fieldValue);
}
*
*/
function testSearchBuilderfinancialType() {
- // Logging in. Remember to wait for page to load. In most cases,
- // you can rely on 30000 as the value that allows your test to pass, however,
- // sometimes your test might fail because of this. In such cases, it's better to pick one element
- // somewhere at the end of page and use waitForElementPresent on it - this assures you, that whole
- // page contents loaded and you can continue your test execution.
$this->webtestLogin();
// add financial type
$financialType = $financialTypeName2;
}
// create new contact using dialog
- $firstName = substr(sha1(rand()), 0, 7);
- $this->webtestNewDialogContact($firstName, 'Contributor', $firstName . '@example.com');
+ $this->createDialogContact();
$this->select('financial_type_id', $financialType);
$this->type('total_amount', 100 * $i);
$this->clickLink('_qf_Contribution_upload_new', '_qf_Contribution_upload_new');
$this->openCiviPage("contact/search/builder", "reset=1", "_qf_Builder_refresh");
$this->enterValues(1, 1, 'Contribution', 'Financial Type', NULL, '=', array($financialTypeName1));
- $this->click('_qf_Builder_refresh');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink('_qf_Builder_refresh');
$this->assertTrue($this->isTextPresent('3 Contacts'), 'Missing text: ' . '3 Contacts');
$this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
$this->enterValues(1, 1, 'Contribution', 'Financial Type', NULL, '=', array($financialTypeName2));
- $this->click('_qf_Builder_refresh');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink('_qf_Builder_refresh');
+
$this->assertTrue($this->isTextPresent('3 Contacts'), 'Missing text: ' . '3 Contacts');
$this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
$financialTypeName1,
$financialTypeName2
));
- $this->click('_qf_Builder_refresh');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink('_qf_Builder_refresh');
+
$this->assertTrue($this->isTextPresent('6 Contacts'), 'Missing text: ' . '6 Contacts');
}