X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FWebTest%2FEvent%2FPricesetMaxCountTest.php;h=38bbbf10f32007952c42b37fa27b5384abe6bfa6;hb=f41a7de74d7f30125ad93e4b80561ac17038c002;hp=26cfd4316af93fbc103412a9c8e73e164dd96f11;hpb=3e080337c1020aa181043fd344c471518b54587c;p=civicrm-core.git diff --git a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php index 26cfd4316a..38bbbf10f3 100644 --- a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php +++ b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php @@ -1,7 +1,7 @@ webtestLogin(); @@ -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,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(); @@ -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); @@ -425,7 +426,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { $this->_checkConfirmationAndRegister(); } - function testAdditionalParticipantWithoutFieldCount() { + public function testAdditionalParticipantWithoutFieldCount() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -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); @@ -710,7 +711,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { $this->_checkConfirmationAndRegister(); } - function testAdditionalParticipantWithFieldCount() { + public function testAdditionalParticipantWithFieldCount() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -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); @@ -1006,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 ...) @@ -1027,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'); @@ -1074,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++; @@ -1084,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']); @@ -1116,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']}"); @@ -1198,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'); @@ -1217,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');