<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | 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_Event_ChangeParticipantStatus
+ */
class WebTest_Event_ChangeParticipantStatus extends CiviSeleniumTestCase {
protected function setUp() {
parent::setUp();
}
- function testParticipationAdd() {
+ public function testParticipationAdd() {
// Log in using webtestLogin() method
$this->webtestLogin();
// Search the participants
$this->openCiviPage("event/search", "reset=1", '_qf_Search_refresh');
- $eventName = 'Rain';
- $this->click("event_name");
- $this->type("event_name", $eventName);
- $this->typeKeys("event_name", $eventName);
- $this->waitForElementPresent("css=div.ac_results-inner li");
- $this->click("css=div.ac_results-inner li");
- $this->assertContains($eventName, $this->getValue("event_name"), "autocomplete expected $eventName but didn’t find it in " . $this->getValue("event_name"));
+ $eventName = 'Rain-forest Cup Youth Soccer Tournament';
+ $this->select2("event_id", $eventName);
$this->click('_qf_Search_refresh');
$this->waitForElementPresent("xpath=//div[@id='participantSearch']/table/tbody//tr/td[3]/a[text()='$sortName1']");
// Change participant status for selected participants
$this->select('task', "label=Change Participant Status");
- $this->click('Go');
$this->waitForElementPresent('_qf_ParticipantStatus_next');
$this->select('status_change', "label=Attended");
- $this->click('_qf_ParticipantStatus_next');
- $this->waitForElementPresent('Go');
+ $this->clickLink('_qf_ParticipantStatus_next');
$this->assertTrue($this->isTextPresent('The updates have been saved.'),
"Status message didn't show up after saving!"
);
$this->webtestVerifyTabularData(array('Status' => 'Attended'));
}
- function addParticipant($firstName) {
+ /**
+ * @param string $firstName
+ */
+ public function addParticipant($firstName) {
$this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", '_qf_Participant_upload-bottom');
// Type contact last name in contact auto-complete, wait for dropdown and click first result
$this->webtestFillAutocomplete($firstName);
// Select event. Based on label for now.
- $this->select('event_id', "label=regexp:Rain-forest Cup Youth Soccer Tournament.");
+ $this->select2('event_id', "Rain-forest Cup Youth Soccer Tournament");
// Select role
- $this->click('role_id[2]');
+ $this->multiselect2('role_id', array('Volunteer'));
// Choose Registration Date.
// Using helper webtestFillDate function.
// Select an event fee
$this->waitForElementPresent('priceset');
- $this->click("xpath=//input[@class='form-radio']");
+ $this->click("xpath=//input[@class='crm-form-radio']");
// Select 'Record Payment'
$this->click('record_contribution');
"Status message didn't show up after saving!"
);
- $this->waitForElementPresent("xpath=//div[@id='Events']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
+ $this->waitForElementPresent("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
//click through to the participant view screen
- $this->click("xpath=//div[@id='Events']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
+ $this->click("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
$this->waitForElementPresent('_qf_ParticipantView_cancel-bottom');
$this->webtestVerifyTabularData(
'Participant Role' => 'Attendee',
'Status' => 'Registered',
'Event Source' => 'Event StandaloneAddTest Webtest',
- 'Event Fees' => '$ 800.00',
)
);
+ $this->verifyText("xpath=//td[text()='Selections']/following-sibling::td//div/div", preg_quote('Event Total: $ 800.00'));
}
}
-