<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*/
require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Campaign_MembershipTest
+ */
class WebTest_Campaign_MembershipTest extends CiviSeleniumTestCase {
protected function setUp() {
parent::setUp();
}
- function testCreateCampaign() {
+ public function testCreateCampaign() {
$this->webtestLogin('admin');
// Create new group
// add to group
$this->select("group_id", "label=$groupName");
$this->click("_qf_GroupContact_next");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('link=Remove');
$firstName2 = substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName2, "John", "$firstName2.john@example.org");
// add to group
$this->select("group_id", "label=$groupName");
$this->click("_qf_GroupContact_next");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('link=Remove');
// Enable CiviCampaign module if necessary
$this->enableComponents(array('CiviCampaign'));
$this->type("description", "This is a test campaign");
// include groups for the campaign
- $this->addSelection("includeGroups-f", "label=$groupName");
- $this->click("//option[@value=4]");
- $this->click("add");
+ $this->multiselect2("includeGroups", array("$groupName", "Advisory Board"));
// fill the end date for campaign
$this->webtestFillDate("end_date", "+1 year");
$this->waitForText('crm-notification-container', "Campaign $title");
- $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
- $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
+ $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->memberAddTest($campaignTitle, $id);
}
- function memberAddTest($campaignTitle, $id) {
+ /**
+ * @param $campaignTitle
+ * @param int $id
+ */
+ public function memberAddTest($campaignTitle, $id) {
//Add new memebershipType
$memTypeParams = $this->webtestAddMembershipType();
// Clicking save.
$this->click("_qf_Membership_upload");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('link=View');
// page was loaded
$this->waitForTextPresent($sourceText);
$this->webtestVerifyTabularData(array('Campaign' => $campaignTitle));
}
}
-