Webtests Fixes
[civicrm-core.git] / tests / phpunit / WebTest / Contribute / AddBatchesTest.php
index ab40ed45597287501aecfd70738d0e75d447054b..8a471ecbd4c53ee4d71f3aa7e6d5b0f32020a386 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.                                    |
  |                                                                    |
@@ -120,7 +120,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
     $this->webtestLogin();
 
     // create a new pledge for contact
-    $contact = WebTest_Pledge_StandaloneAddTest::testStandalonePledgeAdd();
+    $contact = $this->webtestStandalonePledgeAdd();
 
     $itemCount = 2;
     $softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);
@@ -268,8 +268,8 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
     if ($type == "Contribution") {
       $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
       $this->type("sort_name", "{$data['last_name']} {$data['first_name']}");
-      $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-      $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
+      $this->clickLink("_qf_Search_refresh", "xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span//a[text()='View']", FALSE);
+      $this->clickLink("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span//a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
       $expected = array(
         'From' => "{$data['first_name']} {$data['last_name']}",
         'Financial Type' => $data['financial_type'],
@@ -284,7 +284,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
         'Soft Credit Type' => $data['soft_credit_type'],
       );
       foreach ($expectedSoft as $value) {
-        $this->verifyText("css=table.crm-soft-credit-listing", preg_quote($value));
+        $this->assertElementContainsText("css=table.crm-soft-credit-listing", $value);
       }
     }
     elseif ($type == "Membership") {
@@ -300,7 +300,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
         4 => 'New',
       );
       foreach ($expected as $label => $value) {
-        $this->verifyText("xpath=id('MembershipView')/div[2]/div/table[1]/tbody/tr[$label]/td[2]", preg_quote($value));
+        $this->assertElementContainsText("xpath=id('MembershipView')/div[2]/div/table[1]/tbody/tr[$label]/td[2]", $value);
       }
       //View Contribution
       $this->waitForElementPresent("xpath=//form[@id='MembershipView']/div[2]/div/div[2]/div[2]/table/tbody/tr[1]/td[8]/span/a[1][text()='View']");
@@ -320,7 +320,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
         'Soft Credit Type' => $data['soft_credit_type'],
       );
       foreach ($expectedSoft as $value) {
-        $this->verifyText("css=table.crm-soft-credit-listing", preg_quote($value));
+        $this->assertElementContainsText("css=table.crm-soft-credit-listing", $value);
       }
     }
   }