CRM-12193 - Use more descriptive example text
[civicrm-core.git] / tests / phpunit / CiviTest / CiviSeleniumTestCase.php
index c90b66ade396c9bdb03fb1f38ad2c3268459bd15..1146117e394a993a276dc1f8741f4260fcb31ce9 100644 (file)
@@ -165,9 +165,12 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
    * 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);
     }
@@ -1772,7 +1775,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
   }
 
   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");