<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | 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_MailingTest
+ */
class WebTest_Campaign_MailingTest extends CiviSeleniumTestCase {
protected function setUp() {
// add to group
$this->select("group_id", "label=$groupName");
$this->click("_qf_GroupContact_next");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent('link=Remove');
$this->openCiviPage('campaign/add', 'reset=1', '_qf_Campaign_upload-bottom');
$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->mailingAddTest($groupName, $campaignTitle, $id);
}
+ /**
+ * @param string $groupName
+ * @param $campaignTitle
+ * @param int $id
+ */
function mailingAddTest($groupName, $campaignTitle, $id) {
//---- create mailing contact and add to mailing Group
$firstName = substr(sha1(rand()), 0, 7);
$this->select("campaign_id", "value=$id");
// Add the test mailing group
- $this->select("includeGroups-f", "$groupName");
- $this->click("add");
+ $this->select("includeGroups", "$groupName");
// click next
$this->click("_qf_Group_next");