version fixes
[civicrm-core.git] / tests / phpunit / WebTest / Event / PricesetMaxCountTest.php
index decb54feec1838dfd02499f83fe62632516e88a7..8671a41eb7de19f095801bfa388fc832ed7f4006 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -211,11 +211,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // select sold option for select field, check for form rule
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
-    $this->click('_qf_Register_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp1}']", "(Sold out)");
 
     // fill correct available option for select field
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
@@ -410,12 +406,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for sold option for select field
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
-
-    $this->click('_qf_Register_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp1}']", "(Sold out)");
 
     // check for sold option for select field
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
@@ -620,12 +611,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Participant_2_next-Array');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, currently only 2 seats are available for this option.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // Skip participant3 and register
     $this->click('_qf_Participant_2_next_skip-Array');
@@ -664,12 +650,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select field
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Register_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // fill available value for select
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
@@ -695,12 +676,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select field
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Participant_1_next-Array');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // fill available value for select
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
@@ -912,12 +888,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Participant_2_next-Array');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // Skip participant3 and register
     $this->click('_qf_Participant_2_next_skip-Array');
@@ -956,12 +927,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select field
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Register_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // fill available value for select
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
@@ -987,12 +953,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select field
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Participant_1_next-Array');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // fill available value for select
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
@@ -1150,7 +1111,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     // Go to Fees tab
     $this->click('link=Fees');
     $this->waitForElementPresent('_qf_Fee_upload-bottom');
-    $this->click('xpath=//form[@id="Fee"]/div[2]/table/tbody/tr[2]/td[2]/label[contains(text(), "Yes")]');
+    $this->click('xpath=//form[@id="Fee"]//div/table/tbody//tr//td/label[contains(text(), "Yes")]');
     $processorName = $params['payment_processor'];
     $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']");
     $this->select('financial_type_id', 'value=4');
@@ -1180,8 +1141,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
       $this->click('is_multiple_registrations');
     }
 
-    $this->click('intro_text-plain');
-    $this->fillRichTextField('intro_text', 'Fill in all the fields below and click Continue.');
+    $this->fillRichTextField('intro_text', 'Fill in all the fields below and click Continue.', 'CKEditor', TRUE);
 
     // enable confirmation email
     $this->click('CIVICRM_QFID_1_is_email_confirm');