* 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);
}
}
function addPaymentInstrument($label, $financialAccount) {
- $this->openCiviPage('admin/options/payment_instrument?group=payment_instrument&action=add', 'reset=1', "_qf_Options_next-bottom");
+ $this->openCiviPage('admin/options/payment_instrument', 'group=payment_instrument&action=add&reset=1', "_qf_Options_next-bottom");
$this->type("label", $label);
$this->select("financial_account_id", "value=$financialAccount");
$this->click("_qf_Options_next-bottom");