Webtests fix-4.5
authorWeb Access <rohan.katkar@webaccessglobal.com>
Tue, 13 Jan 2015 11:14:49 +0000 (16:44 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Tue, 13 Jan 2015 11:14:49 +0000 (16:44 +0530)
tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php
tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php
tests/phpunit/WebTest/Event/AddPricesetTest.php
tests/phpunit/WebTest/Event/MultiprofileEventTest.php
tests/phpunit/WebTest/Export/ContactTest.php
tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php
tests/phpunit/WebTest/Report/LoggingReportTest.php

index 0694cf14b0553a3b7937407ebff9715cdca1529c..ca28f5f9cbf6b793f6e065ed1d10d0b34ad3f6f5 100644 (file)
@@ -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() {
index 55d88df4b01c03fe1d0fe457ca22135187bf3756..c7980659ae31a9162633faee5b388e608e3dd9a3 100644 (file)
@@ -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';
index c958539a756b8e81f85981e5ea812d4c783399b8..6182d763fe47b1896c7617aa007f65e6c941ea4d 100644 (file)
@@ -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);
 
index 75c892821a725237566c7f604ef754632cc48b87..831d44b0be6ca3365692507e1a867e0aa92e6719 100644 (file)
@@ -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");
 
index a385ee5cc80fd918977966352dccc37766b2aa0f..1389b2d6dc1c43ddfb3d1de1570639e43e1de4cb 100644 (file)
@@ -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');
index c4e56352ccb75a987bb5ab312d58fe98e3944de3..51eaad27fdf1b693e45604d47e0101664107c1e8 100644 (file)
@@ -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');
 
index 5ce5c1938bb68ddccb5d515e0be5261e386f07b8..75dd98d717b948739ea3e295fcf91d77f915b5f2 100644 (file)
@@ -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());