-- webtests cleanup
authorRavish Nair <ravish@ravish.(none)>
Mon, 4 Mar 2013 08:07:12 +0000 (13:37 +0530)
committerRavish Nair <ravish@ravish.(none)>
Mon, 4 Mar 2013 08:07:12 +0000 (13:37 +0530)
tests/phpunit/WebTest/Event/EventListingTest.php
tests/phpunit/WebTest/Export/ContactTest.php
tests/phpunit/WebTest/Mailing/SpoolTest.php

index 4b3fca86fcc4b1c0030ab7f2a7f3b8074b6ae1b4..6a75b02fab9bd7af55d7d8daa900a97ec2e2be3d 100644 (file)
@@ -37,8 +37,7 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase {
 
     //go to manage event and check for presence of ongoing and
     //upcomming events
-    $this->open($this->sboxPath . "civicrm/event/manage?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage("event/manage", "reset=1");
     $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$eventTitle1);
     $this->click("_qf_SearchEvent_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -76,8 +75,7 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase {
     $this->assertFalse($this->isTextPresent("{$eventTitle5}"));
 
     //go to ical and check for presence of ongoing and upcomming events
-    $this->open($this->sboxPath . "civicrm/event/ical?reset=1&page=1&html=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage("event/ical", "reset=1&page=1&html=1");
     $this->assertFalse($this->isTextPresent("{$eventTitle1}"));
     $this->assertFalse($this->isTextPresent("{$eventTitle2}"));
     $this->assertTrue($this->isTextPresent("{$eventTitle3}"));
@@ -86,8 +84,7 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase {
 
     //go to block listing to enable Upcomming Events Block
     // you need to be admin user for below operation
-    $this->open($this->sboxPath . "civicrm/logout?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage("logout", "reset=1");
     $this->webtestLogin(TRUE);
 
     $this->open($this->sboxPath . 'admin/structure/block/manage/civicrm/6/configure');
@@ -102,7 +99,7 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase {
     $this->waitForTextPresent("The block settings have been updated.");
 
     //go to civicrm home and check for presence of upcomming events
-    $this->open($this->sboxPath . "civicrm/dashboard?reset=1");
+    $this->openCiviPage("dashboard", "reset=1");
     $this->assertFalse($this->isTextPresent("{$eventTitle1}"));
     $this->assertFalse($this->isTextPresent("{$eventTitle2}"));
     $this->assertFalse($this->isTextPresent("{$eventTitle3}"));
@@ -119,7 +116,7 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase {
 
   function _testCreateEvent($eventTitle, $startdate, $enddate) {
     // 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);
     $eventDescription = "Here is a description for this conference.";
index 3760756b65b490181b22329908503e02d58260c9..b8fb7d1b0cf39f623d7ba4a2781cbb9f1b52804b 100644 (file)
@@ -91,7 +91,6 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase {
 
     // Visit contact search page.
     $this->openCiviPage("contact/search", "reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Select contact type as Indiividual.
     $this->select("contact_type", "value=Individual");
index 9533bf3a86b2db2abc9c8600d6bb08328012d363..8d17025dfd5e421665c54af101ba0fd0c16c4e3e 100644 (file)
@@ -54,8 +54,7 @@ class WebTest_Mailing_SpoolTest extends CiviSeleniumTestCase {
     $this->assertNotEmpty( $cid, 'Could not find cid after adding contact' );
 
     // Send an email to the added contact
-    $this->open( $this->sboxPath . 'civicrm/activity/email/add?action=add&reset=1&cid=' . $cid . '&selectedChild=activity&atype=3' );
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage("activity/email/add", "action=add&reset=1&cid={$cid}&selectedChild=activity&atype=3");
     $this->type( 'subject', 'test spool' );
     $this->fillRichTextField( 'html_message', 'Unit tests keep children safe.' );
     $this->click( "_qf_Email_upload" );