Merge pull request #4878 from pratikshad/broken-webtest
authorMonish Deb <monish.deb@webaccessglobal.com>
Thu, 8 Jan 2015 18:20:51 +0000 (23:50 +0530)
committerMonish Deb <monish.deb@webaccessglobal.com>
Thu, 8 Jan 2015 18:20:51 +0000 (23:50 +0530)
Fixed webtest of export and testAdvanceSearch of Contact_AdavanceSearchT...

20 files changed:
bower.json
js/angular-crmMailing/directives.js
js/angular-crmMailing/services.js
partials/crmMailing/edit-unified.html
partials/crmMailingAB/report.html
tests/phpunit/WebTest/Contact/CustomDataAddTest.php
tests/phpunit/WebTest/Contact/MergeContactsTest.php
tests/phpunit/WebTest/Contact/TagAddTest.php
tests/phpunit/WebTest/Contact/TagSetSearchTest.php
tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php
tests/phpunit/WebTest/Contribute/OfflineContributionTest.php
tests/phpunit/WebTest/Event/AddPricesetTest.php
tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php
tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php
tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php
tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php
tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php
tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php
tests/phpunit/WebTest/Profile/ProfileAddTest.php
tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php

index 7c3de3f9921b5447241f6b071875b7124ab581ba..3ebee2fc3ca5ddd57f5f0a35dca3a1a2e6d818bf 100644 (file)
@@ -7,7 +7,7 @@
   "dependencies": {
     "angular": "~1.3.8",
     "angular-file-upload": "~1.1.5",
-    "angular-jquery-dialog-service": "totten/angular-jquery-dialog-service#jquery-closure",
+    "angular-jquery-dialog-service": "totten/angular-jquery-dialog-service#civicrm",
     "angular-mocks": "~1.3.8",
     "angular-route": "~1.3.8",
     "angular-ui-sortable": "0.12.x",
index bb1104f4c80b00941917e15de664df5ccbf3ced8..e88589d70ed16fcf6628a4f7e21c5bceb9439572 100644 (file)
             return date;
           }
           var p = date.split(/[\- :]/);
-          return new Date(p[0], p[1], p[2], p[3], p[4], p[5]);
+          return new Date(parseInt(p[0]), parseInt(p[1])-1, parseInt(p[2]), parseInt(p[3]), parseInt(p[4]), parseInt(p[5]));
         };
 
         /// Remove {value} from {array}
