From ff7319de4c65714eded032aaffc26ad37e938a57 Mon Sep 17 00:00:00 2001 From: atif-shaikh Date: Fri, 9 May 2014 18:27:52 +0530 Subject: [PATCH] WebTestFix --- tests/phpunit/CiviTest/CiviSeleniumTestCase.php | 2 +- .../WebTest/Contribute/OfflineRecurContributionTest.php | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 007eb22da4..1a4c13c793 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -691,9 +691,9 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->type('billing_street_address-5', '234 Lincoln Ave'); $this->type('billing_city-5', 'San Bernadino'); + $this->select('billing_country_id-5', 'value=1228'); $this->click('billing_state_province_id-5'); $this->select('billing_state_province_id-5', 'label=California'); - $this->select('billing_country_id-5', 'value=1228'); $this->type('billing_postal_code-5', '93245'); return array($firstName, $middleName, $lastName); diff --git a/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php b/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php index 2177080a55..f1454f1d9b 100644 --- a/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php @@ -48,11 +48,8 @@ class WebTest_Contribute_OfflineRecurContributionTest extends CiviSeleniumTestCa $this->click('css=li#tab_contribute a'); $this->waitForElementPresent('link=Submit Credit Card Contribution'); - $this->click('link=Submit Credit Card Contribution'); - $this->waitForPageToLoad($this->getTimeoutMsec()); - // since we don't have live credentials we will switch to test mode - $url = $this->getLocation(); + $url = $this->getAttribute("xpath=//*[@id='Search']//a[text()='Submit Credit Card Contribution']@href"); $url = str_replace('mode=live', 'mode=test', $url); $this->open($url); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -80,7 +77,8 @@ class WebTest_Contribute_OfflineRecurContributionTest extends CiviSeleniumTestCa // billing address $this->webtestAddBillingDetails($firstName, $middleName, $lastName); $this->click('_qf_Contribution_upload-bottom'); - + $this->waitForElementPresent('link=Edit'); + $this->waitForText('crm-notification-container', "The contribution record has been processed."); // Use Find Contributions to make sure test recurring contribution exists $this->openCiviPage("contribute/search", "reset=1", 'contribution_currency_type'); -- 2.25.1