Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--used $this->openCiviPage() method instead $this->open(), CRM-11986 #18

Merged
merged 1 commit into from
Mar 4, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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