index 08681ed1100235af4d87d61ab48655dee93d8fd5..65f1ad529779319eb8786ea043ce32fde4655ec9 100644 (file)
@@ -1,6 +1,6 @@
 (function (angular, $, _) {
   var partialUrl = function (relPath) {
-    return CRM.resourceUrls['civicrm'] + '/partials/crmMailing/' + relPath;
+    return CRM.resourceUrls.civicrm + '/partials/crmMailing/' + relPath;
   };
 
   // The representation of from/reply-to addresses is inconsistent in the mailing data-model,
@@ -8,7 +8,7 @@
   // the available "From:" addrs. Records are like the underlying OptionValues -- but add "email"
   // and "author".
   angular.module('crmMailing').factory('crmFromAddresses', function ($q, crmApi) {
-    var emailRegex = /^"(.*)" \<([^@\>]*@[^@\>]*)\>$/;
+    var emailRegex = /^"(.*)" <([^@>]*@[^@>]*)>$/;
     var addrs = _.map(CRM.crmMailing.fromAddress, function (addr) {
       var match = emailRegex.exec(addr.label);
       return angular.extend({}, addr, {
@@ -18,7 +18,7 @@
     });
 
     function first(array) {
-      return (array.length == 0) ? null : array[0];
+      return (array.length === 0) ? null : array[0];
     }
 
     return {
       create: function create() {
         return {
           jobs: {}, // {jobId: JobRecord}
-          name: "revert this", // fixme
+          name: "",
           campaign_id: null,
           from_name: crmFromAddresses.getDefault().author,
           from_email: crmFromAddresses.getDefault().email,
           replyto_email: "",
-          subject: "For {contact.display_name}", // fixme
-          groups: {include: [2], exclude: [4]}, // fixme
+          subject: "",
+          groups: {include: [], exclude: []},
           mailings: {include: [], exclude: []},
-          body_html: "<b>Hello</b> {contact.display_name}", // fixme
-          body_text: "Hello {contact.display_name}", // fixme
+          body_html: "",
+          body_text: "",
           footer_id: null, // pickDefaultMailComponent('Footer'),
           header_id: null, // pickDefaultMailComponent('Header'),
           visibility: "Public Pages",
         // To get list of recipients, we tentatively save the mailing and
         // get the resulting recipients -- then rollback any changes.
         var params = angular.extend({}, mailing, {
+          name: 'placeholder', // for previewing recipients on new, incomplete mailing
+          subject: 'placeholder', // for previewing recipients on new, incomplete mailing
           options: {force_rollback: 1},
           'api.mailing_job.create': 1, // note: exact match to API default
           'api.MailingRecipients.get': {
index eed1b3011f68cbdeb24064ea553072a6b193c3c0..7a1ba07d44f49a9c85bcb4a927777fdeafd17a21 100644 (file)
     <div crm-mailing-block-summary crm-mailing="mailing"/>
     <div crm-mailing-block-mailing crm-mailing="mailing"/>
 
-    <div crm-ui-accordion crm-title="ts('HTML')">
-      <div crm-mailing-body-html crm-mailing="mailing"/>
-    </div>
-    <div crm-ui-accordion crm-title="ts('Plain Text')" crm-collapsed='true'>
-      <div crm-mailing-body-text crm-mailing="mailing"/>
-    </div>
-
     <div crm-ui-tab-set>
-      <div crm-ui-tab id="tab-schedule" crm-title="ts('Schedule')">
-        <div crm-mailing-block-schedule crm-mailing="mailing"/>
+      <div crm-ui-tab id="tab-html" crm-title="ts('HTML')">
+        <div crm-mailing-body-html crm-mailing="mailing"/>
+      </div>
+      <div crm-ui-tab id="tab-text" crm-title="ts('Plain Text')">
+        <div crm-mailing-body-text crm-mailing="mailing"/>
       </div>
       <div crm-ui-tab id="tab-attachment" crm-title="ts('Attachments')">
         <div crm-attachments="attachments"/>
       <div crm-mailing-block-preview crm-mailing="mailing" on-preview="previewMailing(mailing, preview.mode)" on-send="sendTest(mailing, attachments, preview.recipient)" />
     </div>
 
+    <div crm-ui-accordion crm-title="ts('Schedule')">
+      <div crm-mailing-block-schedule crm-mailing="mailing"/>
+    </div>
+
     <button ng-click="submit()">{{ts('Submit Mailing')}}</button>
     <button ng-click="save()">{{ts('Save Draft')}}</button>
     <button crm-confirm="{title:ts('Delete Draft?'), message:ts('Are you sure you want to delete the draft mailing?')}" on-yes="delete()">{{ts('Delete Draft')}}</button>
index b9d8ecb643e5d53f3284e049395e275919189a63..2b70a987a857ed3cff3052d9d2f11ac472df90a1 100644 (file)
       <td><a ng-click="previewMailing('c','text')" ng-show="abtest.mailings.c.body_text && abtest.ab.status == 'Final'">{{ts('View')}}</a></td>
     </tr>
     <tr>
-      <td>{{ts('Delivered')}}</td>
+      <td>{{ts('Deliveries')}}</td>
       <td>{{stats.a.Delivered}}</td>
       <td>{{stats.b.Delivered}}</td>
       <td ng-show="abtest.ab.status == 'Final'">{{stats.c.Delivered}}</td>
     </tr>
     <tr>
-      <td>{{ts('Bounces')}}</td>
-      <td>{{stats.a.Bounces}}</td>
-      <td>{{stats.b.Bounces}}</td>
-      <td ng-show="abtest.ab.status == 'Final'">{{stats.c.Bounces}}</td>
-    </tr>
-    <tr>
-      <td>{{ts('Unsubscribers')}}</td>
-      <td>{{stats.a.Unsubscribers}}</td>
-      <td>{{stats.b.Unsubscribers}}</td>
-      <td ng-show="abtest.ab.status == 'Final'">{{stats.c.Unsubscribers}}</td>
-    </tr>
-    <tr>
-      <td>{{'Opened'}}</td>
+      <td>{{ts('Opens')}}</td>
       <td>{{stats.a.Opened}}</td>
       <td>{{stats.b.Opened}}</td>
       <td ng-show="abtest.ab.status == 'Final'">{{stats.c.Opened}}</td>
       <td>{{stats.b['Unique Clicks']}}</td>
       <td ng-show="abtest.ab.status == 'Final'">{{stats.c['Unique Clicks']}}</td>
     </tr>
+    <tr>
+      <td>{{ts('Bounces')}}</td>
+      <td>{{stats.a.Bounces}}</td>
+      <td>{{stats.b.Bounces}}</td>
+      <td ng-show="abtest.ab.status == 'Final'">{{stats.c.Bounces}}</td>
+    </tr>
+    <tr>
+      <td>{{ts('Unsubscribes')}}</td>
+      <td>{{stats.a.Unsubscribers}}</td>
+      <td>{{stats.b.Unsubscribers}}</td>
+      <td ng-show="abtest.ab.status == 'Final'">{{stats.c.Unsubscribers}}</td>
+    </tr>
     <tr ng-show="abtest.ab.status == 'Testing'">
       <td></td>
       <td>
index 799e057c750deab5bdb99ac08496ac245f32d775..86420cf64d2a161f9d01356e0fc2d24c0efb4519 100644 (file)
@@ -205,7 +205,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase {
 
     //Get the customFieldsetID
     $this->openCiviPage('admin/custom/group', 'reset=1');
-    $customFieldsetId = explode('&gid=', $this->getAttribute("xpath=//div[@id='custom_group']//table/tbody//tr/td/span[text()='$customGroupTitle']/../../td[7]/span/a@href"));
+    $customFieldsetId = explode('&gid=', $this->getAttribute("xpath=//div[@id='custom_group']/table/tbody//tr/td/div[text()='$customGroupTitle']/../../td[7]/span/a@href"));
     $customFieldsetId = $customFieldsetId[1];
 
     //create Individual contact
index c5b03066ef056d9eb4a8d217638aa71d8715dc9f..8387fd3e80f8f79bd7865a1adee4e37e62a37054 100644 (file)
@@ -240,8 +240,8 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('_qf_DedupeFind_submit-bottom');
     $this->click("_qf_DedupeFind_next-bottom");
 
-    $this->waitForElementPresent("xpath=div[@id='DedupeFind']/div[2]/div/table/tbody/tr[1]/td[4]/a[text()='merge']");
-    $this->waitForElementPresent("xpath=//*[@id='DedupeFind']/a[3]/span[contains(text(),'Done')]");
+    $this->waitForElementPresent("xpath=//form[@id='DedupeFind']/div[2]/div/table/tbody/tr[1]/td[4]/a[text()='merge']");
+    $this->waitForElementPresent("xpath=//form[@id='DedupeFind']/a[3]/span[contains(text(),'Done')]");
     $this->isElementPresent("xpath=//table[@id='option51']/tbody/tr/td[1]/a[text()='{$firstName} {$lastName}']/../td[2]/a[text()='{$fName} {$lName}']");
     $this->click("xpath=//table[@id='option51']/tbody/tr[1]/td[4]/a[text()='merge']");
     $this->waitForElementPresent('_qf_Merge_cancel-bottom');
index ea73fd1f4910adcf421319f56d2b56860ed7f632..07766251169fd3749dea1d61f1ae9210028b49b2 100644 (file)
@@ -67,10 +67,10 @@ class WebTest_Contact_TagAddTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("css=table.display tbody tr td");
 
     // verify text
-    $this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagName']");
-    $this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagName']/following-sibling::td[2][text()='Adding new tag. ']");
-    $this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagName']/following-sibling::td[4][text()= 'Contacts']");
-    $this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagName']/following-sibling::td[7]/span/a[text()= 'Edit']");
+    $this->assertTrue($this->isTextPresent($tagName), 'Missing text: ' . $tagName);
+    $this->assertTrue($this->isTextPresent('Adding new tag.'), 'Missing text: ' . 'Adding new tag.');
+    $this->assertTrue($this->isTextPresent('Contacts'), 'Missing text: ' . 'Contacts');
+    $this->assertTrue($this->isTextPresent('Edit'), 'Missing text: ' . 'Edit');
   }
 
   public function testAddTagSet() {
@@ -105,9 +105,9 @@ class WebTest_Contact_TagAddTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("css=table.display tbody tr td");
 
     // verify text
-    $this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagSetName']");
-    $this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagSetName']/following-sibling::td[2][text()='Adding new tag set. ']");
-    $this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagSetName']/following-sibling::td[4][text()= 'Contacts']");
-    $this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagSetName']/following-sibling::td[7]/span/a[text()= 'Edit']");
+    $this->assertTrue($this->isTextPresent($tagSetName), 'Missing text: ' . $tagSetName);
+    $this->assertTrue($this->isTextPresent('Adding new tag set.'), 'Missing text: ' . 'Adding new tag set.');
+    $this->assertTrue($this->isTextPresent('Contacts'), 'Missing text: ' . 'Contacts');
+    $this->assertTrue($this->isTextPresent('Edit'), 'Missing text: ' . 'Edit');
   }
 }
index d4c870f81e5ad466226eae141ee9cd08e8dc4b38..69aa3bc607c0b106f6f61e7f25bca3a48e483757 100644 (file)
@@ -148,9 +148,9 @@ class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("css=table.display tbody tr td");
 
     // verify text
-    $this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagSetName']");
+    $this->assertTrue($this->isTextPresent($tagSetName), 'Missing text: ' . $tagSetName);
 
-    $tagid = explode('&id=', $this->getAttribute("xpath=//table//tbody/tr/td[1][text()= '$tagSetName']/following-sibling::td[7]/span/a[text()= 'Edit']@href"));
+    $tagid = explode('&id=', $this->getAttribute("xpath=//table[@class='display dataTable no-footer']/tbody//tr/td[1]/div[text()= '$tagSetName']/../../td[8]/span/a[text()= 'Edit']@href"));
     $tagid = explode('&', $tagid[1]);
     $tagid = $tagid[0];
 
index e4bec6a24724e633b6b7761eaa75484a412b7660..09bd4a5879c8ff8106d9d0250a7e32d3768ca4c5 100644 (file)
@@ -356,7 +356,9 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
 
     // fill in Receipt details
     $this->type('thankyou_title', "Thank-you Page Title $hash");
+    $this->click("xpath=//form[@id='ThankYou']/div[2]/table[1]/tbody/tr[2]/td[2]/div/a/span");
     $this->fillRichTextField('thankyou_text', 'This is thankyou message for ' . $pageTitle, 'CKEditor');
+    $this->click("xpath=//form[@id='ThankYou']/div[2]/table[1]/tbody/tr[3]/td[2]/div/a/span");
     $this->fillRichTextField('thankyou_footer', 'This is thankyou footer message for ' . $pageTitle, 'CKEditor');
     $this->click('is_email_receipt');
     $this->waitForElementPresent('bcc_receipt');
index 04dafd980d783aca70eb16ea879e16a4233101be..f551e02ac4491d761b4f0df1ec8045674edea189 100644 (file)
@@ -46,7 +46,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
 
     //financial account for check
     $this->openCiviPage("admin/options/payment_instrument", "reset=1");
-    $financialAccount = $this->getText("xpath=//div[@id='payment_instrument']/table/tbody//tr/td[1][text()='Check']/../td[3]");
+    $financialAccount = $this->getText("xpath=//div[@id='payment_instrument']/table/tbody//tr/td[1]/div[text()='Check']/../../td[3]");
 
     // Add new Financial Account
     $orgName = 'Alberta ' . substr(sha1(rand()), 0, 7);
index 90f065836f134e6d05a74e244eb60797f6043de6..37c7a9272cfc621a3bee55a1bdeb4a2eb26dc6bd 100644 (file)
@@ -736,7 +736,8 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
 
     //check the delete for priceset
     $this->openCiviPage("admin/price", "reset=1");
-    $this->click("xpath=//table[@id='option11']/tbody/tr/td[4]/span[2]/ul/li[3]/a");
+    $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/span[2]");
+    $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/span[2]/ul/li[3]/a");
     // Check confirmation alert.
     $this->assertTrue((bool) preg_match("/^Are you sure you want to delete this price set?/",
       $this->getConfirmation()
index 66f16aeefdf4b5ecc6cd9ff1e8e3ef1555b74bb8..5ce6b81fdf906b22b9ff4904257bbd606dabc81d 100644 (file)
@@ -91,7 +91,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa
     $setHelp          = 'Select your membership options.';
     $memTypeParams1 = $this->webtestAddMembershipType();
     $memTypeTitle1  = $memTypeParams1['membership_type'];
-    $memTypeId1     = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[text()='{$memTypeTitle1}']/../td[12]/span/a[3]@href"));
+    $memTypeId1     = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1]/div[text()='{$memTypeTitle1}']/../../td[12]/span/a[3]@href"));
     $memTypeId1     = $memTypeId1[1];
     $this->_testAddSet($setTitle, $usedFor, $contributionType, $setHelp);
 
@@ -211,12 +211,12 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa
     $memTypeParams1 = $this->webtestAddMembershipType();
     $memTypeTitle1  = $memTypeParams1['membership_type'];
 
-    $memTypeId1     = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[text()='{$memTypeTitle1}']/../td[12]/span/a[3]@href"));
+    $memTypeId1     = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1]/div[text()='{$memTypeTitle1}']/../../td[12]/span/a[3]@href"));
     $memTypeId1     = $memTypeId1[1];
 
     $memTypeParams2 = $this->webtestAddMembershipType();
     $memTypeTitle2  = $memTypeParams2['membership_type'];
-    $memTypeId2     = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[text()='{$memTypeTitle2}']/../td[12]/span/a[3]@href"));
+    $memTypeId2     = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1]/div[text()='{$memTypeTitle2}']/../../td[12]/span/a[3]@href"));
     $memTypeId2     = $memTypeId2[1];
 
     $this->openCiviPage("admin/price/field", "reset=1&action=add&sid={$sid}");
index 4a7021191a349f1ffb42d221ea468aa408fb2432..d4eb1e7f1c61e65d793c0b14f49bee8e4d99e4eb 100644 (file)
@@ -198,7 +198,7 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase {
     // page was loaded
     $this->waitForTextPresent($sourceText);
 
-    $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span/a[1][text()='View']");
+    $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span[1]/a[1][text()='View']");
 
     // click through to the membership view screen
     $this->click("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span/a[1][text()='View']");
index 8df6770af01828316569d593b1e3acaf9478436a..a3ff492c456e3781ba1cf81ef476fa212b91ab2b 100644 (file)
@@ -226,12 +226,12 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
   public function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $contributionType) {
     $memTypeParams1 = $this->webtestAddMembershipType();
     $memTypeTitle1 = $memTypeParams1['membership_type'];
-    $memTypeId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1][text()='{$memTypeTitle1}']/../td[12]/span/a[3]@href"));
+    $memTypeId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1]/div[text()='{$memTypeTitle1}']/../../td[12]/span/a[3]@href"));
     $memTypeId1 = $memTypeId1[1];
 
     $memTypeParams2 = $this->webtestAddMembershipType();
     $memTypeTitle2 = $memTypeParams2['membership_type'];
-    $memTypeId2 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1][text()='{$memTypeTitle2}']/../td[12]/span/a[3]@href"));
+    $memTypeId2 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1]/div[text()='{$memTypeTitle2}']/../../td[12]/span/a[3]@href"));
     $memTypeId2 = $memTypeId2[1];
 
     $this->openCiviPage('admin/price/field', "reset=1&action=add&sid={$sid}");
index c086990e842ad5f8c00a0987c3bc8824d63fd5b9..15f49ed142432bd7cdd4c002b750cc7d39a26f7d 100644 (file)
@@ -94,12 +94,12 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase {
     // create two new membership types
     $memTypeParams1 = $this->webtestAddMembershipType();
     $memTypeTitle1 = $memTypeParams1['membership_type'];
-    $memTypeId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1][text()='{$memTypeTitle1}']/../td[12]/span/a[3]@href"));
+    $memTypeId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1]/div[text()='{$memTypeTitle1}']/../../td[12]/span/a[3]@href"));
     $memTypeId1 = $memTypeId1[1];
 
     $memTypeParams2 = $this->webtestAddMembershipType();
     $memTypeTitle2 = $memTypeParams2['membership_type'];
-    $memTypeId2 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1][text()='{$memTypeTitle2}']/../td[12]/span/a[3]@href"));
+    $memTypeId2 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1]/div[text()='{$memTypeTitle2}']/../../td[12]/span/a[3]@href"));
     $memTypeId2 = $memTypeId2[1];
 
     // edit contribution page memberships tab to add two new membership types
index c8f52328d5af95fbdde90a69fb03a18213c91d77..6c6ec7007ba09e842243d66cb30829fd60305a23 100644 (file)
@@ -406,8 +406,8 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('link=Add Membership Type');
     $this->waitForText('crm-notification-container', "The membership type 'Membership Type $title' has been saved.");
 
-    $this->waitForElementPresent("xpath=//div[@id='membership_type']/table/tbody//tr/td[1][text()='{$membershipTypeTitle}']/../td[12]/span/a[3][text()='Delete']/@href");
-    $url = $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1][text()='{$membershipTypeTitle}']/../td[12]/span/a[3][text()='Delete']/@href");
+    $this->waitForElementPresent("xpath=//div[@id='membership_type']/table/tbody//tr/td[1]/div[text()='{$membershipTypeTitle}']/../../td[12]/span/a[3][text()='Delete']/@href");
+    $url = $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1]/div[text()='{$membershipTypeTitle}']/../../td[12]/span/a[3][text()='Delete']/@href");
     $matches = array();
     preg_match('/id=([0-9]+)/', $url, $matches);
     $membershipTypeId = $matches[1];
index fd85a91811a1e3b2e020441cd19a9c2edfb24d85..6dbd8c93f8a4e7db3534d90d54fec2b58ed0acbf 100644 (file)
@@ -92,12 +92,12 @@ class WebTest_Member_SeperateMembershipPaymentTest extends CiviSeleniumTestCase
     // create new membership types
     $memTypeParams1 = $this->webtestAddMembershipType();
     $memTypeTitle1  = $memTypeParams1['membership_type'];
-    $memTypeId1     = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[text()='{$memTypeTitle1}']/../td[12]/span/a[3]@href"));
+    $memTypeId1     = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td/div[text()='{$memTypeTitle1}']/../../td[12]/span/a[3]@href"));
     $memTypeId1     = $memTypeId1[1];
 
     $memTypeParams2 = $this->webtestAddMembershipType();
     $memTypeTitle2  = $memTypeParams2['membership_type'];
-    $memTypeId2     = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[text()='{$memTypeTitle2}']/../td[12]/span/a[3]@href"));
+    $memTypeId2     = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td/div[text()='{$memTypeTitle2}']/../../td[12]/span/a[3]@href"));
     $memTypeId2     = $memTypeId2[1];
 
     // edit contribution page memberships tab to add two new membership types
index feff9842b5b73bfbabaf62e5dbc02dc2540dd763..6bb8682c5d16912989fc97a7c2a4994be55d5269 100644 (file)
@@ -236,8 +236,8 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase {
    */
   public function _testdeleteProfile($profileTitle) {
     //$this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul//li/a[text()='Delete']");
-    $this->click("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul//li/a[text()='Delete']");
+    $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/div[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul//li/a[text()='Delete']");
+    $this->click("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/div[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul//li/a[text()='Delete']");
 
     $this->waitForElementPresent('_qf_Group_next-bottom');
     $this->click('_qf_Group_next-bottom');
index 8ea217b0caaad2876447139472e28231c2d9aa95..fa1702f1bfb0dfa6152348bcbce39ee8acf38809 100644 (file)
@@ -135,8 +135,8 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase
    * @param $profileTitle
    */
   public function _testdeleteProfile($profileTitle) {
-    $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div[1]/table/tbody//tr/td[1]/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[5]/a[text()='Delete']");
-    $this->click("xpath=//div[@id='user-profiles']/div/div[1]/table/tbody//tr/td[1]/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[5]/a[text()='Delete']");
+    $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div[1]/table/tbody//tr/td[1]/div[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul//li/a[text()='Delete']");
+    $this->click("xpath=//div[@id='user-profiles']/div/div[1]/table/tbody//tr/td[1]/div[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul//li/a[text()='Delete']");
     $this->waitForElementPresent('_qf_Group_next-bottom');
     $this->click('_qf_Group_next-bottom');
     $this->waitForElementPresent('newCiviCRMProfile-bottom');