From 038dc0e3861543d7fa21916815005decd506128d Mon Sep 17 00:00:00 2001 From: kurund Date: Mon, 12 Aug 2013 17:40:39 +0530 Subject: [PATCH] fixed setting of soft credit for WebTest_Campaign_OfflineContributionTest --- tests/phpunit/CiviTest/CiviSeleniumTestCase.php | 10 +++++----- .../WebTest/Campaign/OfflineContributionTest.php | 5 +---- 2 files changed, 6 insertions(+), 9 deletions(-) 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"); -- 2.25.1