Skip to content

Commit

Permalink
Merge pull request #18 from pradpnayak/webtest-CRM-11986
Browse files Browse the repository at this point in the history
--used $this->openCiviPage() method instead $this->open(), CRM-11986
  • Loading branch information
kurund committed Mar 4, 2013
2 parents d1db3fa + a9f5275 commit 7038be5
Showing 1 changed file with 11 additions and 30 deletions.
41 changes: 11 additions & 30 deletions tests/phpunit/WebTest/Event/AddPricesetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ protected function setUp() {
}

function testAddPriceSet() {
// This is the path where our testing install resides.
// The rest of URL is defined in CiviSeleniumTestCase base class, in
// class attributes.
$this->open($this->sboxPath);

// Log in using webtestLogin() method
$this->webtestLogin();
Expand Down Expand Up @@ -68,7 +64,7 @@ function testAddPriceSet() {
}

function _testAddSet($setTitle, $usedFor, $setHelp, $financialType = 'Event Fee') {
$this->open($this->sboxPath . 'civicrm/admin/price?reset=1&action=add');
$this->openCiviPage('admin/price', 'reset=1&action=add');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent('_qf_Set_next-bottom');

Expand Down Expand Up @@ -178,7 +174,7 @@ function _testAddPriceFields(&$fields, &$validateStrings, $dateSpecificFields =
function _testVerifyPriceSet($validateStrings, $sid) {
// verify Price Set at Preview page
// start at Manage Price Sets listing
$this->open($this->sboxPath . 'civicrm/admin/price?reset=1');
$this->openCiviPage('admin/price', 'reset=1');
$this->waitForPageToLoad($this->getTimeoutMsec());

// Use the price set id ($sid) to pick the correct row
Expand All @@ -193,10 +189,6 @@ function _testVerifyPriceSet($validateStrings, $sid) {
}

function testRegisterWithPriceSet() {
// This is the path where our testing install resides.
// The rest of URL is defined in CiviSeleniumTestCase base class, in
// class attributes.
$this->open($this->sboxPath);

// Log in using webtestLogin() method
$this->webtestLogin();
Expand Down Expand Up @@ -229,7 +221,7 @@ function testRegisterWithPriceSet() {
$this->webtestAddPaymentProcessor($processorName);

// Go directly to the URL of the screen that you will be testing (New Event).
$this->open($this->sboxPath . 'civicrm/event/add?reset=1&action=add');
$this->openCiviPage('event/add', 'reset=1&action=add');

$eventTitle = 'My Conference - ' . substr(sha1(rand()), 0, 7);
$email = 'Smith' . substr(sha1(rand()), 0, 7) . '@example.com';
Expand Down Expand Up @@ -296,13 +288,13 @@ function testRegisterWithPriceSet() {

// verify event input on info page
// start at Manage Events listing
$this->open($this->sboxPath . 'civicrm/event/manage?reset=1');
$this->openCiviPage('event/manage', 'reset=1');
$this->click("link=$eventTitle");

$this->waitForPageToLoad($this->getTimeoutMsec());
$eventInfoUrl = $this->getLocation();

$this->open($this->sboxPath . 'civicrm/logout?reset=1');
$this->openCiviPage('logout', 'reset=1');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->open($eventInfoUrl);
$this->click('link=Register Now');
Expand Down Expand Up @@ -337,14 +329,11 @@ function testRegisterWithPriceSet() {
$thankStrings = array('Thank You for Registering', 'Event Total', 'Transaction Date');
$this->assertStringsPresent($thankStrings);

//login to check participant
$this->open($this->sboxPath);

// Log in using webtestLogin() method
$this->webtestLogin();

//Find Participant
$this->open($this->sboxPath . 'civicrm/event/search?reset=1');
$this->openCiviPage('event/search', 'reset=1');

$this->waitForElementPresent('_qf_Search_refresh');

Expand All @@ -371,10 +360,6 @@ function testRegisterWithPriceSet() {
}

function testParticipantWithDateSpecificPriceSet() {
// This is the path where our testing install resides.
// The rest of URL is defined in CiviSeleniumTestCase base class, in
// class attributes.
$this->open($this->sboxPath);

// Log in using webtestLogin() method
$this->webtestLogin();
Expand Down Expand Up @@ -407,7 +392,7 @@ function testParticipantWithDateSpecificPriceSet() {
$this->webtestAddPaymentProcessor($processorName);

// Go directly to the URL of the screen that you will be testing (New Event).
$this->open($this->sboxPath . 'civicrm/event/add?reset=1&action=add');
$this->openCiviPage('event/add', 'reset=1&action=add');

$eventTitle = 'My Conference - ' . substr(sha1(rand()), 0, 7);
$email = 'Smith' . substr(sha1(rand()), 0, 7) . '@example.com';
Expand Down Expand Up @@ -474,7 +459,7 @@ function testParticipantWithDateSpecificPriceSet() {

// verify event input on info page
// start at Manage Events listing
$this->open($this->sboxPath . 'civicrm/event/manage?reset=1');
$this->openCiviPage('event/manage', 'reset=1');
$this->click("link=$eventTitle");

$this->waitForPageToLoad($this->getTimeoutMsec());
Expand All @@ -486,7 +471,7 @@ function testParticipantWithDateSpecificPriceSet() {
$displayName = "$firstName Anderson";

// Go directly to the URL of the screen that you will be testing (Register Participant for Event-standalone).
$this->open($this->sboxPath . 'civicrm/participant/add?reset=1&action=add&context=standalone');
$this->openCiviPage('participant/add', 'reset=1&action=add&context=standalone');

// As mentioned before, waitForPageToLoad is not always reliable. Below, we're waiting for the submit
// button at the end of this page to show up, to make sure it's fully loaded.
Expand Down Expand Up @@ -532,10 +517,6 @@ function testParticipantWithDateSpecificPriceSet() {
*
*/
function testEventWithPriceSet() {
// This is the path where our testing install resides.
// The rest of URL is defined in CiviSeleniumTestCase base class, in
// class attributes.
$this->open($this->sboxPath);

// Log in using webtestLogin() method
$this->webtestLogin();
Expand Down Expand Up @@ -570,7 +551,7 @@ function testEventWithPriceSet() {
$this->_testVerifyPriceSet($validateStrings, $sid);

// Go directly to the URL of the screen that you will be testing (New Event).
$this->open($this->sboxPath . 'civicrm/event/add?reset=1&action=add');
$this->openCiviPage('event/add', 'reset=1&action=add');

$eventTitle = 'My Conference - ' . substr(sha1(rand()), 0, 7);
$email = 'Smith' . substr(sha1(rand()), 0, 7) . '@example.com';
Expand Down Expand Up @@ -614,7 +595,7 @@ function testEventWithPriceSet() {
$this->waitForPageToLoad($this->getTimeoutMsec());

// Go directly to the URL of the screen that you will be testing (Register Participant for Event-standalone).
$this->open($this->sboxPath . 'civicrm/participant/add?reset=1&action=add&context=standalone');
$this->openCiviPage('participant/add', 'reset=1&action=add&context=standalone');

// As mentioned before, waitForPageToLoad is not always reliable. Below, we're waiting for the submit
// button at the end of this page to show up, to make sure it's fully loaded.
Expand Down

0 comments on commit 7038be5

Please sign in to comment.