Skip to content

Commit

Permalink
Merge pull request #32 from davecivicrm/CRM-11534
Browse files Browse the repository at this point in the history
Fixes for WebTest_Contribute_ContributionPageAddTest
  • Loading branch information
totten committed Mar 5, 2013
2 parents 8dd0100 + b68dea8 commit 47d1e8b
Showing 1 changed file with 33 additions and 15 deletions.
48 changes: 33 additions & 15 deletions tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
function testContributionPageAdd() {
// open browser, login
$this->open($this->sboxPath);
$this->webtestLogin();

// a random 7-char string and an even number to make this pass unique
Expand Down Expand Up @@ -78,7 +77,6 @@ function testContributionPageAdd() {
*/
function testContributionPageSeparatePayment() {
// open browser, login
$this->open($this->sboxPath);
$this->webtestLogin();

// a random 7-char string and an even number to make this pass unique
Expand Down Expand Up @@ -129,7 +127,6 @@ function testContributionPageSeparatePayment() {
*/
function testContributionPageSeparatePaymentPayLater() {
// open browser, login
$this->open($this->sboxPath);
$this->webtestLogin();

// a random 7-char string and an even number to make this pass unique
Expand Down Expand Up @@ -188,23 +185,45 @@ function testContributionPageSeparatePaymentPayLater() {
$this->waitForElementPresent('contribution_date_low');

$this->type('sort_name', "$firstName $lastName");
$this->select('financial_type_id',"label=Member Dues");
$this->click('_qf_Search_refresh');

$this->waitForPageToLoad($this->getTimeoutMsec());

//View Contribution for membership fee
$this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
$this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
//View Contribution Record
$expected = array(
2 => 'Donation',
7 => 'Pending : Pay Later',
1 => "{$firstName} {$lastName}",
'From' => "{$firstName} {$lastName}",
'Financial Type' => 'Member Dues',
'Total Amount' => '$ 50.00',
'Contribution Status' => 'Pending : Pay Later',
);
foreach ($expected as $value => $label) {
$this->verifyText("xpath=id('ContributionView')/div[2]/table[1]/tbody/tr[$value]/td[2]", preg_quote($label));
}
$this->webtestVerifyTabularData($expected);
$this->click('_qf_ContributionView_cancel-bottom');

//View Contribution for separate contribution
$this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
// Open search criteria again
$this->click("xpath=id('Search')/x:div[2]/x:div/x:div[1]");
$this->waitForElementPresent("financial_type_id");
$this->select('financial_type_id',"label=Donation");
$this->click('_qf_Search_refresh');

$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");

$this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
$expected = array(
'From' => "{$firstName} {$lastName}",
'Financial Type' => 'Donation',
'Contribution Status' => 'Pending : Pay Later',
);
$this->webtestVerifyTabularData($expected);
$this->click('_qf_ContributionView_cancel-bottom');


Expand All @@ -223,12 +242,11 @@ function testContributionPageSeparatePaymentPayLater() {

//View Membership Record
$expected = array(
3 => 'Pending',
1 => "{$firstName} {$lastName}",
'Member' => "{$firstName} {$lastName}",
'Membership Type' => 'Student',
'Status' => 'Pending',
);
foreach ($expected as $value => $label) {
$this->verifyText("xpath=id('MembershipView')/div[2]/div/table/tbody/tr[$value]/td[2]", preg_quote($label));
}
$this->webtestVerifyTabularData($expected);
$this->click('_qf_MembershipView_cancel-bottom');
}
}
Expand Down

0 comments on commit 47d1e8b

Please sign in to comment.