4.6 Webtest fixes
authormonishdeb <monish.deb@webaccessglobal.com>
Sat, 14 Mar 2015 13:30:19 +0000 (19:00 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Mon, 16 Mar 2015 16:24:49 +0000 (21:54 +0530)
tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php
tests/phpunit/WebTest/Contribute/AddBatchesTest.php
tests/phpunit/WebTest/Contribute/AddPricesetTest.php
tests/phpunit/WebTest/Event/AddEventTest.php

index 5510012eaa7bd873894f49123b3bbc3d41c7a9de..de4ef6a4de5f325e8bea73613353decb98901ebd 100644 (file)
@@ -47,7 +47,7 @@ class WebTest_Contact_InlineFieldsEditTest extends CiviSeleniumTestCase {
 
     // Set Communication Prefs
     $this->inlineEdit('crm-communication-pref-content', array(
-      'css=#email_greeting_display a' => TRUE,
+      'email_greeting_id' => TRUE,
       'privacy_do_not_email' => 1,
       'preferred_communication_method_1' => 1,
       'preferred_communication_method_2' => 1,
@@ -312,7 +312,7 @@ class WebTest_Contact_InlineFieldsEditTest extends CiviSeleniumTestCase {
             case 'string':
               if ($val && substr($val, 0, 5) == 'date:') {
                 $val = date('m/d/Y', strtotime(trim(substr($val, 5))));
-                $item .= '_display';
+                $item = "xpath=//input[starts-with(@id, '{$item}_display_')]";
               }
               if ($val) {
                 $this->assertElementValueEquals($item, $val);
index 75c59379c4f24cd72c657d0caf93b130a2fbd994..654854a9b81f02e31557754c2cb06862c7138c97 100644 (file)
@@ -134,7 +134,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("_qf_Batch_next");
     $this->click("title");
     $this->type("title", $batchTitle);
-    $this->select("type_id", "Pledge");
+    $this->select("type_id", "Pledge Payment");
     $this->type("item_count", $itemCount);
     $this->type("total", 200);
     $this->click("_qf_Batch_next");
index 69fb43d475bcd7c3df19793c5d92684147fcba21..5f11fb50562361c44497438a65593e6ca70a8d5f 100644 (file)
@@ -703,7 +703,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
       'Financial Type' => $fields['values'][$fields['id']]['financial_type'],
       'Contribution Amount' => $fields['values'][$fields['id']]['total_amount'],
       'Contribution Status' => $fields['values'][$fields['id']]['contribution_status'],
-      'Paid By' => $fields['values'][$fields['id']]['contribution_payment_instrument'],
+      'Paid By' => $fields['values'][$fields['id']]['payment_instrument'],
       'Check Number' => $fields['values'][$fields['id']]['contribution_check_number'],
     );
 
index 0f18e4a5a9e71a3fffe0433c61b9b0fc931f4297..20861695aefc710df11635b9e0aac4abe50d0f39 100644 (file)
@@ -877,12 +877,11 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'";
 
     //Participant Status
     $this->openCiviPage("admin/participant_status", "reset=1&action=browse");
-    $this->_testEnableParticipantStatuses('Awaiting approval');
-    $this->isElementPresent("xpath=//td[@class='crm-particpant-label'][contains(text(), 'Awaiting approval')]/../td[9]/span/a[2][text()='Disable']");
-    $this->_testEnableParticipantStatuses('Pending from approval');
-    $this->isElementPresent("xpath=//td[@class='crm-particpant-label'][contains(text(), 'Pending from approval')]/../td[9]/span/a[2][text()='Disable']");
-    $this->_testEnableParticipantStatuses('Rejected');
-    $this->isElementPresent("xpath=//td[@class='crm-particpant-label'][contains(text(), 'Rejected')]/../td[9]/span/a[2][text()='Disable']");
+    foreach (array('Awaiting approval', 'Pending from approval', 'Rejected') as $label) {
+      $status = $this->webtest_civicrm_api("ParticipantStatusType", "getsingle", array('label' => $label));
+      $this->_testEnableParticipantStatuses($status['id']);
+      $this->isElementPresent("xpath=//tr[@id='participant_status_type-{$status['id']}']/td[9]/span/a[2][text()='Disable']");
+    }
 
     //Create New Event
 
@@ -967,11 +966,11 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'";
   /**
    * @param $status
    */
-  public function _testEnableParticipantStatuses($status) {
+  public function _testEnableParticipantStatuses($statusId) {
     // enable participant status
-    if ($this->isElementPresent("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']")) {
-      $this->click("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']");
-      $this->waitForElementPresent("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Disable']");
+    if ($this->isElementPresent("xpath=//tr[@id='participant_status_type-{$statusId}']/td[9]/span/a[2][text()='Enable']")) {
+      $this->click("xpath=//tr[@id='participant_status_type-{$statusId}']/td[9]/span/a[2][text()='Enable']");
+      $this->waitForElementPresent("xpath=//tr[@id='participant_status_type-{$statusId}']/td[9]/span/a[2][text()='Disable']");
     }
   }