webtest fixes 4.6
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 2 Mar 2015 13:13:04 +0000 (18:43 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 2 Mar 2015 13:13:04 +0000 (18:43 +0530)
tests/phpunit/WebTest/Contact/AdvancedSearchTest.php
tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php
tests/phpunit/WebTest/Mailing/AddNewMailingComponentTest.php
tests/phpunit/WebTest/Profile/SearchTest.php

index bc13161b1e381e404d1b1dc92c27b68179d7bba0..2df1dacd671022ae3b681dde125f3559272e7896 100644 (file)
@@ -126,7 +126,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
       'location' => array('state_province', 'addAddressSearchDetail'),
       'demographics' => array('civicrm_gender_Transgender_3', 'addDemographicSearchDetail'),
       'notes' => array('note', ''),
-      'activity' => array('activity_status[5]', 'addActivitySearchDetail'),
+      'activity' => array('activity_type_id', 'addActivitySearchDetail'),
       'CiviContribute' => array('contribution_currency_type', 'addContributionSearchDetail'),
       'CiviEvent' => array('participant_fee_amount_high', 'addParticipantSearchDetail'),
       'CiviMember' => array('member_end_date_high', 'addMemberSearchDetail'),
@@ -178,7 +178,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
     $this->webtestLogin();
     $this->openCiviPage('contact/search/advanced', 'reset=1');
     $this->clickAjaxLink("activity", 'activity_subject');
-    $this->check("xpath=//div[@id='Activity']//div/label[text()='Tell a Friend']/../input");
+    $this->multiselect2("activity_type_id", array('Tell a Friend'));
     $this->clickLink("_qf_Advanced_refresh");
     $count = explode(" ", trim($this->getText("xpath=//div[@id='search-status']/table/tbody/tr/td")));
     $count = $count[0];
@@ -311,20 +311,16 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
    * @param $firstName
    */
   public function addActivitySearchDetail($firstName) {
-    // check activity types
-    $checkActivityTypes = array("Contribution", "Event Registration", "Membership Signup");
-    foreach ($checkActivityTypes as $labels) {
-      $this->click("xpath=//div[@id='activity']/table/tbody/tr[2]/td[1]/div[1]//div/label[text()=\"$labels\"]");
-    }
+    // select activity types
+    $activityTypes = array("Contribution", "Event Registration", "Membership Signup");
+    $this->multiselect2('activity_type_id', $activityTypes);
     // fill date range
     $this->select("activity_date_relative", "value=0");
     $this->webtestFillDate("activity_date_low", "-1 day");
     $this->webtestFillDate("activity_date_high", "+1 day");
     $this->type("activity_subject", "Student - membership source$firstName - Status: New");
     // fill activity status
-
-    $this->click("xpath=//div[@id='activity']/table/tbody//tr/td[2]/label[text()='Activity Status']/../label[text()='Scheduled']");
-    $this->click("xpath=//div[@id='activity']/table/tbody//tr/td[2]/label[text()='Activity Status']/../label[text()='Completed']");
+    $this->multiselect2('status_id', array('Scheduled', 'Completed'));
   }
 
   /**
@@ -357,16 +353,16 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
     $this->type("contribution_amount_low", "1");
     $this->type("contribution_amount_high", "200");
     // check for completed
-    $this->check("contribution_status_id[1]");
+    $this->multiselect2("contribution_status_id", array('Completed'));
     // enter check number
-    $this->select("contribution_payment_instrument_id", "Check");
+    $this->select2("payment_instrument_id", "Check");
     $this->type("contribution_check_number", "chqNo$firstName");
     // fill transaction id
-    $this->type("contribution_transaction_id", "trid$firstName");
+    $this->type("contribution_trxn_id", "trid$firstName");
     // fill financial type
     $this->select("financial_type_id", "Event Fee");
     // fill currency type
-    $this->select("contribution_currency_type", "USD");
+    $this->select2("contribution_currency_type", "USD");
   }
 
   /**
index 324064c3cdc6352974bbd6eb795630ff5151a252..d079088697a5a1381d22817fe36a84a7ba14cc63 100644 (file)
@@ -250,7 +250,7 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
         ),
         'demographics' => array(
           'headerLocator' => 'div#demographics',
-          'bodyLocator' => 'input#birth_date_low_display',
+          'bodyLocator' => 'input#birth_date_low',
           'title' => 'Demographics',
           'fields' => array(
             'Deceased Dates' => array(
index b6fcad983f89732e858b2ce00f2e60ed40276461..0f3185474fad00304db87a7715890200baac78a3 100644 (file)
@@ -69,7 +69,7 @@ class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase {
     $this->waitForText('crm-notification-container', "The mailing component '$componentName' has been saved.");
 
     // Verify text.
-    $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Header']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details");
+    $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td/div[text()='{$componentName}']/../../td[2][text()='Header']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details");
   }
 
   public function testFooterAdd() {
@@ -106,7 +106,7 @@ class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase {
     $this->waitForText('crm-notification-container', "The mailing component '$componentName' has been saved.");
 
     // Verify text.
-    $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Footer']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details");
+    $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td/div[text()='{$componentName}']/../../td[2][text()='Footer']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details");
   }
 
   public function testAutomatedAdd() {
@@ -143,7 +143,7 @@ class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase {
     $this->waitForText('crm-notification-container', "The mailing component '$componentName' has been saved.");
 
     // Verify text
-    $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Reply']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details");
+    $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td/div[text()='{$componentName}']/../../td[2][text()='Reply']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details");
   }
 
 }
index b2ce780111712597b0389f7a18f89e2972e3708c..860b7b54f9563d84f9bcc9b302d40e524942d8ef 100644 (file)
@@ -58,7 +58,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     //click on save
     $this->click('_qf_Group_next-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//a/span[text()='Add Field']");
+    $this->waitForElementPresent("_qf_Field_next-bottom");
 
     //check for  profile create
     $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
@@ -160,7 +160,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     $this->click('in_selector');
 
     // click on save
-    $this->clickLink('_qf_Field_next-bottom', "xpath=//div[@id='field_page']/div[1]/a[4]/span[text()='Use (create mode)']", FALSE);
+    $this->clickLink('_qf_Field_next-bottom', "xpath=//div[@id='field_page']/div[1]/a[4]/span[text()=' Use (create mode)']", FALSE);
 
     $uselink = explode('?', $this->getAttribute("xpath=//*[@id='field_page']/div[1]/a[4]@href"));
     $this->openCiviPage('profile/create', "$uselink[1]", '_qf_Edit_next');