From 0e6f669d629f4d2129580495e9947702616c7bff Mon Sep 17 00:00:00 2001 From: monishdeb Date: Tue, 3 Sep 2013 14:34:17 +0530 Subject: [PATCH] Webtest Fixes --- tests/phpunit/CiviTest/CiviSeleniumTestCase.php | 1 + .../WebTest/Contribute/OfflineRecurContributionTest.php | 2 -- tests/phpunit/WebTest/Import/AddressParsingTest.php | 8 ++++---- .../WebTest/Member/DefaultMembershipPricesetTest.php | 3 +-- tests/phpunit/WebTest/Member/InheritedMembershipTest.php | 8 ++++---- tests/phpunit/WebTest/Report/LoggingReportTest.php | 5 +++-- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 9e7b20ff52..8ba2207d81 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -687,6 +687,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->type('billing_city-5', 'San Bernadino'); $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 f65c91dc9f..ba6dc754f2 100644 --- a/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php @@ -79,9 +79,7 @@ class WebTest_Contribute_OfflineRecurContributionTest extends CiviSeleniumTestCa // billing address $this->webtestAddBillingDetails($firstName, $middleName, $lastName); - $this->click('_qf_Contribution_upload-bottom'); - $this->waitForPageToLoad($this->getTimeoutMsec()); // Use Find Contributions to make sure test recurring contribution exists $this->openCiviPage("contribute/search", "reset=1", 'contribution_currency_type'); diff --git a/tests/phpunit/WebTest/Import/AddressParsingTest.php b/tests/phpunit/WebTest/Import/AddressParsingTest.php index 091a783b7b..fcd98ae5e0 100644 --- a/tests/phpunit/WebTest/Import/AddressParsingTest.php +++ b/tests/phpunit/WebTest/Import/AddressParsingTest.php @@ -188,8 +188,8 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase { 'email' => 'Email', 'phone' => 'Phone', 'street_address' => 'Street Address', - 'address_1' => 'Additional Address 1', - 'address_2' => 'Additional Address 2', + 'address_1' => 'Supplemental Address 1', + 'address_2' => 'Supplemental Address 2', 'city' => 'City', 'state' => 'State', 'country' => 'Country', @@ -236,8 +236,8 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase { 'email' => 'Email', 'phone' => 'Phone', 'street_address' => 'Street Address', - 'address_1' => 'Additional Address 1', - 'address_2' => 'Additional Address 2', + 'address_1' => 'Supplemental Address 1', + 'address_2' => 'Supplemental Address 2', 'city' => 'City', 'state' => 'State', 'country' => 'Country', diff --git a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php index f02890cbbe..8b78ddb0ba 100755 --- a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php +++ b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php @@ -116,8 +116,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase $this->_testDefaultSenarios("National_Membership_{$title}-section", 1); $this->contactInfoFill($firstName, $lastName, $email, $contactParams, $streetAddress); - $this->clickLink("_qf_Main_upload-bottom", "_qf_Main_upload-bottom"); - $this->assertTrue($this->isTextPresent("You already have a lifetime membership and cannot select a membership with a shorter term.")); + $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom"); } function contactInfoFill($firstName, $lastName, $email, $contactParams, $streetAddress) { diff --git a/tests/phpunit/WebTest/Member/InheritedMembershipTest.php b/tests/phpunit/WebTest/Member/InheritedMembershipTest.php index 4c56d98b5c..4c4e0916ae 100644 --- a/tests/phpunit/WebTest/Member/InheritedMembershipTest.php +++ b/tests/phpunit/WebTest/Member/InheritedMembershipTest.php @@ -211,8 +211,8 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { $this->waitForElementPresent('css=div.action-link'); $this->click("//li[@id='tab_rel']/a"); - $this->waitForElementPresent("xpath=//div[@id='inactive-relationships']//div//table/tbody//tr/td[7]/span/a[text()='Edit']"); - $this->click("xpath=//div[@id='inactive-relationships']//div//table/tbody//tr/td[7]/span/a[text()='Edit']"); + $this->waitForElementPresent("xpath=//div[@id='inactive-relationships']//div//table/tbody//tr/td[9]/span/a[text()='Edit']"); + $this->click("xpath=//div[@id='inactive-relationships']//div//table/tbody//tr/td[9]/span/a[text()='Edit']"); $this->waitForElementPresent('is_active'); if (!$this->isChecked('is_active')) { $this->click('is_active'); @@ -250,8 +250,8 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { $this->click('css=li#tab_rel a'); $this->waitForElementPresent('css=div.action-link'); - $this->waitForElementPresent("xpath=//div[@id='inactive-relationships']//div//table/tbody//tr/td[7]/span[2][text()='more']/ul/li[1]/a[text()='Enable']"); - $this->click("xpath=//div[@id='inactive-relationships']//div//table/tbody//tr/td[7]/span[2][text()='more']/ul/li[1]/a[text()='Enable']"); + $this->waitForElementPresent("xpath=//div[@id='inactive-relationships']//div//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Enable']"); + $this->click("xpath=//div[@id='inactive-relationships']//div//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Enable']"); $this->assertTrue((bool)preg_match("/^Are you sure you want to re-enable this relationship?[\s\S]$/", $this->getConfirmation() diff --git a/tests/phpunit/WebTest/Report/LoggingReportTest.php b/tests/phpunit/WebTest/Report/LoggingReportTest.php index 485d85ef6b..ca035f3297 100644 --- a/tests/phpunit/WebTest/Report/LoggingReportTest.php +++ b/tests/phpunit/WebTest/Report/LoggingReportTest.php @@ -153,8 +153,9 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { $this->select("other_activity", "label=Interview"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->click('_qf_Activity_upload-bottom'); - $this->waitForElementPresent("xpath=//table[@id='contact-activity-selector-activity']/tbody/tr/td[9]/span/a[2]"); - $this->click("xpath=//table[@id='contact-activity-selector-activity']/tbody/tr/td[9]/span/a[2]"); + $this->waitForElementPresent("xpath=//table[@id='contact-activity-selector-activity']/tbody/tr/td[8]/span/a[2]"); + sleep(10); + $this->click("xpath=//table[@id='contact-activity-selector-activity']/tbody/tr/td[8]/span/a[2]"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->select("status_id","value=2"); $this->click('_qf_Activity_upload-bottom'); -- 2.25.1