Merge pull request #9374 from jitendrapurohit/CRM-19048
[civicrm-core.git] / tests / phpunit / WebTest / Contribute / UpdateBatchPendingContributionTest.php
index 75b2640f29147c1d1de4a4d888d2a6c9b7f55db7..9da465dae259883da204ee3dccff7721b88e37e1 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2016                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -44,6 +44,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium
     $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
 
     $this->type("sort_name", "Individual");
+    $this->waitForElementPresent("contribution_status_id");
     $this->multiselect2('contribution_status_id', array("Pending"));
     $this->clickLink("_qf_Search_refresh");
 
@@ -51,6 +52,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium
     $this->waitForAjaxContent();
     $this->select('task', "label=Update pending contribution status");
     $this->waitForAjaxContent();
+    $this->waitForElementPresent("contribution_status_id");
     $this->select('contribution_status_id', 'label=Completed');
     $this->waitForAjaxContent();
     $this->click('_qf_Status_next');
@@ -60,6 +62,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium
     $this->waitForElementPresent("contribution_date_low");
 
     $this->type("sort_name", "Individual");
+    $this->waitForElementPresent("contribution_status_id");
     $this->multiselect2('contribution_status_id', array("Completed"));
     $this->click("_qf_Search_refresh");
 
@@ -93,8 +96,8 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium
     // Search the participants
     $this->openCiviPage("event/search", "reset=1", '_qf_Search_refresh');
 
-    $eventName = 'Rain';
-    $this->select2("event_id", $eventName);
+    $eventName = 'Rain-forest Cup Youth Soccer Tournament';
+    $this->select2("event_id", $eventName, TRUE);
     $this->click('_qf_Search_refresh');
 
     $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
@@ -200,6 +203,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium
     $this->select("financial_type_id", "value=1");
 
     //Contribution status
+    $this->waitForElementPresent("contribution_status_id");
     $this->select("contribution_status_id", "label=Pending");
 
     // total amount
@@ -225,7 +229,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium
       'Contribution Status' => 'Pending',
     );
     foreach ($expected as $label => $value) {
-      $this->verifyText("xpath=id('ContributionView')/div[2]/table[1]/tbody//tr/td[1][text()='$label']/../td[2]", preg_quote($value));
+      $this->assertElementContainsText("xpath=id('ContributionView')/div[2]/table[1]/tbody//tr/td[1][text()='$label']/../td[2]", $value);
     }
   }