}
function testEventParticipationAdd() {
- // Log in using webtestLogin() method
$this->webtestLogin();
// Adding contact with randomized first name (so we can then select that contact when creating event registration)
- // We're using Quick Add block on the main page for this.
$firstName = substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName, 'Anderson', TRUE);
- $contactName = "Anderson, $firstName";
$displayName = "$firstName Anderson";
$this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", "_qf_Participant_upload-bottom");
// Using helper webtestFillDate function.
$this->webtestFillDate('register_date', 'now');
$today = date('F jS, Y', strtotime('now'));
- // May 5th, 2010
// Select participant status
$this->select('status_id', 'value=1');
$this->assertTrue($this->isChecked("send_receipt"), 'Send Confirmation and Receipt checkbox should be checked by default but is not checked.');
// Clicking save.
- $this->click('_qf_Participant_upload-bottom');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink('_qf_Participant_upload-bottom');
// Is status message correct?
- $this->waitForText('crm-notification-container', "Event registration for $displayName has been added");
+ $this->checkCRMAlert("Event registration for $displayName has been added");
$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=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
- $this->waitForElementPresent('_qf_ParticipantView_cancel-bottom');
+ $this->clickAjaxLink("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom');
$this->webtestVerifyTabularData(
array(
);
// check contribution record as well
//click through to the contribution view screen
- $this->click("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
- $this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
+ $this->clickAjaxLink("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ContributionView_cancel-bottom');
$this->webtestVerifyTabularData(
array(
$this->webtestLogin();
// Adding contact with randomized first name (so we can then select that contact when creating event registration)
- // We're using Quick Add block on the main page for this.
$firstName = substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName, 'Anderson', TRUE);
- $contactName = "Anderson, $firstName";
$displayName = "$firstName Anderson";
// add custom data for participant role
$this->openCiviPage("admin/custom/group", "reset=1");
//add new custom data
- $this->click("//a[@id='newCustomDataGroup']/span");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink("//a[@id='newCustomDataGroup']/span");
//fill custom group title
$customGroupTitle = 'custom_' . substr(sha1(rand()), 0, 7);
$this->select('extends[1][]', 'value=2');
$this->click("//option[@value='Contact']");
- $this->clickLink('_qf_Group_next', 'label');
+ $this->clickLink('_qf_Group_next');
//Is custom group created?
- $this->waitForText('crm-notification-container', "Your custom field set '$customGroupTitle' has been added. You can add custom fields now.");
+ $this->checkCRMAlert("Your custom field set '$customGroupTitle' has been added. You can add custom fields now.");
//add custom field - alphanumeric checkbox
+ $this->waitForAjaxContent();
$checkboxFieldLabel = 'custom_field' . substr(sha1(rand()), 0, 4);
$this->click('label');
$this->type('label', $checkboxFieldLabel);
$this->click('is_searchable');
//clicking save
- $this->clickLink('_qf_Field_done-bottom', 'newCustomField', FALSE);
+ $this->click('_qf_Field_done-bottom');
//Is custom field created?
- $this->waitForText('crm-notification-container', "Custom field '$checkboxFieldLabel' has been saved.");
+ $this->checkCRMAlert("Custom field '$checkboxFieldLabel' has been saved.");
+ $this->waitForAjaxContent();
//create another custom field - Integer Radio
- $this->clickLink('newCustomField', '_qf_Field_cancel', FALSE);
+ $this->clickAjaxLink('newCustomField', '_qf_Field_cancel');
$this->click('data_type[0]');
$this->select('data_type[0]', 'value=1');
$this->click("//option[@value='1']");
$this->click('is_searchable');
//clicking save
- $this->click('_qf_Field_done-bottom');
+ $this->clickAjaxLink('_qf_Field_done-bottom', NULL);
+
+ // Visit home page for a sec to give caches time to be cleared
+ $this->openCiviPage('');
$this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", "_qf_Participant_upload-bottom");
$this->type('check_number', '1044');
// Clicking save.
- $this->click('_qf_Participant_upload-bottom');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink('_qf_Participant_upload-bottom');
// Is status message correct?
- $this->waitForText('crm-notification-container', "Event registration for $displayName has been added");
+ $this->checkCRMAlert("Event registration for $displayName has been added");
$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=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
- $this->waitForElementPresent('_qf_ParticipantView_cancel-bottom');
+ $this->clickAjaxLink("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom');
$this->webtestVerifyTabularData(
array(
// check contribution record as well
//click through to the contribution view screen
- $this->click("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
- $this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
+ $this->clickAjaxLink("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ContributionView_cancel-bottom');
$this->webtestVerifyTabularData(
array(
array('entity' => 'ParticipantRole', 'subEntity' => 'Attendee','triggerElement' => array('name' => 'role_id', 'type' => "select"))
);
$pageUrl = array('url' => "participant/add", 'args' => "reset=1&action=add&context=standalone");
- $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl);
+ $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, TRUE);
}
/*