* Wait for the page to load
* Wait for an element to be present
*/
- function clickLink($element, $waitFor = 'civicrm-footer') {
+ function clickLink($element, $waitFor = 'civicrm-footer', $waitForPageLoad = TRUE) {
$this->click($element);
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ // conditional wait for page load e.g for ajax form save
+ if ($waitForPageLoad) {
+ $this->waitForPageToLoad($this->getTimeoutMsec());
+ }
if ($waitFor) {
$this->waitForElementPresent($waitFor);
}
$this->type('organization_name', $orgName);
$this->type('street_address-1', 'Test Org Street');
$this->type('city-1', 'Test Org City');
- $this->clickLink('_qf_Edit_next', 'selected_shared_address-2');
+ $this->clickLink('_qf_Edit_next', 'selected_shared_address-2', FALSE);
$this->waitForTextPresent('Test Org Street');
$this->inlineEdit('address-block-2', array(
'address_2_location_type_id' => array('Work'),