Fixed webtest of export and testAdvanceSearch of Contact_AdavanceSearchT...
"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",
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}
(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,
// 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, {
});
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': {
<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>
<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>
//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
$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');
$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() {
$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');
}
}
$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];
// 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');
//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);
//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()
$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);
$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}");
// 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']");
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}");
// 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
$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];
// 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
*/
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');
* @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');