-- applied patches and made some modifications
authorRavish Nair <ravish@ravish.(none)>
Wed, 6 Mar 2013 13:10:50 +0000 (18:40 +0530)
committerRavish Nair <ravish@ravish.(none)>
Wed, 6 Mar 2013 13:10:50 +0000 (18:40 +0530)
tests/phpunit/WebTest/Member/InheritedMembershipTest.php
tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php
tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php
tests/phpunit/WebTest/Report/LoggingReportTest.php
tests/phpunit/WebTest/Report/RolePermissionReportTest.php

index e13cd3647898c1feb784f733e470ff441832ca43..28c573c762e6d5892a96bdfaaab69e5f55c52144 100644 (file)
@@ -162,7 +162,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase {
     $this->click('quick-save');
     $this->waitForElementPresent('current-relationships');
     //check the status message
-    $this->assertTrue($this->isTextPresent('New relationship created.'));
+    $this->assertElementContainsText('crm-notification-container', 'New relationship created.');
 
     $this->waitForElementPresent("xpath=//div[@id='current-relationships']//div//table/tbody//tr/td[9]/span/a[text()='View']");
 
@@ -213,7 +213,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase {
 
     //verify inherited membership has been removed
     $this->openCiviPage("contact/view", "reset=1&cid=$id&selectedChild=member", "xpath=//div[@class='crm-container-snippet']/div/div[3]");
-    $this->assertTrue($this->isTextPresent('No memberships have been recorded for this contact.'));
+    $this->assertElementContainsText('Memberships', 'No memberships have been recorded for this contact.');
 
     // visit relationship tab and re-enable the relationship
     $this->click('css=li#tab_rel a');
@@ -250,7 +250,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase {
 
     //verify inherited membership has been removed
     $this->openCiviPage("contact/view", "reset=1&cid={$id}&selectedChild=member", "xpath=//div[@class='crm-container-snippet']/div/div[3]");
-    $this->assertTrue($this->isTextPresent('No memberships have been recorded for this contact.'));
+    $this->assertElementContainsText('Memberships', 'No memberships have been recorded for this contact.');
 
     //enable relationship
     $this->click('css=li#tab_rel a');
index a964a4490cd9d6f478189f39f8124f25436b5da1..4498de2d495fa540ee88fe89353e7efcb35a81c5 100644 (file)
@@ -151,7 +151,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa
     $this->waitForElementPresent('_qf_Field_next-bottom');
     $this->click('_qf_Field_next-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->assertTrue($this->isTextPresent("Price Field '{$fields[0]}' has been saved."));
+    $this->assertElementContainsText('crm-notification-container', "Price Field '{$fields[0]}' has been saved.");
 
     // load the Price Set Preview and check for expected values
     $this->_testVerifyPriceSet($validateStrings, $sid);
index 866f75bdc300d044fabf8910efd2d21c796051bb..07b74664e88728aee350f1f2eed1393cd6b36e16 100644 (file)
@@ -126,7 +126,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     $this->assertType('numeric', $sid);
 
     $fields = array("National Membership $title", "Radio");
-    $this->open($this->sboxPath . "civicrm/admin/price/field?reset=1&action=add&sid={$sid}");
+    $this->openCiviPage('admin/price/field', "reset=1&action=add&sid={$sid}");
     
     $validateStrings[] = $fields[0];
     $this->type('label', $fields[0]);
@@ -168,7 +168,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     $this->waitForElementPresent('_qf_Field_next-bottom');
     $this->click('_qf_Field_next-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->assertTrue($this->isTextPresent("Price Field '{$fields[0]}' has been saved."));
+    $this->assertElementContainsText('crm-notification-container', "Price Field '{$fields[0]}' has been saved.");
  
     // load the Price Set Preview and check for expected values
     $this->_testVerifyPriceSet($validateStrings, $sid);
@@ -199,9 +199,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
   }
 
   function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) {
-    $this->open($this->sboxPath . 'civicrm/admin/price?reset=1&action=add');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Set_next-bottom');
+    $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom');
 
     // Enter Priceset fields (Title, Used For ...)
     $this->type('title', $setTitle);
@@ -224,7 +222,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
 
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->waitForElementPresent('_qf_Field_next-bottom');
-    $this->assertTrue($this->isTextPresent("Your Set '{$setTitle}' has been added. You can add fields to this set now."));
+    $this->assertElementContainsText('crm-notification-container', "Your Set '{$setTitle}' has been added. You can add fields to this set now.");
   }
 
   function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $contributionType) {
@@ -238,7 +236,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     $memTypeId2     = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/div[2]/table/tbody//tr/td[text()='{$memTypeTitle2}']/../td[12]/span/a[3]@href"));
     $memTypeId2     = $memTypeId2[1];
 
-    $this->open($this->sboxPath . "civicrm/admin/price/field?reset=1&action=add&sid={$sid}");
+    $this->openCiviPage('admin/price/field', "reset=1&action=add&sid={$sid}");
 
     foreach ($fields as $label => $type) {
       $validateStrings[] = $label;
@@ -284,7 +282,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
       $this->click('_qf_Field_next_new-bottom');
       $this->waitForPageToLoad($this->getTimeoutMsec());
       $this->waitForElementPresent('_qf_Field_next-bottom');
-      $this->assertTrue($this->isTextPresent("Price Field '{$label}' has been saved."));
+      $this->assertElementContainsText('crm-notification-container', "Price Field '{$label}' has been saved.");
     }
     return array($memTypeTitle1, $memTypeTitle2);
   }
@@ -292,8 +290,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
   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->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('admin/price', 'reset=1');
 
     // Use the price set id ($sid) to pick the correct row
     $this->click("css=tr#row_{$sid} a[title='Preview Price Set']");
@@ -307,23 +304,20 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
   }
 
   function _testVerifyRegisterPage($contributionPageTitle) {
-    $this->open($this->sboxPath . 'civicrm/admin/contribute?reset=1');
-    $this->waitForElementPresent('_qf_SearchContribution_refresh');
+    $this->openCiviPage('admin/contribute', 'reset=1', '_qf_SearchContribution_refresh');
     $this->type('title', $contributionPageTitle);
     $this->click('_qf_SearchContribution_refresh');
     $this->waitForPageToLoad('50000');
     $id          = $this->getAttribute("//div[@id='configure_contribution_page']//div[@class='dataTables_wrapper']/table/tbody/tr@id");
     $id          = explode('_', $id);
-    $registerUrl = "civicrm/contribute/transact?reset=1&id=$id[1]";
+    $registerUrl = array('url' => 'contribute/transact', 'args' => "reset=1&id=$id[1]");
     return $registerUrl;
   }
 
   function _testSignUpOrRenewMembership($registerUrl, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = FALSE) {
-    $this->open($this->sboxPath . 'civicrm/logout?reset=1');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('logout', 'reset=1');
 
-    $this->open($this->sboxPath . $registerUrl);
-    $this->waitForElementPresent('_qf_Main_upload-bottom');
+    $this->openCiviPage($registerUrl['url'], $registerUrl['args'], '_qf_Main_upload-bottom');
 
     //build the membership dates.
     require_once 'CRM/Core/Config.php';
@@ -385,14 +379,13 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     // Log in using webtestLogin() method
     $this->webtestLogin();
 
-    $this->open($this->sboxPath . "civicrm/member/search?reset=1");
-    $this->waitForElementPresent("member_end_date_high");
+    $this->openCiviPage('member/search', 'reset=1', 'member_end_date_high');
 
     $this->type("sort_name", "{$contactParams['first_name']} {$contactParams['last_name']}");
     $this->click("_qf_Search_refresh");
 
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->assertTrue($this->isTextPresent("2 Results "));
+    $this->assertElementContainsText('crm-container', '2 Results');
 
     $this->waitForElementPresent("xpath=//div[@id='memberSearch']/table/tbody/tr");
     $this->click("xpath=//div[@id='memberSearch']/table/tbody//tr/td[4][text()='{$memTypeTitle1}']/../td[11]/span/a[text()='View']");
@@ -434,8 +427,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
   
   function _testMultilpeTermsMembershipRegistration($registerUrl, $contactParams, $memTypeTitle1, $term, $renew = FALSE){
     if($renew){
-      $this->open($this->sboxPath . "civicrm/member/search?reset=1");
-      $this->waitForElementPresent("member_end_date_high");
+      $this->openCiviPage('member/search', 'reset=1', 'member_end_date_high');
       $this->type("sort_name", "{$contactParams['first_name']} {$contactParams['last_name']}");
       $this->click("_qf_Search_refresh");
       $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -446,11 +438,9 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
       $prevYear = substr($year, 0, 4);
     }
     
-    $this->open($this->sboxPath . 'civicrm/logout?reset=1');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('logout', 'reset=1');
 
-    $this->open($this->sboxPath . $registerUrl);
-    $this->waitForElementPresent('_qf_Main_upload-bottom');
+    $this->openCiviPage($registerUrl['url'], $registerUrl['args'], '_qf_Main_upload-bottom');
 
     //build the membership dates.
     require_once 'CRM/Core/Config.php';
@@ -514,14 +504,13 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     // Log in using webtestLogin() method
     $this->webtestLogin();
 
-    $this->open($this->sboxPath . "civicrm/member/search?reset=1");
-    $this->waitForElementPresent("member_end_date_high");
+    $this->openCiviPage('member/search', 'reset=1', 'member_end_date_high');
 
     $this->type("sort_name", "{$contactParams['first_name']} {$contactParams['last_name']}");
     $this->click("_qf_Search_refresh");
 
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->assertTrue($this->isTextPresent("1 Result "));
+    $this->assertElementContainsText('crm-container', '1 Result ');
 
     $this->waitForElementPresent("xpath=//div[@id='memberSearch']/table/tbody/tr");
     $this->click("xpath=//div[@id='memberSearch']/table/tbody//tr/td[4][text()='{$memTypeTitle1}']/../td[11]/span/a[text()='View']");
index af55bc2383763b872da389c22f1df0ef12379487..a505ff02d05373c9493345617657df26a83444d8 100644 (file)
@@ -46,7 +46,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $this->webtestLogin();
 
     //enable the logging
-    $this->open($this->sboxPath . "civicrm/admin/setting/misc?reset=1");
+    $this->openCiviPage('admin/setting/misc', 'reset=1');
     $this->click("xpath=//tr[@class='crm-miscellaneous-form-block-logging']/td[2]/label[text()='Yes']");
     $this->click("_qf_Miscellaneous_next-top");
     $this->waitForTextPresent("Changes Saved");
@@ -190,8 +190,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     //visit the logging contact summary report
-    $this->open($this->sboxPath . "civicrm/report/logging/contact/summary?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('report/logging/contact/summary', 'reset=1');
     $this->type('altered_contact_value', $firstName);
     $this->click("_qf_LoggingSummary_submit");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -268,11 +267,11 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $this->detailReportCheck($dataForReportDetail, $filters);
 
     //delete contact check
-    $this->open($this->sboxPath . "civicrm/contact/view/delete?&reset=1&delete=1&cid={$cid[1]}");
+    $this->openCiviPage('contact/view/delete', "reset=1&delete=1&cid={$cid[1]}");
     $this->click("_qf_Delete_done");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->open($this->sboxPath . "civicrm/report/logging/contact/summary?reset=1");
+    $this->openCiviPage('report/logging/contact/summary', 'reset=1');
     $this->click("_qf_LoggingSummary_submit");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -280,7 +279,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $this->verifyReportData($contactDataDelete);
 
     //disable the logging
-    $this->open($this->sboxPath . "civicrm/admin/setting/misc?reset=1");
+    $this->openCiviPage('admin/setting/misc', 'reset=1');
     $this->click("xpath=//tr[@class='crm-miscellaneous-form-block-logging']/td[2]/label[text()='No']");
     $this->click("_qf_Miscellaneous_next-top");
     $this->waitForTextPresent("Changes Saved");
@@ -319,8 +318,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
       }
 
     //visit the logging contact summary report
-    $this->open($this->sboxPath . "civicrm/report/logging/contact/summary?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('report/logging/contact/summary', 'reset=1');
     foreach ($filters as $type => $filter) {
       if ($type == 'text' ) {
         foreach ($filter as $filterName => $filterValue) {
index 8d4e09bd546199e0839edf13ef07f5f28c0a9e78..6f70183cef8d6c1e76e5af64cb3938b5ea9808f4 100644 (file)
@@ -84,8 +84,7 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase {
     $this->changePermissions($permissions);
 
     // change report setting to for a particular role
-    $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('report/instance/1', 'reset=1');
     $this->click("css=div.crm-report_setting-accordion div.crm-accordion-header");
     $this->waitForElementPresent("_qf_Summary_submit_save");
     $this->select("permission", "value=access CiviCRM");
@@ -93,20 +92,17 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase {
     $this->click("add");
     $this->click("_qf_Summary_submit_save");
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->open($this->sboxPath . "civicrm/logout?reset=1");
+    $this->openCiviPage('logout','reset=1');
     $this->open($this->sboxPath);
     $this->waitForElementPresent('edit-submit');
     $this->type('edit-name', $user2);
     $this->type('edit-pass', 'Test12345');
     $this->click('edit-submit');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->assertTrue($this->isTextPresent("You do not have permission to access this report."));
-    $this->open($this->sboxPath . "civicrm/report/list?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->open($this->sboxPath . "civicrm/logout?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('report/instance/1', 'reset=1');
+    $this->assertElementContainsText('crm-container', 'You do not have permission to access this report.');
+    $this->openCiviPage('report/list', 'reset=1');
+    $this->openCiviPage('logout', 'reset=1');
 
     //delete roles
     $this->webtestLogin(TRUE);
@@ -145,8 +141,7 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase {
     $roleId = explode('/', $this->getAttribute("xpath=//table[@id='user-roles']/tbody//tr/td[1][text()='{$role}']/../td[4]/a[text()='edit permissions']/@href"));
     $roleId = end($roleId);
     $user = $this->_testCreateUser($roleId);
-    $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('report/instance/1', 'reset=1');
     if ($this->isChecked("is_reserved")) {
       $this->click("is_reserved");
       $this->click("_qf_Summary_submit_save");
@@ -160,20 +155,19 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase {
     );
     $this->changePermissions($permissions);
 
-    $this->open($this->sboxPath . "civicrm/logout?reset=1");
+    $this->openCiviPage('logout', 'reset=1');
     $this->open($this->sboxPath);
     $this->waitForElementPresent('edit-submit');
     $this->type('edit-name', $user);
     $this->type('edit-pass', 'Test12345');
     $this->click('edit-submit');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('report/instance/1', 'reset=1');
 
     //check if the reserved report field is frozen
     $this->assertTrue($this->isElementPresent("xpath=//div[@id='instanceForm']//table[3]/tbody//tr/td[2]/tt[text()='[ ]']"));
 
-    $this->open($this->sboxPath . "civicrm/logout?reset=1");
+    $this->openCiviPage('logout', 'reset=1');
     $this->open($this->sboxPath);
     $this->webtestLogin(TRUE);
     // let's give full CiviReport permissions.
@@ -186,30 +180,28 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase {
     );
     $this->changePermissions($permissions);
 
-    $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('report/instance/1', 'reset=1');
 
     //make the report reserved
     $this->click("is_reserved");
     $this->click("_qf_Summary_submit_save");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->open($this->sboxPath . "civicrm/logout?reset=1");
+    $this->openCiviPage('logout', 'reset=1');
     $this->open($this->sboxPath);
     $this->waitForElementPresent('edit-submit');
     $this->type('edit-name', $user);
     $this->type('edit-pass', 'Test12345');
     $this->click('edit-submit');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('report/instance/1', 'reset=1');
 
     //check if the report criteria and settings is accessible
     $this->assertTrue($this->isElementPresent("xpath=//form[@id='Summary']//div[@id='id_default']//input[@id='fields_email']"));
     $this->assertTrue($this->isElementPresent("xpath=//form[@id='Summary']//div[@id='instanceForm']/table//input[@id='title']"));
 
     //login as admin and remove reserved permission
-    $this->open($this->sboxPath . "civicrm/logout?reset=1");
+    $this->openCiviPage('logout', 'reset=1');
     $this->open($this->sboxPath);
     $this->webtestLogin(TRUE);
     $this->open($this->sboxPath . "admin/people/permissions");
@@ -224,15 +216,14 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     //login as user and check for absence of report criteria and settings
-    $this->open($this->sboxPath . "civicrm/logout?reset=1");
+    $this->openCiviPage('logout', 'reset=1');
     $this->open($this->sboxPath);
     $this->waitForElementPresent('edit-submit');
     $this->type('edit-name', $user);
     $this->type('edit-pass', 'Test12345');
     $this->click('edit-submit');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('report/instance/1', 'reset=1');
 
     if ($this->isElementPresent("xpath=//form[@id='Summary']/div[2]/div/div/div")) {
       $this->verifyNotText("xpath=//form[@id='Summary']/div[2]/div/div/div", "Report Criteria");
@@ -244,30 +235,28 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase {
     $this->assertFalse($this->isElementPresent("xpath=//form[@id='Summary']//div[@id='instanceForm']//input[@id='title']"));
 
     //login as admin and turn the is_reserved flag off for the instance
-    $this->open($this->sboxPath . "civicrm/logout?reset=1");
+    $this->openCiviPage('logout', 'reset=1');
     $this->open($this->sboxPath);
     $this->webtestLogin(TRUE);
-    $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('report/instance/1', 'reset=1');
     $this->click("is_reserved");
     $this->click("_qf_Summary_submit_save");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->open($this->sboxPath . "civicrm/logout?reset=1");
+    $this->openCiviPage('logout', 'reset=1');
     $this->open($this->sboxPath);
     $this->waitForElementPresent('edit-submit');
     $this->type('edit-name', $user);
     $this->type('edit-pass', 'Test12345');
     $this->click('edit-submit');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->openCiviPage('report/instance/1', 'reset=1');
 
     $this->assertTrue($this->isElementPresent("xpath=//form[@id='Summary']//div[@id='id_default']//input[@id='fields_email']"));
     $this->assertTrue($this->isElementPresent("xpath=//form[@id='Summary']//div[@id='instanceForm']//input[@id='title']"));
 
     //login as admin and delete the role
-    $this->open($this->sboxPath . "civicrm/logout?reset=1");
+    $this->openCiviPage('logout', 'reset=1');
     $this->open($this->sboxPath);
     $this->webtestLogin(TRUE);
     $this->open($this->sboxPath . "admin/people/permissions/roles");