Merge pull request #7578 from seamuslee001/CRM-17802-master
[civicrm-core.git] / tests / phpunit / WebTest / Event / ParticipantCountTest.php
index 3b9a17de1e225c893ef5c99d0056bb9fc313236f..da22922aeccdf37ba185113385a3358d9a8a13b5 100644 (file)
@@ -219,7 +219,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
     $this->click('link=Register Now');
     $this->waitForElementPresent('_qf_Register_upload-bottom');
 
-    $this->type("xpath=//input[@class='four crm-form-text required']", '1');
+    $this->type("xpath=//div[@id='priceset']/div[@class='crm-section full_conference-section']//div/input[@class='four crm-form-text required']", '1');
 
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $participants[1] = array(
@@ -253,8 +253,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
     // register for event
     $this->click('link=Register Now');
     $this->waitForElementPresent('_qf_Register_upload-bottom');
-
-    $this->type("xpath=//input[@class='four crm-form-text required']", '2');
+    $this->type("xpath=//div[@id='priceset']/div[@class='crm-section full_conference-section']//div/input[@class='four crm-form-text required']", '2');
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
 
     $participants[2] = array(
@@ -286,11 +285,13 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
 
     // Find Participant
     $this->openCiviPage('event/search', 'reset=1', 'participant_fee_amount_low');
+    $this->waitForElementPresent('event_id');
     $this->select2("event_id", $eventTitle);
     $this->click('_qf_Search_refresh');
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // verify number of participants records and total participant count
+    $this->waitForAjaxContent();
     $this->assertStringsPresent(array('2 Results', 'Actual participant count : 24'));
 
     // CRM-7953, check custom search Price Set Details for Event
@@ -306,9 +307,11 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
     $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom');
 
     // Enter Priceset fields (Title, Used For ...)
+    $this->waitForElementPresent("title");
     $this->type('title', $setTitle);
     $this->check('extends[1]');
     $this->select("css=select.crm-form-select", "label={$financialType}");
+    $this->waitForElementPresent("help_pre");
     $this->type('help_pre', 'This is test priceset.');
 
     $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
@@ -429,7 +432,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
     $this->select('billing_state_province_id-5', 'value=1004');
     $this->type('billing_postal_code-5', '94129');
 
-    $this->clickLink('_qf_Register_upload-bottom', '_qf_Confirm_next-bottom');
+    $this->clickLink('_qf_Register_upload-bottom', '_qf_Confirm_next-bottom', FALSE);
     $confirmStrings = array('Event Fee(s)', 'Billing Name and Address', 'Credit Card Information');
     $this->assertStringsPresent($confirmStrings);
     $this->click('_qf_Confirm_next-bottom');