Merge pull request #4940 from mlutfy/crm15824
[civicrm-core.git] / tests / phpunit / WebTest / Event / PricesetMaxCountTest.php
index 3cdea2324ae5aad39ece26ab4beec0396e05e091..38bbbf10f32007952c42b37fa27b5384abe6bfa6 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_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     parent::setUp();
   }
 
-  function testWithoutFieldCount() {
+  public function testWithoutFieldCount() {
     // Log in using webtestLogin() method
     $this->webtestLogin();
 
@@ -117,35 +117,28 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $pricesetLoc = $this->getLocation();
 
     // get text field Id.
-    $textFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']/table/tbody/tr[1]/td[9]/span[1]/a[2]@href"));
-    $textFieldId = explode('&', $textFieldId[0]);
-    $textFieldId = explode('=', $textFieldId[3]);
-    $textFieldId = $textFieldId[1];
+    $this->waitForElementPresent("xpath=//div[@id='crm-main-content-wrapper']/div/a[1]");
+    $textFieldIdURL = $this->getAttribute("xpath=//div[@id='field_page']/table/tbody/tr[1]/td[9]/span[1]/a[2]@href");
+    $textFieldId = $this->urlArg('fid', $textFieldIdURL);
 
     $this->open($pricesetLoc);
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // get select field id
     $this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[8]/a");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button[2]/span[2]");
     $selectFieldLoc = $this->getLocation();
-    $selectFieldId = $this->urlArg('fid');
+    $selectFieldURL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[9]/span[1]/a[2]@href");
+    $selectFieldId = $this->urlArg('fid', $selectFieldURL);
 
     // get select field ids
     // get select field option1
-    $selectFieldOp1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[7]/span[1]/a[1]@href"));
-    $selectFieldOp1 = explode('&', $selectFieldOp1[0]);
-    $selectFieldOp1 = explode('=', $selectFieldOp1[2]);
-    $selectFieldOp1 = $selectFieldOp1[1];
-
-    $this->open($selectFieldLoc);
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $selectFieldOp1URL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[7]/span[1]/a[1]@href");
+    $selectFieldOp1 = $this->urlArg('oid', $selectFieldOp1URL);
 
     // get select field option2
-    $selectFieldOp2 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[7]/span[1]/a[1]@href"));
-    $selectFieldOp2 = explode('&', $selectFieldOp2[0]);
-    $selectFieldOp2 = explode('=', $selectFieldOp2[2]);
-    $selectFieldOp2 = $selectFieldOp2[1];
+    $selectFieldOp2URL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[7]/span[1]/a[1]@href");
+    $selectFieldOp2 = $this->urlArg('oid', $selectFieldOp2URL);
 
     // create event.
     $eventTitle = 'Meeting - ' . substr(sha1(rand()), 0, 7);
@@ -177,7 +170,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
 
     $this->type('first_name', 'Mary');
-    $this->type('last_name', 'Jones'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jones' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -205,7 +198,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     // exceed maximun count for text field, check for form rule
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '2');
     $this->type('first_name', 'Mary');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -227,13 +220,14 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     // fill correct available option for select field
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
 
+    $this->click("css=input[data-amount=10]");
     $this->click('_qf_Register_upload-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     $this->_checkConfirmationAndRegister();
   }
 
-  function testWithFieldCount() {
+  public function testWithFieldCount() {
     // Log in using webtestLogin() method
     $this->webtestLogin();
 
@@ -322,35 +316,28 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $pricesetLoc = $this->getLocation();
 
     // get text field Id.
-    $textFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]@href"));
-    $textFieldId = explode('&', $textFieldId[0]);
-    $textFieldId = explode('=', $textFieldId[3]);
-    $textFieldId = $textFieldId[1];
+    $this->waitForElementPresent("xpath=//div[@id='crm-main-content-wrapper']/div/a[1]");
+    $textFieldIdURL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]@href");
+    $textFieldId = $this->urlArg('fid', $textFieldIdURL);
 
     $this->open($pricesetLoc);
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // get select field id
     $this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[8]/a");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button[2]/span[2]");
     $selectFieldLoc = $this->getLocation();
-    $selectFieldId = $this->urlArg('fid');
+    $selectFieldURL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[9]/span[1]/a[2]@href");
+    $selectFieldId = $this->urlArg('fid', $selectFieldURL);
 
     // get select field ids
     // get select field option1
-    $selectFieldOp1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[7]/span[1]/a[1]@href"));
-    $selectFieldOp1 = explode('&', $selectFieldOp1[0]);
-    $selectFieldOp1 = explode('=', $selectFieldOp1[2]);
-    $selectFieldOp1 = $selectFieldOp1[1];
-
-    $this->open($selectFieldLoc);
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $selectFieldOp1URL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[7]/span[1]/a[1]@href");
+    $selectFieldOp1 = $this->urlArg('oid', $selectFieldOp1URL);
 
     // get select field option2
