Fixed some contribution pages
[civicrm-core.git] / tests / phpunit / WebTest / Member / InheritedMembershipTest.php
index 28c573c762e6d5892a96bdfaaab69e5f55c52144..497bf2b16ea2f4901e68e8b91808ba041090d435 100644 (file)
@@ -31,11 +31,6 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase {
   }
 
   function testInheritedMembership() {
-    // 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();
 
@@ -48,7 +43,6 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->assertElementContainsText('crm-notification-container', "Organization {$title} has been created.");
 
-    // Go directly to the URL
     $this->openCiviPage('admin/member/membershipType', 'reset=1&action=browse');
 
     $this->click('link=Add Membership Type');
@@ -246,6 +240,9 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase {
         $this->getConfirmation()
       ));
     $this->chooseOkOnNextConfirmation();
+    // Because it tends to cause problems, all uses of sleep() must be justified in comments
+    // Sleep should never be used for wait for anything to load from the server
+    // Justification for this instance: FIXME
     sleep(10);
 
     //verify inherited membership has been removed
@@ -263,7 +260,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase {
         $this->getConfirmation()
       ));
     $this->chooseOkOnNextConfirmation();
-    sleep(10);
+    $this->waitForPageToLoad($this->getTimeoutMsec());
 
     //verify membership
     $this->click('css=li#tab_member a');