From: Web Access Date: Tue, 13 Jan 2015 11:14:49 +0000 (+0530) Subject: Webtests fix-4.5 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1361cc61d99068075adc6b58e6fec7d9f24d83db;p=civicrm-core.git Webtests fix-4.5 --- diff --git a/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php b/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php index 0694cf14b0..ca28f5f9cb 100644 --- a/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php +++ b/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php @@ -70,15 +70,14 @@ class WebTest_Campaign_CampaignDescriptionTest extends CiviSeleniumTestCase { // click save $this->click("_qf_Campaign_upload-bottom"); - $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForText('crm-notification-container', "Campaign $title"); //Opening Edit Page of the created Campaign $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='{$campaignTitle}']/../td[13]/span/a[text()='Edit']"); - $this->clickLink("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='{$campaignTitle}']/../td[13]/span/a[text()='Edit']", "//textarea[@id='description']"); - $fetchedVaue = $this->getValue('description'); - $this->assertEquals($campaignDescription, $fetchedVaue); + $this->click("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='{$campaignTitle}']/../td[13]/span/a[text()='Edit']"); + $this->waitForAjaxContent(); + $this->assertTrue($this->isTextPresent($campaignDescription), 'Missing text: ' . $campaignDescription); } function testAjaxCustomGroupLoad() { diff --git a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php index 55d88df4b0..c7980659ae 100644 --- a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php +++ b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php @@ -137,7 +137,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { // verify if custom data is present $this->openCiviPage('case', 'reset=1'); - $this->clickLink("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$client['sort_name']}']/../../td[9]/span/a[text()='Manage']"); + $this->clickLink("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$client['sort_name']}']/../../td[9]/span/a[1][text()='Manage']"); $this->clickAjaxLink("css=#{$customGrp1} .crm-accordion-header", "css=#{$customGrp1} a.button"); $cusId_1 = 'custom_' . $customId[0] . '_1'; diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index c958539a75..6182d763fe 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -260,7 +260,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->click('link=Fees'); $this->waitForElementPresent('_qf_Fee_upload_done-bottom'); $this->click('CIVICRM_QFID_1_is_monetary'); - $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']"); + $this->click("xpath=//tbale[@id='paymentProcessor']/tbody/tr[1]/td[2]/label[text()='$processorName']"); $this->select('financial_type_id','label=Event Fee'); $this->select('price_set_id', 'label=' . $setTitle); diff --git a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php index 75c892821a..831d44b0be 100644 --- a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php +++ b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php @@ -324,10 +324,10 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { // Go to Online Contribution tab $this->click("link=Online Registration"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); - $this->click("xpath=//*[@id='additional_custom_post_id_multiple_1']/parent::td/span/a[text()='remove profile']"); - $this->click("xpath=//*[@id='additional_custom_post_id_multiple_2']/parent::td/span/a[text()='remove profile']"); - $this->click("xpath=//*[@id='additional_custom_post_id_multiple_3']/parent::td/span/a[text()='remove profile']"); - $this->click("xpath=//*[@id='additional_custom_post_id_multiple_4']/parent::td/span/a[text()='remove profile']"); + $this->click("xpath=//*[@id='additional_custom_post_id_multiple_1']/parent::td/span[1]/a"); + $this->click("xpath=//*[@id='additional_custom_post_id_multiple_2']/parent::td/span[1]/a"); + $this->click("xpath=//*[@id='additional_custom_post_id_multiple_3']/parent::td/span[1]/a"); + $this->click("xpath=//*[@id='additional_custom_post_id_multiple_4']/parent::td/span[1]/a"); $this->click("_qf_Registration_upload-bottom"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); } @@ -710,7 +710,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->type("city-Primary", "primecity"); $this->type("phone-Primary-1", "98667764"); $this->type("postal_code-Primary", "6548"); - + $this->waitForElementPresent('nick_name'); $this->type("nick_name", "Nick1"); $this->type("url-1", "http://www.part.com"); diff --git a/tests/phpunit/WebTest/Export/ContactTest.php b/tests/phpunit/WebTest/Export/ContactTest.php index a385ee5cc8..1389b2d6dc 100644 --- a/tests/phpunit/WebTest/Export/ContactTest.php +++ b/tests/phpunit/WebTest/Export/ContactTest.php @@ -120,16 +120,6 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { // All other rows to be check. $checkRows = array( 1 => array( - 'First Name' => $firstContactName, - 'Last Name' => 'Smith', - 'Email' => ''.strtolower($emailContactFirst).'', - 'Sort Name' => $sortFirstName, - 'Display Name' => $prefixLabelContactFrst.' '.$displayFirstName.' '.$suffixLabelContactFrst, - 'Individual Prefix' => $prefixLabelContactFrst, - 'Individual Suffix' => $suffixLabelContactFrst, - 'Gender' => $genderLabelContactFrst, - ), - 2 => array( 'First Name' => $secondContactName, 'Last Name' => 'John', 'Email' => ''.strtolower($emailContactSecond).'', @@ -139,6 +129,16 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { 'Individual Suffix' => $suffixLabelContactScnd, 'Gender' => $genderLabelContactScnd, ), + 2 => array( + 'First Name' => $firstContactName, + 'Last Name' => 'Smith', + 'Email' => '' . strtolower($emailContactFirst) . '', + 'Sort Name' => $sortFirstName, + 'Display Name' => $prefixLabelContactFrst . ' ' . $displayFirstName . ' ' . $suffixLabelContactFrst, + 'Individual Prefix' => $prefixLabelContactFrst, + 'Individual Suffix' => $suffixLabelContactFrst, + 'Gender' => $genderLabelContactFrst, + ), ); // Read CSV and fire assertions. @@ -239,19 +239,19 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { // All other rows to be check. $checkRows = array( 1 => array( - 'First Name' => $firstName, - 'Last Name' => 'Smith', - 'Email' => "$firstName.smith@example.org", - 'Sort Name' => $sortName, - 'Display Name' => $displayName, - ), - 2 => array( 'First Name' => $childName, 'Last Name' => 'John', 'Email' => "$childName.john@example.org", 'Sort Name' => $childSortName, 'Display Name' => $childDisplayName, ), + 2 => array( + 'First Name' => $firstName, + 'Last Name' => 'Smith', + 'Email' => "$firstName.smith@example.org", + 'Sort Name' => $sortName, + 'Display Name' => $displayName, + ), ); // Read CSV and fire assertions. @@ -282,7 +282,7 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { $this->type("address_1_street_address", "121A Sherman St. Apt. 12"); $this->type("address_1_city", "Dumfries"); $this->type("address_1_postal_code", "1234"); - $this->assertElementContainsText('address_table_1', "- select - United States"); + $this->select("address_1_country_id", "United States"); $this->select("address_1_state_province_id", "value=1019"); $this->click('_qf_Contact_upload_view'); diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php index c4e56352cc..51eaad27fd 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php @@ -97,10 +97,10 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { // page was loaded $this->waitForTextPresent($sourceText); - $this->waitForElementPresent("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[1]/a[text()='View']"); // click through to the membership view screen - $this->click("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span/a[text()='View']"); + $this->click("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[1]/a[text()='View']"); $this->waitForElementPresent('_qf_MembershipView_cancel-bottom'); @@ -186,10 +186,10 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { // Is status message correct? $this->waitForText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added."); - $this->waitForElementPresent("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']"); + $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Renew']"); // click through to the Membership Renewal Link - $this->click("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']"); + $this->click("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Renew']"); $this->waitForElementPresent('_qf_MembershipRenewal_cancel-bottom'); diff --git a/tests/phpunit/WebTest/Report/LoggingReportTest.php b/tests/phpunit/WebTest/Report/LoggingReportTest.php index 5ce5c1938b..75dd98d717 100644 --- a/tests/phpunit/WebTest/Report/LoggingReportTest.php +++ b/tests/phpunit/WebTest/Report/LoggingReportTest.php @@ -177,6 +177,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { //visit the logging contact summary report $this->openCiviPage('report/logging/contact/summary', 'reset=1'); + $this->waitForElementPresent('altered_contact_value'); $this->type('altered_contact_value', $firstName); $this->click("_qf_LoggingSummary_submit"); $this->waitForPageToLoad($this->getTimeoutMsec());