Merge pull request #4940 from mlutfy/crm15824
[civicrm-core.git] / tests / phpunit / WebTest / Event / PricesetMaxCountTest.php
index 98d4ffc6850ef3ca62abca44679eec8a23146f33..38bbbf10f32007952c42b37fa27b5384abe6bfa6 100644 (file)
@@ -170,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);
 
@@ -198,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);
 
@@ -220,6 +220,7 @@ 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());
 
@@ -366,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);
 
@@ -396,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);
 
@@ -564,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);
 
@@ -585,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);
 
@@ -606,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);
 
@@ -650,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);
 
@@ -681,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);
 
@@ -856,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);
 
@@ -877,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);
 
@@ -898,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);
 
@@ -916,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');
@@ -942,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);
 
@@ -973,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);
 
@@ -1221,6 +1222,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
   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');