From: monishdeb Date: Sat, 14 Mar 2015 13:30:19 +0000 (+0530) Subject: 4.6 Webtest fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3e5213ad3d27d4f3d47328d9f4a817e08e7389d5;p=civicrm-core.git 4.6 Webtest fixes --- diff --git a/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php b/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php index 5510012eaa..de4ef6a4de 100644 --- a/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php +++ b/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php @@ -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); diff --git a/tests/phpunit/WebTest/Contribute/AddBatchesTest.php b/tests/phpunit/WebTest/Contribute/AddBatchesTest.php index 75c59379c4..654854a9b8 100644 --- a/tests/phpunit/WebTest/Contribute/AddBatchesTest.php +++ b/tests/phpunit/WebTest/Contribute/AddBatchesTest.php @@ -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"); diff --git a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php index 69fb43d475..5f11fb5056 100644 --- a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php @@ -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'], ); diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index 0f18e4a5a9..20861695ae 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -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']"); } }