+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
$this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", "_qf_Participant_upload-bottom");
$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'));
// Using helper webtestFillDate function.
$this->webtestFillDate('register_date', 'now');
$today = date('F jS, Y', strtotime('now'));
// Select participant status
$this->select('status_id', 'value=1');
// Select participant status
$this->select('status_id', 'value=1');
$this->type('check_number', '1044');
// give some time for js to process
$this->type('check_number', '1044');
// give some time for js to process
$this->verifySelectedLabel("status_id", 'Partially paid');
// later on change the status
$this->verifySelectedLabel("status_id", 'Partially paid');
// later on change the status
// check for proper info message displayed regarding status
$this->chooseCancelOnNextConfirmation();
$this->click('_qf_Participant_upload-bottom');
// check for proper info message displayed regarding status
$this->chooseCancelOnNextConfirmation();
$this->click('_qf_Participant_upload-bottom');
- $this->assertTrue((bool)preg_match("/Payment amount is less than the amount owed. Expected participant status is 'Partially paid'. Are you sure you want to set the participant status to Registered/", $this->getConfirmation()));
+ $this->assertTrue((bool) preg_match("/Payment amount is less than the amount owed. Expected participant status is 'Partially paid'. Are you sure you want to set the participant status to Registered/", $this->getConfirmation()));
// select partially paid status again and click on save
$this->select('status_id', 'label=Partially paid');
// Clicking save.
// select partially paid status again and click on save
$this->select('status_id', 'label=Partially paid');
// Clicking save.
// Is status message correct?
$this->waitForText('crm-notification-container', "Event registration for $displayName has been added");
// Is status message correct?
$this->waitForText('crm-notification-container', "Event registration for $displayName has been added");
$this->waitForElementPresent("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
// make additional payment
// 1 - check for links presence on participant view and edit page
$this->assertElementPresent("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span[2]/ul/li[2]/a[text()='Record Payment']");
$this->click("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
$this->waitForElementPresent("xpath=id('ParticipantView')");
$this->waitForElementPresent("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
// make additional payment
// 1 - check for links presence on participant view and edit page
$this->assertElementPresent("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span[2]/ul/li[2]/a[text()='Record Payment']");
$this->click("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
$this->waitForElementPresent("xpath=id('ParticipantView')");
$this->click("xpath=id('ParticipantView')//div[@class='action-link']/div/a/span[contains(text(), 'Edit')]");
$this->waitForElementPresent("xpath=id('Participant')");
$this->click("xpath=id('ParticipantView')//div[@class='action-link']/div/a/span[contains(text(), 'Edit')]");
$this->waitForElementPresent("xpath=id('Participant')");
- $this->assertElementPresent("xpath=id('Participant')//td[@id='payment-info']//a/span[contains(text(), 'Record Payment')]");
- $location = $this->getAttribute("xpath=id('Participant')//td[@id='payment-info']/a/span[contains(text(), 'Record Payment')]/../@href");
-
- $this->open($location);
- $this->waitForElementPresent("xpath=id('AdditionalPayment')");
- $this->assertElementContainsText("xpath=id('AdditionalPayment')/h3", 'New Event Payment');
+ $this->waitForElementPresent("xpath=id('Participant')//td[@id='payment-info']//a/span[contains(text(), 'Record Payment')]");
+ $this->clickLinkSuppressPopup("xpath=id('Participant')//td[@id='payment-info']/a/span[contains(text(), 'Record Payment')]/../", 'AdditionalPayment');
$this->waitForText("xpath=//span[@id='totalAmount']/span", 'Payment amount cannot be greater than owed amount');
$this->type('total_amount', $balance);
$this->click('_qf_AdditionalPayment_upload-bottom');
$this->waitForText("xpath=//span[@id='totalAmount']/span", 'Payment amount cannot be greater than owed amount');
$this->type('total_amount', $balance);
$this->click('_qf_AdditionalPayment_upload-bottom');
$this->waitForElementPresent("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
$this->click("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
$this->waitForElementPresent("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
$this->click("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
// check the fee amount and contribution amount
$this->_checkPaymentInfoTable(800.00, 800.00);
// check the fee amount and contribution amount
$this->_checkPaymentInfoTable(800.00, 800.00);
// view transaction popup info check
$this->waitForElementPresent("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td[2]/a");
// view transaction popup info check
$this->waitForElementPresent("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td[2]/a");
$this->waitForElementPresent("xpath=//table[@id='info']/tbody/tr/th[contains(text(), 'Amount')]/../../tr[2]/td[contains(text(), '$ 400.00')]/../../tr[3]/td[contains(text(), '$ 400.00')]");
$this->waitForElementPresent("xpath=//table[@id='info']/tbody/tr/th[3][contains(text(), 'Paid By')]/../../tr[2]/td[3][contains(text(), 'Check')]/../../tr[3]/td[3][contains(text(), 'Cash')]");
$this->waitForElementPresent("xpath=//table[@id='info']/tbody/tr/th[6][contains(text(), 'Status')]/../../tr[2]/td[6][contains(text(), 'Completed')]/../../tr[3]/td[6][contains(text(), 'Completed')]");
$this->waitForElementPresent("xpath=//table[@id='info']/tbody/tr/th[contains(text(), 'Amount')]/../../tr[2]/td[contains(text(), '$ 400.00')]/../../tr[3]/td[contains(text(), '$ 400.00')]");
$this->waitForElementPresent("xpath=//table[@id='info']/tbody/tr/th[3][contains(text(), 'Paid By')]/../../tr[2]/td[3][contains(text(), 'Check')]/../../tr[3]/td[3][contains(text(), 'Cash')]");
$this->waitForElementPresent("xpath=//table[@id='info']/tbody/tr/th[6][contains(text(), 'Status')]/../../tr[2]/td[6][contains(text(), 'Completed')]/../../tr[3]/td[6][contains(text(), 'Completed')]");
$this->assertElementContainsText("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td", "$ {$feeAmt}", 'Missing text: appropriate fee amount');
$this->assertElementContainsText("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td[2]", "$ {$amtPaid}", 'Missing text: appropriate fee amount');
}
$this->assertElementContainsText("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td", "$ {$feeAmt}", 'Missing text: appropriate fee amount');
$this->assertElementContainsText("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td[2]", "$ {$amtPaid}", 'Missing text: appropriate fee amount');
}