diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index 94beecb840d2..458ebe27402b 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -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(); @@ -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'); @@ -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 @@ -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(); @@ -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'; @@ -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'); @@ -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'); @@ -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(); @@ -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'; @@ -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()); @@ -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. @@ -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(); @@ -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'; @@ -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.