Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2014-12-16-01-08-03
[civicrm-core.git] / tests / phpunit / WebTest / Contact / ProfileChecksumTest.php
index 89b97ba0dc38d1a7cb82ac55e4ca499130540c63..2c661451abbecbe1baf12c37d8d7fb6fe477788a 100644 (file)
@@ -70,16 +70,6 @@ class WebTest_Contact_ProfileChecksumTest extends CiviSeleniumTestCase {
         'update_value' => substr(sha1(rand()), 0, 7),
         'element_name' => 'city-Primary',
       ),
-      'state_province' => array(
-        'type' => 'Contact',
-        'label' => 'State',
-        'location' => 0,
-        'default_value' => '1004',
-        'update_value' => '1031',
-        'update_value_label' => 'NY',
-        'element_name' => 'state_province-Primary',
-        'html_type' => 'select',
-      ),
       'country' => array(
         'type' => 'Contact',
         'label' => 'Country',
@@ -90,6 +80,16 @@ class WebTest_Contact_ProfileChecksumTest extends CiviSeleniumTestCase {
         'element_name' => 'country-Primary',
         'html_type' => 'select',
       ),
+      'state_province' => array(
+        'type' => 'Contact',
+        'label' => 'State',
+        'location' => 0,
+        'default_value' => '1004',
+        'update_value' => '1031',
+        'update_value_label' => 'NY',
+        'element_name' => 'state_province-Primary',
+        'html_type' => 'select',
+      ),
     );
 
     // Create a contact.
@@ -120,6 +120,7 @@ class WebTest_Contact_ProfileChecksumTest extends CiviSeleniumTestCase {
     foreach ($fields as $field) {
       $this->assertTrue($this->isElementPresent($field['element_name']), "Missing Field: {$field['label']}.");
       if (isset($field['html_type']) && $field['html_type'] == 'select') {
+        $this->waitForVisible($field['element_name']);
         $this->select($field['element_name'], "value={$field['update_value']}");
       }
       else {
@@ -143,7 +144,7 @@ class WebTest_Contact_ProfileChecksumTest extends CiviSeleniumTestCase {
 
   /**
    * @param $fields
-   * @param $profileName
+   * @param string $profileName
    *
    * @return null
    */