Webtest Fix 4.5
[civicrm-core.git] / tests / phpunit / WebTest / Event / ParticipantSearchTest.php
index 7b2b3370cb1101518fe6c94835c0206df3ffafb6..1fcb6878b21b2174dd5a81c2516b29a22a6d22c7 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
   +--------------------------------------------------------------------+
-  | CiviCRM version 4.3                                                |
+  | CiviCRM version 4.5                                                |
   +--------------------------------------------------------------------+
-  | Copyright CiviCRM LLC (c) 2004-2013                                |
+  | Copyright CiviCRM LLC (c) 2004-2014                                |
   +--------------------------------------------------------------------+
   | This file is a part of CiviCRM.                                    |
   |                                                                    |
   +--------------------------------------------------------------------+
 */
 
-
 require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Event_ParticipantSearchTest
+ */
 class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase {
 
   protected function setUp() {
     parent::setUp();
   }
 
+  /**
+   * @param $strings
+   */
   function _checkStrings(&$strings) {
     // search for elements
     foreach ($strings as $string) {
@@ -101,8 +107,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase {
     $this->openCiviPage("event/search", "reset=1");
 
     $eventName = "Fall Fundraiser Dinner";
-    $this->type("event_name", $eventName);
-    $this->type("event_id", 1);
+    $this->select2("event_id", $eventName);
 
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -153,9 +158,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase {
     $this->webtestFillDate('event_end_date_high', '+1 year');
 
     $eventTypeName = 'Fundraiser';
-    $this->type("event_type", $eventTypeName);
-    $this->type("event_type_id", 3);
-
+    $this->select2("event_type_id", $eventTypeName);
 
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -179,7 +182,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase {
     // visit event search page
     $this->openCiviPage("event/search", "reset=1");
 
-    $this->click("xpath=//div[@id='Food_Preference']/div[2]/table/tbody/tr/td[2]//label[contains(text(),'Chicken Combo')]");
+    $this->select("xpath=//div[@id='Food_Preference']/div[2]/table/tbody/tr/td[2]//select", 'Chicken Combo');
 
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -191,7 +194,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase {
 
     $this->_checkStrings($stringsToCheck);
 
-    $this->click("xpath=//div[@id='Food_Preference']/div[2]/table/tbody/tr/td[2]//label[contains(text(),'Salmon Stew')]");
+    $this->select("xpath=//div[@id='Food_Preference']/div[2]/table/tbody/tr/td[2]//select", 'Salmon Stew');
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -213,12 +216,10 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase {
 
     $this->waitForElementPresent("xpath=id('participantSearch')/table/tbody/tr/td[11]/span/a[text()='View']");
     $this->click("xpath=id('participantSearch')/table/tbody/tr/td[11]/span/a[text()='View']");
-    $this->waitForElementPresent("_qf_ParticipantView_cancel-bottom");
+    $this->waitForTextPresent("View Event Registration");
 
     // ensure we get to particpant view
     $stringsToCheck = array(
-      "View Participant",
-      "Event Registration",
       "Name",
       "Event",
       "Participant Role",
@@ -240,11 +241,10 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase {
 
     $this->waitForElementPresent("xpath=id('participantSearch')/table/tbody/tr/td[11]/span/a[text()='Edit']");
     $this->click("xpath=id('participantSearch')/table/tbody/tr/td[11]/span/a[text()='Edit']");
-    $this->waitForElementPresent("_qf_Participant_cancel-bottom");
+    $this->waitForTextPresent("Edit Event Registration");
 
     // ensure we get to particpant view
     $stringsToCheck = array(
-      "Edit Event Registration",
       "Participant",
       "Event",
       "Participant Role",