Merge pull request #4925 from KarinG/patch-1
[civicrm-core.git] / tests / phpunit / WebTest / Campaign / ActivityTest.php
index 661e246d1dca67801ffa1bafb916dce0b2b70408..03700f51adce0b05ebb3f4b40afbbd470ac65fb7 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -35,7 +35,7 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase {
     parent::setUp();
   }
 
-  function testCreateCampaign() {
+  public function testCreateCampaign() {
     $this->webtestLogin('admin');
 
     // Enable CiviCampaign module if necessary
@@ -106,8 +106,8 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase {
 
     $this->waitForText('crm-notification-container', "Campaign $title");
 
-    $this->waitForElementPresent("xpath=//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[3][text()='{$campaignTitle}']/../td[1]");
-    $id = (int) $this->getText("xpath=//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[3][text()='{$campaignTitle}']/../td[1]");
+    $this->waitForElementPresent("xpath=//div[@id='campaignList']/div/table/tbody//tr/td[3]/div[text()='{$campaignTitle}']/../../td[1]");
+    $id = (int) $this->getText("xpath=//div[@id='campaignList']/div/table/tbody//tr/td[3]/div[text()='{$campaignTitle}']/../../td[1]");
     $this->activityAddTest($campaignTitle, $id);
   }
 
@@ -115,7 +115,7 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase {
    * @param $campaignTitle
    * @param int $id
    */
-  function activityAddTest($campaignTitle, $id) {
+  public function activityAddTest($campaignTitle, $id) {
     // Adding Adding contact with randomized first name for test testContactContextActivityAdd
     // We're using Quick Add block on the main page for this.
     $firstName1 = substr(sha1(rand()), 0, 7);
@@ -190,12 +190,12 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase {
     $this->type("followup_activity_subject", "This is subject of schedule follow-up activity");
 
     // Clicking save.
-    $this->clickLink("_qf_Activity_upload",'link=View',FALSE);
+    $this->clickLink("_qf_Activity_upload", 'link=View', FALSE);
 
     // Is status message correct?
     $this->waitForText('crm-notification-container', $subject);
 
-    $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr[1]/td[8]/span/a[text()='View']");
+    $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[1]/td[8]/span/a[1][text()='View']");
 
     // click through to the Activity view screen
     $this->click("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr[2]/td[8]/span/a[text()='View']");
@@ -206,4 +206,3 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase {
     $this->verifyText("xpath=//form[@id='Activity']/div[2]/table/tbody/tr[5]/td[2]/span", $campaignTitle);
   }
 }
-