+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
$this->waitForPageToLoad($this->getTimeoutMsec());
// Is status message correct?
- $this->assertElementContainsText("crm-notification-container", "Event registration for $displayName has been added", "Status message didn't show up after saving!");
+ $this->waitForText('crm-notification-container', "Event registration for $displayName has been added");
$this->waitForElementPresent("xpath=//div[@id='Events']//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->waitForElementPresent('_qf_ParticipantView_cancel-bottom');
-
$this->webtestVerifyTabularData(
array(
'Event' => 'Rain-forest Cup Youth Soccer Tournament',
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom group created?
- $this->assertElementContainsText("crm-notification-container", "Your custom field set '$customGroupTitle' has been added. You can add custom fields now.");
+ $this->waitForText('crm-notification-container', "Your custom field set '$customGroupTitle' has been added. You can add custom fields now.");
//add custom field - alphanumeric checkbox
$checkboxFieldLabel = 'custom_field' . substr(sha1(rand()), 0, 4);
$this->type('option_label_3', $checkboxOptionLabel3);
$this->type('option_value_3', '3');
-
//enter options per line
$this->type('options_per_line', '2');
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created?
- $this->assertElementContainsText("crm-notification-container", "Your custom field '$checkboxFieldLabel' has been saved.");
+ $this->waitForText('crm-notification-container', "Your custom field '$checkboxFieldLabel' has been saved.");
//create another custom field - Integer Radio
$this->click("//a[@id='newCustomField']/span");
$this->waitForPageToLoad($this->getTimeoutMsec());
// Is status message correct?
- $this->assertElementContainsText("crm-notification-container", "Event registration for $displayName has been added", "Status message didn't show up after saving!");
+ $this->waitForText('crm-notification-container', "Event registration for $displayName has been added");
$this->waitForElementPresent("xpath=//div[@id='Events']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
//click through to the participant view screen
);
}
- function testEventAddMultipleParticipants() {
+ function testEventAddMultipleParticipants() {
+
// Log in using webtestLogin() method
$this->webtestLogin();
-
+
$processorId = $this->webtestAddPaymentProcessor('dummy' . substr(sha1(rand()), 0, 7));
$rand = substr(sha1(rand()), 0, 7);
$firstName = 'First' . $rand;
$lastName2 = 'Last' . $rand;
$this->openCiviPage("participant/add", "reset=1&action=add&context=standalone&mode=test&eid=3");
-
+
$this->assertTrue($this->isTextPresent("Register New Participant"), "Page title 'Register New Participant' missing");
$this->assertTrue($this->isTextPresent("A TEST transaction will be submitted"), "test mode status 'A TEST transaction will be submitted' missing");
$this->_fillParticipantDetails($firstName, $lastName, $processorId);
$this->click('_qf_Participant_upload_new-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
$this->assertTrue($this->isTextPresent("Register New Participant"), "Page title 'Register New Participant' missing");
$this->assertTrue($this->isTextPresent("A TEST transaction will be submitted"), "test mode status 'A TEST transaction will be submitted' missing");
$this->_fillParticipantDetails($firstName, $lastName2, $processorId);
$this->click('_qf_Participant_upload_new-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
//searching the paricipants
$this->openCiviPage("event/search", "reset=1");
$this->type('sort_name', $firstName);
$this->check('participant_test');
$this->click("_qf_Search_refresh");
$this->waitForElementPresent("participantSearch");
-
+
//verifying the registered participants
$names = array( "{$lastName}, {$firstName}", "{$lastName2}, {$firstName}" );
$status = "Registered (test)";
-
+
foreach($names as $name) {
$this->verifyText("xpath=//div[@id='participantSearch']//table//tbody//tr/td[@class='crm-participant-sort_name']/a[text()='{$name}']/../../td[9]", preg_quote($status));
$this->verifyText("xpath=//div[@id='participantSearch']//table//tbody//tr/td[@class='crm-participant-sort_name']/a[text()='{$name}']/../../td[4]/a", preg_quote($eventName));
}
}
+ function testAjaxCustomGroupLoad() {
+ $this->webtestLogin();
+
+ $customSets = array(
+ array('entity' => 'ParticipantEventName', 'subEntity' => 'Fall Fundraiser Dinner',
+ 'triggerElement' => array('name' => "event_id", 'type' => "select")),
+ array('entity' => 'ParticipantRole', 'subEntity' => 'Attendee','triggerElement' => array('type' => "checkbox"))
+ );
+ $pageUrl = array('url' => "participant/add", 'args' => "reset=1&action=add&context=standalone");
+ $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl);
+ }
+
function _fillParticipantDetails($firstName, $lastName, $processorId) {
$this->select("id=profiles_1", "label=New Individual");
$this->waitForElementPresent('_qf_Edit_next');
-
+
$this->type("id=first_name", $firstName);
$this->type("id=last_name", $lastName);
$this->click("id=_qf_Edit_next");
$this->webtestAddCreditCardDetails();
$this->webtestAddBillingDetails();
}
-}
-
+}
\ No newline at end of file