Webtests Fix
[civicrm-core.git] / tests / phpunit / WebTest / Campaign / OnlineEventRegistrationTest.php
index 7e9e1a9df51223783379fc9473dd3f8ff4f702db..06cc0444ad4c13533b9f327e5f5eaae67e89704e 100644 (file)
@@ -114,11 +114,11 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase
 
   /**
    * @param $campaignTitle
-   * @param $id
+   * @param int $id
    */
   function onlineParticipantAddTest($campaignTitle, $id) {
-    // We need a payment processor
-    $processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7);
+    // Use default payment processor
+    $processorName = 'Test Processor';
     $paymentProcessorId = $this->webtestAddPaymentProcessor($processorName);
 
     $this->openCiviPage("event/add", "reset=1&action=add");
@@ -140,7 +140,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase
     $eventInfoStrings = array($eventTitle, $eventDescription, $streetAddress);
     $this->_testVerifyEventInfo($eventTitle, $eventInfoStrings);
 
-    $registerStrings = array("$ 250.00 Member", "$ 325.00 Non-member", $registerIntro);
+    $registerStrings = array("Member - $ 250.00", "Non-member - $ 325.00", $registerIntro);
     $registerUrl = $this->_testVerifyRegisterPage($registerStrings);
 
     $numberRegistrations = 3;
@@ -150,7 +150,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase
   }
 
   /**
-   * @param $id
+   * @param int $id
    * @param $eventTitle
    * @param $eventDescription
    */
@@ -210,7 +210,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase
   /**
    * @param bool $discount
    * @param bool $priceSet
-   * @param $processorId
+   * @param int $processorId
    */
   function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) {
     // Go to Fees tab
@@ -357,9 +357,9 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase
 
     $this->type('sort_name', $email);
     $this->click("_qf_Search_refresh");
-    $this->waitForElementPresent("//*[@id='participantSearch']");
-    $this->click("xpath=//div[@id='participantSearch']/table/tbody/tr/td[11]/span/a[text()='Edit']");
+    $this->waitForElementPresent("xpath=//div[@id='participantSearch']");
+    $this->click("xpath=//div[@id='participantSearch']/table/tbody/tr/td[11]/span[1]/a[2][text()='Edit']");
     $this->waitForElementPresent("_qf_Participant_cancel-bottom");
-    $this->assertElementContainsText('crm-container', "$campaignTitle");
+    $this->assertElementContainsText("xpath=//form[@id='Participant']/div[2]/div/table[@class='form-layout-compressed']/tbody/tr[4]/td[2]/select", "$campaignTitle");
   }
 }