$this->assertTrue($this->isTextPresent("Project Information"));
$this->click("link=Users and permissions");
$this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Members of ProjectA"));
+ $this->assertTrue($this->isTextPresent("Current Project Members"));
$this->click("//tr/td/form/div[contains(.,'Anonymous')]/../../../td/form/div/input[contains(@value,'Unlink Role')]");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("Role unlinked successfully"));
function testGlobalRolesAndPermissions()
{
- $this->login("admin");
+ $this->login(FORGE_ADMIN_USERNAME);
$this->click("link=Site Admin");
$this->waitForPageToLoad("30000");
// Non-regression test for Adacore ticket K802-005
// (Deletion of global roles)
- $this->switchUser("admin");
+ $this->switchUser(FORGE_ADMIN_USERNAME);
$this->click("link=Site Admin");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='role_name']", "Temporary role") ;
$this->click("link=Site Admin");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isElementPresent("//option[.='Temporary role']"));
- $this->select ("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']", "label=Project approvers") ;
+ $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->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='form_unix_name']", "toto") ;
$this->click ("//input[@value='Add User']") ;
$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 ("//a[contains(@href,'/users/toto')]/../../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->assertTrue($this->isElementPresent("//option[.='Temporary role']"));
+ $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 ("//input[@type='checkbox' and @name='sure']") ;
+ $this->click ("//input[@value='Delete role']") ;
+ $this->waitForPageToLoad("30000");
$this->assertFalse($this->isElementPresent("//option[.='Temporary role']"));
}
function testProjectRolesAndPermissions()
{
- $this->populateStandardTemplate('trackers');
+ $this->populateStandardTemplate('all');
$this->createUser ("bigboss") ;
$this->createUser ("guru") ;
// Non-regression test for Adacore ticket K802-005
// (Deletion of project-wide roles)
- $this->switchUser("admin");
+ $this->switchUser(FORGE_ADMIN_USERNAME);
$this->gotoProject ("MetaProject") ;
$this->click("link=Admin");
$this->waitForPageToLoad("30000");
$this->select("//input[@value='Add Member']/../select[@name='role_id']", "label=Temporary role");
$this->click ("//input[@value='Add Member']") ;
$this->waitForPageToLoad("30000");
- $this->click ("//td/form/div[contains(.,'Temporary role')]/../div/input[@value='Delete role']") ;
+ $this->click ("//td/form/div[contains(.,'Temporary role')]/../../form/div/input[@value='Delete role']") ;
$this->waitForPageToLoad("30000");
$this->click ("//input[@type='checkbox' and @name='sure']") ;
$this->click ("//input[@value='Submit']") ;
$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->click ("//td/form/div[contains(.,'Temporary role')]/../../form/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"));
+
+ // Non-regression test
+ $this->click("link=Site Admin");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Display Full Project List/Edit Projects");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=SubProject");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Permanently Delete Project");
+ $this->waitForPageToLoad("30000");
+ $this->click("sure");
+ $this->click("reallysure");
+ $this->click("reallyreallysure");
+ $this->click("submit");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Home");
+ $this->waitForPageToLoad("30000");
+ $this->assertFalse($this->isTextPresent("SubProject"));
+
+ // Make sure permissions are saved for news-related forums
+ $this->switchUser(FORGE_ADMIN_USERNAME);
+ $this->gotoProject ("MetaProject") ;
+
+ $this->click("link=News");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Submit");
+ $this->waitForPageToLoad("30000");
+ $this->type("summary", "First news");
+ $this->type("details", "This is a simple news.");
+ $this->click("submit");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=News");
+ $this->waitForPageToLoad("30000");
+ $this->assertTrue($this->isTextPresent("First news"));
+ $this->click("link=First news");
+ $this->waitForPageToLoad("30000");
+ $this->assertTrue($this->isTextPresent("First news"));
+ $this->assertTrue($this->isTextPresent("This is a simple news."));
+
+ $this->click("link=Admin");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Users and permissions");
+ $this->waitForPageToLoad("30000");
+ $this->click ("//td/form/div[contains(.,'Anonymous')]/../div/input[@value='Edit Permissions']") ;
+ $this->waitForPageToLoad("30000");
+
+ $this->select("//tr/td[contains(.,'first-news')]/../td/select", "label=Read only");
+ $this->click ("//input[@value='Submit']") ;
+ $this->waitForPageToLoad("30000");
+ $this->assertSelected("//tr/td[contains(.,'first-news')]/../td/select", "Read only");
+
+ $this->select("//tr/td[contains(.,'first-news')]/../td/select", "label=Moderated post");
+ $this->click ("//input[@value='Submit']") ;
+ $this->waitForPageToLoad("30000");
+ $this->assertSelected("//tr/td[contains(.,'first-news')]/../td/select", "Moderated post");
+
+ $this->select("//tr/td[contains(.,'first-news')]/../td/select", "label=Unmoderated post");
+ $this->click ("//input[@value='Submit']") ;
+ $this->waitForPageToLoad("30000");
+ $this->assertSelected("//tr/td[contains(.,'first-news')]/../td/select", "Unmoderated post");
}
}
-?>