-    $selectFieldOp2 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[7]/span[1]/a[1]@href"));
-    $selectFieldOp2 = explode('&', $selectFieldOp2[0]);
-    $selectFieldOp2 = explode('=', $selectFieldOp2[2]);
-    $selectFieldOp2 = $selectFieldOp2[1];
+    $selectFieldOp2URL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[7]/span[1]/a[1]@href");
+    $selectFieldOp2 = $this->urlArg('oid', $selectFieldOp2URL);
 
     // create event.
     $eventTitle = 'Meeting - ' . substr(sha1(rand()), 0, 7);
@@ -380,7 +367,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '3');
 
     $this->type('first_name', 'Mary');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -410,7 +397,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     // check for form rule
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '2');
     $this->type('first_name', 'Mary');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -439,7 +426,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->_checkConfirmationAndRegister();
   }
 
-  function testAdditionalParticipantWithoutFieldCount() {
+  public function testAdditionalParticipantWithoutFieldCount() {
     // Log in using webtestLogin() method
     $this->webtestLogin();
 
@@ -521,35 +508,28 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $pricesetLoc = $this->getLocation();
 
     // get text field Id.
-    $textFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]@href"));
-    $textFieldId = explode('&', $textFieldId[0]);
-    $textFieldId = explode('=', $textFieldId[3]);
-    $textFieldId = $textFieldId[1];
+    $this->waitForElementPresent("xpath=//div[@id='crm-main-content-wrapper']/div/a[1]");
+    $textFieldURL = $this->getAttribute("xpath=//div[@id='field_page']/table/tbody/tr[1]/td[9]/span[1]/a[2]@href");
+    $textFieldId = $this->urlArg('fid', $textFieldURL);
 
     $this->open($pricesetLoc);
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // get select field id
     $this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[8]/a");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button[2]/span[2]");
     $selectFieldLoc = $this->getLocation();
-    $selectFieldId = $this->urlArg('fid');
+    $selectFieldURL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[9]/span[1]/a[2]@href");
+    $selectFieldId = $this->urlArg('fid', $selectFieldURL);
 
     // get select field ids
     // get select field option1
-    $selectFieldOp1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[7]/span[1]/a[1]@href"));
-    $selectFieldOp1 = explode('&', $selectFieldOp1[0]);
-    $selectFieldOp1 = explode('=', $selectFieldOp1[2]);
-    $selectFieldOp1 = $selectFieldOp1[1];
-
-    $this->open($selectFieldLoc);
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $selectFieldOp1URL = $this->getAttribute("xpath=//div[@id='field_page']/table/tbody/tr[1]/td[7]/span[1]/a[1]@href");
+    $selectFieldOp1 = $this->urlArg('oid', $selectFieldOp1URL);
 
     // get select field option2
-    $selectFieldOp2 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[7]/span[1]/a[1]@href"));
-    $selectFieldOp2 = explode('&', $selectFieldOp2[0]);
-    $selectFieldOp2 = explode('=', $selectFieldOp2[2]);
-    $selectFieldOp2 = $selectFieldOp2[1];
+    $selectFieldOp2URL = $this->getAttribute("xpath=//div[@id='field_page']/table/tbody/tr[2]/td[7]/span[1]/a[1]@href");
+    $selectFieldOp2 = $this->urlArg('oid', $selectFieldOp2URL);
 
     // create event.
     $eventTitle = 'Meeting - ' . substr(sha1(rand()), 0, 7);
@@ -585,7 +565,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '7');
 
     $this->type('first_name', 'Mary');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -606,7 +586,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '6');
 
     $this->type('first_name', 'Mary Add 2');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -627,7 +607,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '3');
 
     $this->type('first_name', 'Mary Add 2');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -671,7 +651,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '3');
 
     $this->type('first_name', 'Mary');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -702,7 +682,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '2');
 
     $this->type('first_name', 'Mary Add 1');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -731,7 +711,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->_checkConfirmationAndRegister();
   }
 
-  function testAdditionalParticipantWithFieldCount() {
+  public function testAdditionalParticipantWithFieldCount() {
     // Log in using webtestLogin() method
     $this->webtestLogin();
 
@@ -820,35 +800,28 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $pricesetLoc = $this->getLocation();
 
     // get text field Id.
-    $textFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]@href"));
-    $textFieldId = explode('&', $textFieldId[0]);
-    $textFieldId = explode('=', $textFieldId[3]);
-    $textFieldId = $textFieldId[1];
+    $this->waitForElementPresent("xpath=//div[@id='crm-main-content-wrapper']/div/a[1]");
+    $textFieldIdURL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]@href");
+    $textFieldId = $this->urlArg('fid', $textFieldIdURL);
 
     $this->open($pricesetLoc);
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // get select field id
     $this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[8]/a");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button[2]/span[2]");
     $selectFieldLoc = $this->getLocation();
