[Fusionforge-commits] r14044 - in branches/Branch_5_1: . tests/func/RBAC

Roland Mas lolando at fusionforge.org
Tue Aug 2 16:23:31 CEST 2011


Author: lolando
Date: 2011-08-02 16:23:31 +0200 (Tue, 02 Aug 2011)
New Revision: 14044

Modified:
   branches/Branch_5_1/
   branches/Branch_5_1/tests/func/RBAC/rbacTest.php
Log:
Roles need to be emptied before deletion

Modified: branches/Branch_5_1/tests/func/RBAC/rbacTest.php
===================================================================
--- branches/Branch_5_1/tests/func/RBAC/rbacTest.php	2011-08-02 14:23:20 UTC (rev 14043)
+++ branches/Branch_5_1/tests/func/RBAC/rbacTest.php	2011-08-02 14:23:31 UTC (rev 14044)
@@ -236,8 +236,18 @@
 		$this->click ("//input[@type='checkbox' and @name='sure']") ;
 		$this->click ("//input[@value='Delete role']") ;
 		$this->waitForPageToLoad("30000");
+		$this->assertTrue($this->isTextPresent("Cannot remove a non empty role"));
 		$this->click("link=Site Admin");
 		$this->waitForPageToLoad("30000");
+		$this->select ("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']", "label=Temporary role") ;
+		$this->click ("//form[contains(@action,'globalroleedit.php')]//input[@value='Edit Role']") ;
+		$this->waitForPageToLoad("30000");
+		$this->click ("//a[contains(@href,'/users/trainee')]/../../td/input[@type='checkbox']") ;
+		$this->click ("//input[@name='reallyremove']") ;
+		$this->click ("//input[@name='dormusers']") ;
+		$this->waitForPageToLoad("30000");
+		$this->click("link=Site Admin");
+		$this->waitForPageToLoad("30000");
 		$this->assertFalse($this->isElementPresent("//option[.='Temporary role']"));
 	}
 
@@ -537,6 +547,14 @@
 		$this->click ("//input[@type='checkbox' and @name='sure']") ;
 		$this->click ("//input[@value='Submit']") ;
 		$this->waitForPageToLoad("30000");
+		$this->assertTrue($this->isTextPresent("Cannot remove a non empty role"));
+		$this->click("//tr/td/div[contains(.,'Temporary role')]/../div/form/input[@name='username' and @value='trainee']/../input[@value='Remove']") ;
+		$this->waitForPageToLoad("30000");
+		$this->click ("//td/form/div[contains(.,'Temporary role')]/../div/input[@value='Delete role']") ;
+		$this->waitForPageToLoad("30000");
+		$this->click ("//input[@type='checkbox' and @name='sure']") ;
+		$this->click ("//input[@value='Submit']") ;
+		$this->waitForPageToLoad("30000");
 		$this->assertFalse($this->isTextPresent("Temporary role"));
 	}
 }




More information about the Fusionforge-commits mailing list