From: kurund Date: Mon, 12 Aug 2013 12:10:39 +0000 (+0530) Subject: fixed setting of soft credit for WebTest_Campaign_OfflineContributionTest X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=038dc0e3861543d7fa21916815005decd506128d;p=civicrm-core.git fixed setting of soft credit for WebTest_Campaign_OfflineContributionTest --- diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 31a9f12694..108a931b01 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -360,13 +360,13 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** */ - function webtestFillAutocomplete($sortName) { - $this->click('contact_1'); - $this->type('contact_1', $sortName); - $this->typeKeys('contact_1', $sortName); + function webtestFillAutocomplete($sortName, $fieldName = 'contact_1') { + $this->click($fieldName); + $this->type($fieldName, $sortName); + $this->typeKeys($fieldName, $sortName); $this->waitForElementPresent("css=div.ac_results-inner li"); $this->click("css=div.ac_results-inner li"); - $this->assertContains($sortName, $this->getValue('contact_1'), "autocomplete expected $sortName but didn’t find it in " . $this->getValue('contact_1')); + $this->assertContains($sortName, $this->getValue($fieldName), "autocomplete expected $sortName but didn’t find it in " . $this->getValue($fieldName)); } /** diff --git a/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php b/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php index ba68367564..310c591f0c 100644 --- a/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php @@ -168,10 +168,7 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { $this->type("trxn_id", "P20901X1" . rand(100, 10000)); // soft credit - $this->click("soft_credit_contact_1"); - $this->type("soft_credit_contact_1", $softCreditFname); - $this->typeKeys("soft_credit_contact_1", $softCreditFname); - $this->waitForElementPresent("soft_credit_amount_1"); + $this->webtestFillAutocomplete("{$softCreditLname}, {$softCreditFname}", 'soft_credit_contact_1'); //Additional Detail section $this->click("AdditionalDetail");