-    $selectFieldId = $this->urlArg('fid');
+    $selectFieldURL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[9]/span[1]/a[2]@href");
+    $selectFieldId = $this->urlArg('fid', $selectFieldURL);
 
     // get select field ids
     // get select field option1
-    $selectFieldOp1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[7]/span[1]/a[1]@href"));
-    $selectFieldOp1 = explode('&', $selectFieldOp1[0]);
-    $selectFieldOp1 = explode('=', $selectFieldOp1[2]);
-    $selectFieldOp1 = $selectFieldOp1[1];
-
-    $this->open($selectFieldLoc);
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $selectFieldOp1URL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[7]/span[1]/a[1]@href");
+    $selectFieldOp1 = $this->urlArg('oid', $selectFieldOp1URL);
 
     // get select field option2
-    $selectFieldOp2 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[7]/span[1]/a[1]@href"));
-    $selectFieldOp2 = explode('&', $selectFieldOp2[0]);
-    $selectFieldOp2 = explode('=', $selectFieldOp2[2]);
-    $selectFieldOp2 = $selectFieldOp2[1];
+    $selectFieldOp2URL = $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[7]/span[1]/a[1]@href");
+    $selectFieldOp2 = $this->urlArg('oid', $selectFieldOp2URL);
 
     // create event.
     $eventTitle = 'Meeting - ' . substr(sha1(rand()), 0, 7);
@@ -884,7 +857,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '7');
 
     $this->type('first_name', 'Mary');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -905,7 +878,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '6');
 
     $this->type('first_name', 'Mary Add 1');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -926,7 +899,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '3');
 
     $this->type('first_name', 'Mary Add 2');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -944,7 +917,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->click('_qf_Participant_2_next-Array');
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->assertStringsPresent(array('Sorry, currently only 4 seats are available for this option.'));
+    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
 
     // Skip participant3 and register
     $this->click('_qf_Participant_2_next_skip-Array');
@@ -970,7 +943,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '3');
 
     $this->type('first_name', 'Mary');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -1001,7 +974,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '2');
 
     $this->type('first_name', 'Mary Add 1');
-    $this->type('last_name', 'Jane'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('email-Primary', $email);
 
@@ -1034,7 +1007,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
    * @param $setTitle
    * @param null $financialType
    */
-  function _testAddSet($setTitle, $financialType = NULL) {
+  public function _testAddSet($setTitle, $financialType = NULL) {
     $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom');
 
     // Enter Priceset fields (Title, Used For ...)
@@ -1055,7 +1028,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
   /**
    * @param $fields
    */
-  function _testAddPriceFields($fields) {
+  public function _testAddPriceFields($fields) {
     $fieldCount = count($fields);
     $count = 1;
     $this->waitForElementPresent('label');
@@ -1102,6 +1075,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
       else {
         $this->click('_qf_Field_next-bottom');
       }
+      $this->waitForAjaxContent();
       $this->waitForText('crm-notification-container', "Price Field '$label' has been saved.");
 
       $count++;
@@ -1112,7 +1086,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
    * @param $options
    * @param $fieldType
    */
-  function _testAddMultipleChoiceOptions($options, $fieldType) {
+  public function _testAddMultipleChoiceOptions($options, $fieldType) {
     foreach ($options as $oIndex => $oValue) {
       $this->type("option_label_{$oIndex}", $oValue['label']);
       $this->type("option_amount_{$oIndex}", $oValue['amount']);
@@ -1144,11 +1118,11 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
   }
 
   /**
-   * @param $params
+   * @param array $params
    *
    * @return string
    */
-  function _testAddEvent($params) {
+  public function _testAddEvent($params) {
     $this->openCiviPage('event/add', 'reset=1&action=add', '_qf_EventInfo_upload-bottom');
 
     $this->select('event_type_id', "value={$params['event_type_id']}");
@@ -1226,7 +1200,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     return $this->getLocation();
   }
 
-  function _fillRegisterWithBillingInfo() {
+  public function _fillRegisterWithBillingInfo() {
     $this->waitForElementPresent('credit_card_type');
     $this->select('credit_card_type', 'value=Visa');
     $this->type('credit_card_number', '4111111111111111');
@@ -1245,9 +1219,10 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
   }
 
-  function _checkConfirmationAndRegister() {
+  public function _checkConfirmationAndRegister() {
     $confirmStrings = array('Event Fee(s)', 'Billing Name and Address', 'Credit Card Information');
     $this->assertStringsPresent($confirmStrings);
+    $this->waitForElementPresent("_qf_Confirm_next-bottom");
     $this->click('_qf_Confirm_next-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $thankStrings = array('Thank You for Registering', 'Event Total', 'Transaction Date');