Merge pull request #11838 from mfb/ses-smtp-support
[civicrm-core.git] / tests / phpunit / WebTest / Campaign / OfflineContributionTest.php
index dd67c00a69280e168b909de7f7ed0539c390c72d..ac5f8ec684f736fd83c5c726dbd1ad9c84f63ed6 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2018                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -22,7 +22,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 require_once 'CiviTest/CiviSeleniumTestCase.php';
 
@@ -109,8 +109,8 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase {
 
     $this->checkCRMAlert("Campaign $title");
 
-    $this->waitForElementPresent("//td[text()='$campaignTitle']");
-    $campaignId = $this->urlArg('id', $this->getAttribute("//td[text()='$campaignTitle']/../td[13]/span/a[text()='Edit']@href"));
+    $this->waitForElementPresent("//td[3]/div[text()='$campaignTitle']");
+    $campaignId = $this->urlArg('id', $this->getAttribute("//td[3]/div[text()='$campaignTitle']/../../td[13]/span/a[text()='Edit']@href"));
 
     $this->offlineContributionTest($campaignTitle, $campaignId);
 
@@ -197,8 +197,7 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase {
 
     // Is status message correct?
     $this->checkCRMAlert("The contribution record has been saved.");
-
-    $this->waitForElementPresent("xpath=//*[@id='Search']//div[2]//table[2]/tbody/tr/td[8]/span/a[text()='View']");
+    $this->waitForElementPresent("xpath=//*[@id='Search']//div[2]//table[2]/tbody/tr/td[8]/span//a[text()='View']");
 
     // click through to the Contribution view screen
     $this->click("xpath=//*[@id='Search']//div[2]//table[2]/tbody/tr/td[8]/span/a[text()='View']");
@@ -221,8 +220,8 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase {
 
       $this->type('sort_name', $firstName);
       $this->click("_qf_Search_refresh");
-      $this->waitForElementPresent("xpath=//div[@id='contributionSearch']/table/tbody/tr/td[11]/span/a[text()='Edit']");
-      $this->click("xpath=//div[@id='contributionSearch']/table/tbody/tr/td[11]/span/a[text()='Edit']");
+      $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']/tbody/tr/td[10]/span//a[text()='Edit']");
+      $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr/td[10]/span//a[text()='Edit']");
       $this->waitForElementPresent("_qf_Contribution_cancel-bottom");
       $this->assertTrue($this->isTextPresent("$campaignTitle"));
     }
@@ -264,9 +263,10 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("link=Campaigns");
     $this->click("search_form_campaign");
     $this->type("campaign_title", $pastCampaignTitle);
-    $this->clickAjaxLink("//a[text()='Search']", "//td[text()='$pastCampaignTitle']");
-    $campaignId = $this->urlArg('id', $this->getAttribute("//td[text()='$pastCampaignTitle']/../td[13]/span/a[text()='Edit']@href"));
+    $this->clickAjaxLink("//a[text()='Search']", "//td[3]/div[text()='$pastCampaignTitle']");
+    $campaignId = $this->urlArg('id', $this->getAttribute("//td[3]/div[text()='$pastCampaignTitle']/../../td[13]/span/a[text()='Edit']@href"));
 
     $this->offlineContributionTest($pastCampaignTitle, $campaignId, TRUE);
   }
+
 }