<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
require_once 'CiviTest/CiviSeleniumTestCase.php';
parent::setUp();
}
- function testCreateCampaign() {
+ public function testCreateCampaign() {
$this->webtestLogin('admin');
// Create new group
$this->waitForText('crm-notification-container', "Campaign $title");
- $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
- $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
+ $this->waitForElementPresent("//div[@id='campaignList']/div/table/tbody//tr/td[3]/div[text()='{$campaignTitle}']/../../td[1]");
+ $id = (int) $this->getText("//div[@id='campaignList']/div/table/tbody//tr/td[3]/div[text()='{$campaignTitle}']/../../td[1]");
$this->onlineContributionAddTest($campaignTitle, $id);
}
* @param $campaignTitle
* @param int $id
*/
- function onlineContributionAddTest($campaignTitle, $id) {
+ public function onlineContributionAddTest($campaignTitle, $id) {
// Use default payment processor
$processorName = 'Test Processor';
$paymentProcessorId = $this->webtestAddPaymentProcessor($processorName);
// fill in step 1 (Title and Settings)
$contributionPageTitle = "Title $contributionTitle";
$this->type('title', $contributionPageTitle);
- $this->select( 'financial_type_id', 'value=1' );
+ $this->select('financial_type_id', 'value=1');
// select campaign
$this->click("campaign_id");
//Find Contribution
$this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
- $this->type("sort_name", "$firstName $lastName");
+ $this->type("sort_name", "$lastName $firstName");
$this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
$this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
-
//View Contribution Record
- $this->verifyText("xpath=id('ContributionView')/div[2]/table[1]/tbody/tr[10]/td[2]", preg_quote($campaignTitle));
+ $this->verifyText("xpath=id('ContributionView')/div[2]/table[1]/tbody/tr[11]/td[2]", preg_quote($campaignTitle));
}
}