/**
* Copyright 2010-2011, Roland Mas
* Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * Copyright 2013-2014, Franck Villaume - TrivialDev
+ * Copyright 2013-2014,2019, Franck Villaume - TrivialDev
* Copyright (C) 2015 Inria (Sylvain Beucler)
*
* This file is part of FusionForge.
$this->waitForPageToLoad("30000");
// Grant it permissions
- $this->select("//select[@name='data[approve_projects][-1]']", "label=Approve projects");
- $this->select("//select[@name='data[approve_news][-1]']", "label=Approve news");
+ $this->select($this->byXpath("//select[@name='data[approve_projects][-1]']"))->selectOptionByLabel("Approve projects");
+ $this->select($this->byXpath("//select[@name='data[approve_news][-1]']"))->selectOptionByLabel("Approve news");
$this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
// Check permissions were saved
$this->clickAndWait("link=Site Admin");
$this->waitForPageToLoad("30000");
- $this->select ("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']", "label=Project approvers") ;
+ $this->select($this->byXpath("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']"))->selectOptionByLabel("Project approvers") ;
$this->clickAndWait("//form[contains(@action,'globalroleedit.php')]//input[@value='Edit Role']") ;
$this->waitForPageToLoad("30000");
$this->assertSelected("//select[@name='data[approve_news][-1]']", "Approve news");
// Whoops, we don't actually want the news moderation bit, unset it
- $this->select("//select[@name='data[approve_news][-1]']", "label=No Access");
+ $this->select($this->byXpath("//select[@name='data[approve_news][-1]']"))->selectOptionByLabel("No Access");
$this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
$this->assertSelected("//select[@name='data[approve_projects][-1]']", "Approve projects");
// Add them to their respective roles, check they're here
$this->clickAndWait("link=Site Admin");
$this->waitForPageToLoad("30000");
- $this->select ("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']", "label=Project approvers") ;
+ $this->select($this->byXpath("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']"))->selectOptionByLabel("Project approvers");
$this->clickAndWait("//form[contains(@action,'globalroleedit.php')]//input[@value='Edit Role']") ;
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='form_unix_name']", "projapp") ;
$this->clickAndWait("link=Site Admin");
$this->waitForPageToLoad("30000");
- $this->select ("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']", "label=News moderators") ;
+ $this->select($this->byXpath("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']"))->selectOptionByLabel("News moderators") ;
$this->clickAndWait("//form[contains(@action,'globalroleedit.php')]//input[@value='Edit Role']") ;
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='form_unix_name']", "newsmod") ;
// (For cases where project_registration_restricted=true)
$this->clickAndWait("link=Site Admin");
$this->waitForPageToLoad("30000");
- $this->select ("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']", "label=Project approvers") ;
+ $this->select($this->byXpath("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']"))->selectOptionByLabel("Project approvers");
$this->clickAndWait("//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") ;
// Revoke project approval rights
$this->clickAndWait("link=Site Admin");
$this->waitForPageToLoad("30000");
- $this->select ("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']", "label=Project approvers") ;
+ $this->select($this->byXpath("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']"))->selectOptionByLabel("Project approvers");
$this->clickAndWait("//form[contains(@action,'globalroleedit.php')]//input[@value='Edit Role']") ;
$this->waitForPageToLoad("30000");
$this->clickAndWait("//a[contains(@href,'/users/toto')]/../../td/input[@type='checkbox']") ;
// Submit a news in the project
$this->switchUser ("toto") ;
$this->gotoProject ("TotoProject") ;
- $this->click("link=News") ;
+ $this->clickAndWait"link=News") ;
$this->waitForPageToLoad("30000");
- $this->click("link=Submit") ;
+ $this->clickAndWait("link=Submit") ;
$this->waitForPageToLoad("30000");
$this->type("summary", "First TotoNews");
$this->type("details", "This is a simple news for Toto's project.");
- $this->click("submit");
+ $this->clickAndWait("submit");
$this->waitForPageToLoad("30000");
// Try to push it to front page with user toto
$this->waitForPageToLoad("30000");
$this->assertTrue ($this->isTextPresent("These items need to be approved")) ;
$this->assertTrue ($this->isTextPresent("First TotoNews")) ;
- $this->click ("//a[contains(.,'First TotoNews')]") ;
+ $this->clickAndWait("//a[contains(.,'First TotoNews')]") ;
$this->waitForPageToLoad("30000");
- $this->click ("//input[@type='radio' and @value='1']") ;
- $this->click ("submit") ;
+ $this->clickAndWait("//input[@type='radio' and @value='1']") ;
+ $this->clickAndWait("submit") ;
$this->waitForPageToLoad("30000");
$this->assertTrue ($this->isTextPresent("These items were approved this past week")) ;
$this->open( ROOT ) ;
$this->open( ROOT ) ;
$this->waitForPageToLoad("30000");
$this->assertTrue ($this->isTextPresent("First TotoNews")) ;
- $this->click("link=First TotoNews") ;
+ $this->clickAndWait("link=First TotoNews") ;
$this->waitForPageToLoad("30000");
$this->assertFalse ($this->isPermissionDenied()) ;
// Non-regression test for Adacore ticket K802-005
// (Deletion of global roles)
$this->switchUser(FORGE_ADMIN_USERNAME);
- $this->click("link=Site Admin");
+ $this->clickAndWait("link=Site Admin");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='role_name']", "Temporary role") ;
- $this->click ("//form[contains(@action,'globalroleedit.php')]//input[@value='Create Role']") ;
+ $this->clickAndWait("//form[contains(@action,'globalroleedit.php')]//input[@value='Create Role']") ;
$this->waitForPageToLoad("30000");
- $this->click("link=Site Admin");
+ $this->clickAndWait("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->select($this->byXpath("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']"))->selectOptionByLabel("Temporary role");
+ $this->clickAndWait("//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->clickAndWait("//input[@value='Add User']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("toto Lastname"));
- $this->click ("//input[@type='checkbox' and @name='sure']") ;
- $this->click ("//input[@value='Delete role']") ;
+ $this->clickAndWait("//input[@type='checkbox' and @name='sure']") ;
+ $this->clickAndWait("//input[@value='Delete role']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("Cannot remove a non empty role"));
- $this->click("link=Site Admin");
+ $this->clickAndWait("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->select($this->byXpath("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']"))->selectOptionByLabel("Temporary role");
+ $this->clickAndWait("//form[contains(@action,'globalroleedit.php')]//input[@value='Edit Role']") ;
$this->waitForPageToLoad("30000");
- $this->click ("//a[contains(@href,'/users/toto')]/../../td/input[@type='checkbox']") ;
- $this->click ("//input[@name='reallyremove']") ;
- $this->click ("//input[@name='dormusers']") ;
+ $this->clickAndWait("//a[contains(@href,'/users/toto')]/../../td/input[@type='checkbox']") ;
+ $this->clickAndWait("//input[@name='reallyremove']") ;
+ $this->clickAndWait("//input[@name='dormusers']") ;
$this->waitForPageToLoad("30000");
- $this->click("link=Site Admin");
+ $this->clickAndWait("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->select($this->byXpath("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']"))->selectOptionByLabel("Temporary role");
+ $this->clickAndWait("//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->clickAndWait("//input[@type='checkbox' and @name='sure']") ;
+ $this->clickAndWait("//input[@value='Delete role']") ;
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isElementPresent("//option[.='Temporary role']"));
}
$this->createUser ("trainee") ;
// Create "Project moderators" role
- $this->click("link=Site Admin");
+ $this->clickAndWait("link=Site Admin");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='role_name']", "Project moderators") ;
- $this->click ("//form[contains(@action,'globalroleedit.php')]//input[@value='Create Role']") ;
+ $this->clickAndWait("//form[contains(@action,'globalroleedit.php')]//input[@value='Create Role']") ;
$this->waitForPageToLoad("30000");
// Grant it permissions
- $this->select("//select[@name='data[approve_projects][-1]']", "label=Approve projects");
- $this->click ("//input[@value='Submit']") ;
+ $this->select($this->byXpath("//select[@name='data[approve_projects][-1]']"))->selectOptionByLabel("Approve projects");
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
// Add bigboss
$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='form_unix_name']", "bigboss") ;
- $this->click ("//input[@value='Add User']") ;
+ $this->clickAndWait("//input[@value='Add User']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("bigboss Lastname"));
// Create "Documentation masters" role
- $this->click("link=Site Admin");
+ $this->clickAndWait("link=Site Admin");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='role_name']", "Documentation masters") ;
- $this->click ("//form[contains(@action,'globalroleedit.php')]//input[@value='Create Role']") ;
+ $this->clickAndWait("//form[contains(@action,'globalroleedit.php')]//input[@value='Create Role']") ;
$this->waitForPageToLoad("30000");
// Make it shared
- $this->click ("//input[@type='checkbox' and @name='public']") ;
- $this->click ("//input[@value='Submit']") ;
+ $this->clickAndWait("//input[@type='checkbox' and @name='public']") ;
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
// Add docmaster
$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='form_unix_name']", "docmaster") ;
- $this->click ("//input[@value='Add User']") ;
+ $this->clickAndWait("//input[@value='Add User']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("docmaster Lastname"));
// Create roles
$this->gotoProject ("MetaProject") ;
- $this->click("link=Admin");
+ $this->clickAndWait("link=Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'roleedit.php')]/..//input[@name='role_name']", "Senior Developer") ;
- $this->click ("//input[@value='Create Role']") ;
+ $this->clickAndWait("//input[@value='Create Role']") ;
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'roleedit.php')]/..//input[@name='role_name']", "Junior Developer") ;
- $this->click ("//input[@value='Create Role']") ;
+ $this->clickAndWait("//input[@value='Create Role']") ;
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'roleedit.php')]/..//input[@name='role_name']", "Doc Writer") ;
- $this->click ("//input[@value='Create Role']") ;
+ $this->clickAndWait("//input[@value='Create Role']") ;
$this->waitForPageToLoad("30000");
// Add users
$this->gotoProject ("MetaProject") ;
- $this->click("link=Admin");
+ $this->clickAndWait("link=Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'users.php')]//input[@name='form_unix_name' and @type='text']", "guru") ;
- $this->select("//input[@value='Add Member']/../fieldset/select[@name='role_id']", "label=Senior Developer");
- $this->click ("//input[@value='Add Member']") ;
+ $this->select($this->byXpath("//input[@value='Add Member']/../fieldset/select[@name='role_id']"))->selectOptionByLabel("Senior Developer");
+ $this->clickAndWait("//input[@value='Add Member']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("guru Lastname"));
$this->assertTrue($this->isElementPresent("//tr/td/a[.='guru Lastname']/../../td/div[contains(.,'Senior Developer')]")) ;
$this->type ("//form[contains(@action,'users.php')]//input[@name='form_unix_name' and @type='text']", "trainee") ;
- $this->select("//input[@value='Add Member']/../fieldset/select[@name='role_id']", "label=Junior Developer");
- $this->click ("//input[@value='Add Member']") ;
+ $this->select($this->byXpath("//input[@value='Add Member']/../fieldset/select[@name='role_id']"))->selectOptionByLabel("Junior Developer");
+ $this->clickAndWait("//input[@value='Add Member']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("trainee Lastname"));
$this->assertTrue($this->isElementPresent("//tr/td/a[.='trainee Lastname']/../../td/div[contains(.,'Junior Developer')]")) ;
$this->type ("//form[contains(@action,'users.php')]//input[@name='form_unix_name' and @type='text']", "docmaster") ;
- $this->select("//input[@value='Add Member']/../fieldset/select[@name='role_id']", "label=Doc Writer");
- $this->click ("//input[@value='Add Member']") ;
+ $this->select($this->byXpath("//input[@value='Add Member']/../fieldset/select[@name='role_id']"))->selectOptionByLabel("Doc Writer");
+ $this->clickAndWait("//input[@value='Add Member']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("docmaster Lastname"));
$this->assertTrue($this->isElementPresent("//tr/td/a[.='docmaster Lastname']/../../td/div[contains(.,'Doc Writer')]")) ;
$this->type ("//form[contains(@action,'users.php')]//input[@name='form_unix_name' and @type='text']", "bigboss") ;
- $this->select("//input[@value='Add Member']/../fieldset/select[@name='role_id']", "label=Senior Developer");
- $this->click ("//input[@value='Add Member']") ;
+ $this->select($this->byXpath("//input[@value='Add Member']/../fieldset/select[@name='role_id']"))->selectOptionByLabel("Senior Developer");
+ $this->clickAndWait("//input[@value='Add Member']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("bigboss Lastname"));
$this->assertTrue($this->isElementPresent("//tr/td/div[contains(.,'Senior Developer')]/..//input[@value='Remove']/../input[@name='username' and @value='bigboss']")) ;
// Oops, bigboss doesn't need the extra role after all
- $this->click("//tr/td/div[contains(.,'Senior Developer')]/../div/form/input[@name='username' and @value='bigboss']/../input[@value='Remove']") ;
+ $this->clickAndWait("//tr/td/div[contains(.,'Senior Developer')]/../div/form/input[@name='username' and @value='bigboss']/../input[@value='Remove']") ;
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isElementPresent("//tr/td/div[contains(.,'Senior Developer')]/../div/form/input[@value='Remove']/../input[@name='username' and @value='bigboss']")) ;
// Remove/re-add a user
- $this->click("//tr/td/div[contains(.,'Junior Developer')]/../div/form/input[@name='username' and @value='trainee']/../input[@value='Remove']") ;
+ $this->clickAndWait("//tr/td/div[contains(.,'Junior Developer')]/../div/form/input[@name='username' and @value='trainee']/../input[@value='Remove']") ;
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("trainee Lastname"));
$this->type ("//form[contains(@action,'users.php')]//input[@name='form_unix_name' and @type='text']", "trainee") ;
- $this->select("//input[@value='Add Member']/../fieldset/select[@name='role_id']", "label=Junior Developer");
- $this->click ("//input[@value='Add Member']") ;
+ $this->select($this->byXpath("//input[@value='Add Member']/../fieldset/select[@name='role_id']"))->selectOptionByLabel("Junior Developer");
+ $this->clickAndWait("//input[@value='Add Member']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("trainee Lastname"));
$this->assertTrue($this->isElementPresent("//tr/td/a[.='trainee Lastname']/../../td/div[contains(.,'Junior Developer')]")) ;
// Edit permissions of the JD role
$this->gotoProject ("MetaProject") ;
- $this->click("link=Admin");
+ $this->clickAndWait("link=Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
- $this->click ("//td/form/div[contains(.,'Junior Developer')]/../div/input[@value='Edit Permissions']") ;
+ $this->clickAndWait("//td/form/div[contains(.,'Junior Developer')]/../div/input[@value='Edit Permissions']") ;
$this->waitForPageToLoad("30000");
- $this->select("//select[contains(@name,'data[frs_admin]')]", "label=FRS access");
- $this->select("//select[contains(@name,'data[docman]')]", "label=Read only");
- $this->click ("//input[@value='Submit']") ;
+ $this->select($this->byXpath("//select[contains(@name,'data[frs_admin]')]"))->selectOptionByLabel("FRS access");
+ $this->select($this->byXpath("//select[contains(@name,'data[docman]')]"))->selectOptionByLabel("Read only");
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
$this->assertSelected("//select[contains(@name,'data[docman]')]", "Read only");
$this->assertSelected("//select[contains(@name,'data[frs_admin]')]", "FRS access");
- $this->select("//select[contains(@name,'data[new_frs]')]", "label=Read only");
- $this->click ("//input[@value='Submit']") ;
+ $this->select($this->byXpath("//select[contains(@name,'data[new_frs]')]"))->selectOptionByLabel("Read only");
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
$this->assertSelected("//select[contains(@name,'data[new_frs]')]", "Read only");
// Check that SD is technician on trackers but DM isn't
- $this->click("link=Tracker");
+ $this->clickAndWait("link=Tracker");
$this->waitForPageToLoad("30000");
- $this->click("link=Bugs");
+ $this->clickAndWait("link=Bugs");
$this->waitForPageToLoad("30000");
- $this->click("link=Submit New");
+ $this->clickAndWait("link=Submit New");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isElementPresent("//select[@name='assigned_to']")) ;
$this->assertTrue($this->isElementPresent("//select[@name='assigned_to']/option[.='guru Lastname']")) ;
// Check that SD is a manager on trackers but JD isn't
$this->switchUser('guru');
$this->gotoProject ("MetaProject") ;
- $this->click("link=Tracker");
+ $this->clickAndWait("link=Tracker");
$this->waitForPageToLoad("30000");
- $this->click("link=Bugs");
+ $this->clickAndWait("link=Bugs");
$this->waitForPageToLoad("30000");
- $this->click("link=Submit New");
+ $this->clickAndWait("link=Submit New");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isElementPresent("//select[@name='assigned_to']")) ;
$this->switchUser('trainee');
$this->gotoProject ("MetaProject") ;
- $this->click("link=Tracker");
+ $this->clickAndWait("link=Tracker");
$this->waitForPageToLoad("30000");
- $this->click("link=Bugs");
+ $this->clickAndWait("link=Bugs");
$this->waitForPageToLoad("30000");
- $this->click("link=Submit New");
+ $this->clickAndWait("link=Submit New");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isElementPresent("//select[@name='assigned_to']")) ;
// Also check that guru isn't a manager on SubProject yet
$this->switchUser('guru');
$this->gotoProject ("SubProject") ;
- $this->click("link=Tracker");
+ $this->clickAndWait("link=Tracker");
$this->waitForPageToLoad("30000");
- $this->click("link=Bugs");
+ $this->clickAndWait("link=Bugs");
$this->waitForPageToLoad("30000");
- $this->click("link=Submit New");
+ $this->clickAndWait("link=Submit New");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isElementPresent("//select[@name='assigned_to']")) ;
// Mark SD role as shared
$this->switchUser('bigboss');
$this->gotoProject ("MetaProject") ;
- $this->click("link=Admin");
+ $this->clickAndWait("link=Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
- $this->click ("//td/form/div[contains(.,'Senior Developer')]/../div/input[@value='Edit Permissions']") ;
+ $this->clickAndWait("//td/form/div[contains(.,'Senior Developer')]/../div/input[@value='Edit Permissions']") ;
$this->waitForPageToLoad("30000");
- $this->click ("//input[@type='checkbox' and @name='public']") ;
- $this->click ("//input[@value='Submit']") ;
+ $this->clickAndWait("//input[@type='checkbox' and @name='public']") ;
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
// Link MetaProject/SD role into SubProject
$this->gotoProject ("SubProject") ;
- $this->click("link=Admin");
+ $this->clickAndWait("link=Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isElementPresent("//input[@value='Link external role']/../../div/fieldset/select/option[.='Senior Developer (in project MetaProject)']")) ;
- $this->select("//input[@value='Link external role']/../../div/fieldset/select", "label=Senior Developer (in project MetaProject)") ;
- $this->click("//input[@value='Link external role']") ;
+ $this->select($this->byXpath("//input[@value='Link external role']/../../div/fieldset/select"))->selectOptionByLabel("Senior Developer (in project MetaProject)") ;
+ $this->clickAndWait("//input[@value='Link external role']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isElementPresent("//td/form/div[contains(.,'Senior Developer (in project MetaProject)')]/../div/input[contains(@value,'Unlink Role')]"));
// Grant it tracker manager permissions
- $this->click ("//td/form/div[contains(.,'Senior Developer (in project MetaProject)')]/../div/input[@value='Edit Permissions']") ;
+ $this->clickAndWait("//td/form/div[contains(.,'Senior Developer (in project MetaProject)')]/../div/input[@value='Edit Permissions']") ;
$this->waitForPageToLoad("30000");
- $this->select("//select[contains(@name,'data[tracker]')]", "label=Manager");
- $this->click ("//input[@value='Submit']") ;
+ $this->select($this->byXpath("//select[contains(@name,'data[tracker]')]"))->selectOptionByLabel("Manager");
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
// Check that guru now has manager permissions on SubProject
$this->switchUser('guru');
$this->gotoProject ("SubProject") ;
- $this->click("link=Tracker");
+ $this->clickAndWait("link=Tracker");
$this->waitForPageToLoad("30000");
- $this->click("link=Bugs");
+ $this->clickAndWait("link=Bugs");
$this->waitForPageToLoad("30000");
- $this->click("link=Submit New");
+ $this->clickAndWait("link=Submit New");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isElementPresent("//select[@name='assigned_to']")) ;
// Link global "Documentation masters" role into SubProject
$this->switchUser ("bigboss") ;
$this->gotoProject ("SubProject") ;
- $this->click("link=Admin");
+ $this->clickAndWait("link=Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isElementPresent("//input[@value='Link external role']/../../div/fieldset/select/option[.='Documentation masters (global role)']")) ;
$this->assertFalse($this->isElementPresent("//input[@value='Link external role']/../../div/fieldset/select/option[.='Project moderators (global role)']")) ;
- $this->select("//input[@value='Link external role']/../../div/fieldset/select", "label=Documentation masters (global role)") ;
- $this->click("//input[@value='Link external role']") ;
+ $this->select($this->byXpath("//input[@value='Link external role']/../../div/fieldset/select"))->selectOptionByLabel("Documentation masters (global role)") ;
+ $this->clickAndWait("//input[@value='Link external role']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isElementPresent("//td/form/div[contains(.,'Documentation masters (global role)')]/../div/input[contains(@value,'Unlink Role')]"));
// Check that a project admin (not forge admin) can create a new role
$this->gotoProject ("SubProject") ;
- $this->click("link=Admin");
+ $this->clickAndWait("link=Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'users.php')]//input[@name='form_unix_name' and @type='text']", "guru") ;
- $this->select("//input[@value='Add Member']/../fieldset/select[@name='role_id']", "label=Admin");
- $this->click ("//input[@value='Add Member']") ;
+ $this->select($this->byXpath("//input[@value='Add Member']/../fieldset/select[@name='role_id']"))->selectOptionByLabel("Admin");
+ $this->clickAndWait("//input[@value='Add Member']") ;
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("guru Lastname"));
$this->assertTrue($this->isElementPresent("//tr/td/a[.='guru Lastname']/../../td/div[contains(.,'Admin')]")) ;
$this->switchUser('guru');
$this->gotoProject ("SubProject") ;
- $this->click("link=Admin");
+ $this->clickAndWait("link=Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'roleedit.php')]/..//input[@name='role_name']", "Role created by guru") ;
- $this->click ("//input[@value='Create Role']") ;
+ $this->clickAndWait("//input[@value='Create Role']") ;
$this->waitForPageToLoad("30000");
$this->assertFalse ($this->isPermissionDenied()) ;
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isElementPresent("//td/form/div[contains(.,'Role created by guru')]/../div/input[@value='Edit Permissions']")) ;
// (Deletion of project-wide roles)
$this->switchUser(FORGE_ADMIN_USERNAME);
$this->gotoProject ("MetaProject") ;
- $this->click("link=Admin");
+ $this->clickAndWait("link=Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'roleedit.php')]/..//input[@name='role_name']", "Temporary role") ;
- $this->click ("//input[@value='Create Role']") ;
+ $this->clickAndWait("//input[@value='Create Role']") ;
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("Temporary role"));
$this->type ("//form[contains(@action,'users.php')]//input[@name='form_unix_name' and @type='text']", "trainee") ;
- $this->select("//input[@value='Add Member']/../fieldset/select[@name='role_id']", "label=Temporary role");
- $this->click ("//input[@value='Add Member']") ;
+ $this->select($this->byXpath("//input[@value='Add Member']/../fieldset/select[@name='role_id']"))->selectOptionByLabel("Temporary role");
+ $this->clickAndWait("//input[@value='Add Member']") ;
$this->waitForPageToLoad("30000");
- $this->click ("//td/form/div[contains(.,'Temporary role')]/../../form/div/input[@value='Delete role']") ;
+ $this->clickAndWait("//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->clickAndWait("//input[@type='checkbox' and @name='sure']") ;
+ $this->clickAndWait("//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->clickAndWait("//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')]/../../form/div/input[@value='Delete role']") ;
+ $this->clickAndWait("//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->clickAndWait("//input[@type='checkbox' and @name='sure']") ;
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("Temporary role"));
// Non-regression test
- $this->click("link=Site Admin");
+ $this->clickAndWait("link=Site Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Display Full Project List/Edit Projects");
+ $this->clickAndWait("link=Display Full Project List/Edit Projects");
$this->waitForPageToLoad("30000");
- $this->click("link=SubProject");
+ $this->clickAndWait("link=SubProject");
$this->waitForPageToLoad("30000");
- $this->click("link=Permanently Delete Project");
+ $this->clickAndWait("link=Permanently Delete Project");
$this->waitForPageToLoad("30000");
- $this->click("sure");
- $this->click("reallysure");
- $this->click("reallyreallysure");
- $this->click("submit");
+ $this->clickAndWait("sure");
+ $this->clickAndWait("reallysure");
+ $this->clickAndWait("reallyreallysure");
+ $this->clickAndWait("submit");
$this->waitForPageToLoad("30000");
- $this->click("link=Home");
+ $this->clickAndWait("link=Home");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("SubProject"));
$this->switchUser(FORGE_ADMIN_USERNAME);
$this->gotoProject ("MetaProject") ;
- $this->click("link=News");
+ $this->clickAndWait("link=News");
$this->waitForPageToLoad("30000");
- $this->click("link=Submit");
+ $this->clickAndWait("link=Submit");
$this->waitForPageToLoad("30000");
$this->type("summary", "First news");
$this->type("details", "This is a simple news.");
- $this->click("submit");
+ $this->clickAndWait("submit");
$this->waitForPageToLoad("30000");
- $this->click("link=News");
+ $this->clickAndWait("link=News");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("First news"));
- $this->click("link=First news");
+ $this->clickAndWait("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->clickAndWait("link=Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
- $this->click ("//td/form/div[contains(.,'Anonymous')]/../div/input[@value='Edit Permissions']") ;
+ $this->clickAndWait("//td/form/div[contains(.,'Anonymous')]/../div/input[@value='Edit Permissions']") ;
$this->waitForPageToLoad("30000");
- $this->select("//tr/td[contains(.,'first-news')]/../td/fieldset/select", "label=Read only");
- $this->click ("//input[@value='Submit']") ;
+ $this->select($this->byXpath("//tr/td[contains(.,'first-news')]/../td/fieldset/select"))->selectOptionByLabel("Read only");
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
$this->assertSelected("//tr/td[contains(.,'first-news')]/../td/fieldset/select", "Read only");
- $this->select("//tr/td[contains(.,'first-news')]/../td/fieldset/select", "label=Moderated post");
- $this->click ("//input[@value='Submit']") ;
+ $this->select($this->byXpath("//tr/td[contains(.,'first-news')]/../td/fieldset/select"))->selectOptionByLabel("Moderated post");
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
$this->assertSelected("//tr/td[contains(.,'first-news')]/../td/fieldset/select", "Moderated post");
- $this->select("//tr/td[contains(.,'first-news')]/../td/fieldset/select", "label=Unmoderated post");
- $this->click ("//input[@value='Submit']") ;
+ $this->select($this->byXpath("//tr/td[contains(.,'first-news')]/../td/fieldset/select"))->selectOptionByLabel("Unmoderated post");
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
$this->assertSelected("//tr/td[contains(.,'first-news')]/../td/fieldset/select", "Unmoderated post");
}
<?php
/**
* Copyright 2011, Roland Mas
- * Copyright 2013, Franck Villaume - TrivialDev
+ * Copyright 2013,2019, Franck Villaume - TrivialDev
* Copyright (C) 2015 Inria (Sylvain Beucler)
*
* This file is part of FusionForge.
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
$this->type("//input[@name='words']", "XXXXXXXXXXXXXXXXXXXXXXXXXX");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("No matches found for"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
$this->type("//input[@name='words']", "projecta");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("public description for ProjectA"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
$this->type("//input[@name='words']", "description public ProjectA");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("public description for ProjectA"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
$this->type("//input[@name='words']", "description 'public ProjectA'");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("No matches found for"));
$this->assertFalse($this->isTextPresent("public description for ProjectA"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
$this->type("//input[@name='words']", "description public");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("public description for ProjectA"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
$this->type("//input[@name='words']", "'description public'");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("No matches found for"));
$this->assertFalse($this->isTextPresent("public description for ProjectA"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
$this->type("//input[@name='words']", "'public description'");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("public description for ProjectA"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
$this->type("//input[@name='words']", "'public description'");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("public description for ProjectA"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
$this->type("//input[@name='words']", "x15");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("public description for project-x15"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
- $this->select("type_of_search", "label=People");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("People");
$this->type("//input[@name='words']", "tartempion");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("No matches found for"));
$this->assertFalse($this->isTextPresent("ratatouille Lastname"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
- $this->select("type_of_search", "label=People");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("People");
$this->type("//input[@name='words']", "ratatouille");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("ratatouille Lastname"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
- $this->select("type_of_search", "label=People");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("People");
$this->type("//input[@name='words']", "lastname ratatouille");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("ratatouille Lastname"));
$this->open(ROOT) ;
$this->waitForPageToLoad("30000");
- $this->select("type_of_search", "label=People");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("People");
$this->type("//input[@name='words']", "Lastname");
- $this->click("//input[@name='Search']");
+ $this->clickAndWait("//input[@name='Search']");
$this->waitForPageToLoad("30000");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("ratatouille Lastname"));
// Search in trackers
- $this->select("type_of_search", "label=This project's trackers");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's trackers");
$this->type("//input[@name='words']", "brebis");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("Bug1"));
- $this->select("type_of_search", "label=This project's trackers");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's trackers");
$this->type("//input[@name='words']", "alpages");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("Bug1"));
- $this->select("type_of_search", "label=This project's trackers");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's trackers");
$this->type("//input[@name='words']", "boustrophédon brebis alpages");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("Bug1"));
- $this->select("type_of_search", "label=This project's trackers");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's trackers");
$this->type("//input[@name='words']", "'boustrophédon brebis'");
$this->clickAndWait("//input[@name='Search']");
$this->assertTrue($this->isTextPresent("No matches found for"));
$this->assertFalse($this->isTextPresent("Bug1"));
- $this->select("type_of_search", "label=This project's trackers");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's trackers");
$this->type("//input[@name='words']", "boustrophédon cthulhu");
$this->clickAndWait("//input[@name='Search']");
$this->assertTrue($this->isTextPresent("No matches found for"));
// Search in one particular tracker
- $this->select("type_of_search", "label=This project's trackers");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's trackers");
$this->type("//input[@name='words']", "charlie");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->clickAndWait("link=Tracker");
$this->clickAndWait("link=Bugs");
- $this->select("type_of_search", "label=Bugs");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("Bugs");
$this->type("//input[@name='words']", "charlie");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertFalse($this->isTextPresent("Bug2"));
$this->clickAndWait("link=Bugs");
- $this->select("type_of_search", "label=Bugs");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("Bugs");
$this->type("//input[@name='words']", "charlie boustrophédon");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
// Search in Tasks
- $this->select("type_of_search", "label=This project's tasks");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's tasks");
$this->type("//input[@name='words']", "pinky");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("Task1"));
- $this->select("type_of_search", "label=This project's tasks");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's tasks");
$this->type("//input[@name='words']", "cortex");
$this->clickAndWait("//input[@name='Search']");
$this->assertTrue($this->isTextPresent("No matches found for"));
$this->assertFalse($this->isTextPresent("Task1"));
- $this->select("type_of_search", "label=This project's tasks");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's tasks");
$this->type("//input[@name='words']", "brain pinky needle");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->gotoProject('ProjectA');
$this->clickAndWait("link=Forums");
$this->clickAndWait("link=open-discussion");
- $this->click("link=Start New Thread");
+ $this->clickAndWait("link=Start New Thread");
$this->waitForPageToLoad("30000");
$this->type("subject", "Message1 in a bottle");
$this->type("body", "ninetynine of them on Charlie's wall - also, ZONGO");
$this->clickAndWait("link=Forums");
$this->clickAndWait("link=developers-discussion");
- $this->click("link=Start New Thread");
+ $this->clickAndWait("link=Start New Thread");
$this->waitForPageToLoad("30000");
$this->type("subject", "Message4 in an envelope");
$this->type("body", "not the same thing as an antilope (and different thread anyway) (but still related to Charlie) - also, ZONGO");
// Search in Forums
- $this->select("type_of_search", "label=This project's forums");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's forums");
$this->type("//input[@name='words']", "bottle");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("Message3"));
$this->assertFalse($this->isTextPresent("Message4"));
- $this->select("type_of_search", "label=This project's forums");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's forums");
$this->type("//input[@name='words']", "bottle fridge");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
// Search in one particular forum
- $this->select("type_of_search", "label=This project's forums");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's forums");
$this->type("//input[@name='words']", "charlie");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->clickAndWait("link=Forums");
$this->clickAndWait("link=open-discussion");
- $this->select("type_of_search", "label=This forum");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This forum");
$this->type("//input[@name='words']", "charlie");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->clickAndWait("link=Forums");
$this->clickAndWait("link=open-discussion");
- $this->select("type_of_search", "label=This forum");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This forum");
$this->type("//input[@name='words']", "charlie fridge");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->clickAndWait("addItemDocmanMenu");
// ugly hack until we fix behavior in docman when no folders exist. We need to click twice on the link
$this->clickAndWait("addItemDocmanMenu");
- $this->click("id=tab-new-document");
+ $this->clickAndWait("id=tab-new-document");
$this->type("title", "Doc1 Vladimir");
$this->type("//textarea[@name='description']", "Jenkins buildbot - also, ZONGO");
- $this->click("//input[@name='type' and @value='pasteurl']");
+ $this->clickAndWait("//input[@name='type' and @value='pasteurl']");
$this->type("file_url", "http://buildbot.fusionforge.org/");
$this->clickAndWait("submit");
$this->clickAndWait("addItemDocmanMenu");
- $this->click("id=tab-new-document");
+ $this->clickAndWait("id=tab-new-document");
$this->type("title", "Doc2 Astromir");
$this->type("//textarea[@name='description']", "Main website (the needle) - also, ZONGO");
- $this->click("//input[@name='type' and @value='pasteurl']");
+ $this->clickAndWait("//input[@name='type' and @value='pasteurl']");
$this->type("file_url", "http://fusionforge.org/");
$this->clickAndWait("submit");
// Search in Documents
- $this->select("type_of_search", "label=This project's documents");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's documents");
$this->type("//input[@name='words']", "jenkins");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("Doc1"));
$this->assertFalse($this->isTextPresent("Doc2"));
- $this->select("type_of_search", "label=This project's documents");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's documents");
$this->type("//input[@name='words']", "vladimir jenkins");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
// Search in news
- $this->select("type_of_search", "label=This project's news");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's news");
$this->type("//input[@name='words']", "sysadmin");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
$this->assertTrue($this->isTextPresent("News2"));
- $this->select("type_of_search", "label=This project's news");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("This project's news");
$this->type("//input[@name='words']", "daily newspaper");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("No matches found for"));
// Search in entire project
$this->gotoProject('ProjectA');
- $this->select("type_of_search", "label=Search the entire project");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("Search the entire project");
$this->type("//input[@name='words']", "needle");
$this->clickAndWait("//input[@name='Search']");
$this->assertTrue($this->isTextPresent("Bug1"));
$this->assertTrue($this->isTextPresent("News2"));
$this->gotoProject('ProjectA');
- $this->select("type_of_search", "label=Search the entire project");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("Search the entire project");
$this->type("//input[@name='words']", "zongo");
$this->clickAndWait("//input[@name='Search']");
$this->assertTrue($this->isTextPresent("Bug1"));
$this->gotoProject('ProjectA');
$this->clickAndWait('Link=Advanced search');
- $this->click("//input[@class='checkthemall']");
+ $this->clickAndWait("//input[@class='checkthemall']");
$this->type("//main[@id='maindiv']//input[@name='words']", "needle");
$this->clickAndWait("//input[@name='submitbutton']");
$this->assertTrue($this->isTextPresent("Bug1"));
$this->gotoProject('ProjectA');
$this->clickAndWait('Link=Advanced search');
- $this->click("//input[@class='checkthemall']");
+ $this->clickAndWait("//input[@class='checkthemall']");
$this->type("//main[@id='maindiv']//input[@name='words']", "zongo");
$this->clickAndWait("//input[@name='submitbutton']");
$this->assertTrue($this->isTextPresent("Bug1"));
// Now let's check that RBAC permissions are taken into account
$this->gotoProject('ProjectA');
- $this->click("link=Admin");
+ $this->clickAndWait("link=Admin");
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
- $this->click("//tr/td/form/div[contains(.,'Any user logged in')]/../../../td/form/div/input[contains(@value,'Unlink Role')]");
+ $this->clickAndWait("//tr/td/form/div[contains(.,'Any user logged in')]/../../../td/form/div/input[contains(@value,'Unlink Role')]");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'roleedit.php')]/..//input[@name='role_name']", "Trainee") ;
- $this->click ("//input[@value='Create Role']") ;
+ $this->clickAndWait("//input[@value='Create Role']") ;
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
$this->type ("//form[contains(@action,'users.php')]//input[@name='form_unix_name' and @type='text']", "ratatouille") ;
- $this->select("//input[@value='Add Member']/../fieldset/select[@name='role_id']", "label=Trainee");
- $this->click ("//input[@value='Add Member']") ;
+ $this->select($this->byXpath("//input[@value='Add Member']/../fieldset/select[@name='role_id']"))->selectOptionByLabel("Trainee");
+ $this->clickAndWait("//input[@value='Add Member']") ;
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
- $this->click ("//td/form/div[contains(.,'Trainee')]/../div/input[@value='Edit Permissions']") ;
+ $this->clickAndWait("//td/form/div[contains(.,'Trainee')]/../div/input[@value='Edit Permissions']") ;
$this->waitForPageToLoad("30000");
- $this->select("//select[contains(@name,'data[project_read]')]", "label=Visible");
- $this->select("//tr/td[.='Bugs']/../td/fieldset/select[contains(@name,'data[tracker]')]", "label=Read only");
- $this->select("//tr/td[.='Patches']/../td/fieldset/select[contains(@name,'data[tracker]')]", "label=No Access");
- $this->select("//tr/td[.='To Do']/../td/fieldset/select[contains(@name,'data[pm]')]", "label=Read only");
- $this->select("//tr/td[.='Next Release']/../td/fieldset/select[contains(@name,'data[pm]')]", "label=No Access");
- $this->select("//tr/td[.='open-discussion']/../td/fieldset/select[contains(@name,'data[forum]')]", "label=Read only");
- $this->select("//tr/td[.='developers-discussion']/../td/fieldset/select[contains(@name,'data[forum]')]", "label=No Access");
- $this->select("//select[contains(@name,'data[docman]')]", "label=Read only");
- $this->click ("//input[@value='Submit']") ;
+ $this->select($this->byXpath("//select[contains(@name,'data[project_read]')]"))->selectOptionByLabel("Visible");
+ $this->select($this->byXpath("//tr/td[.='Bugs']/../td/fieldset/select[contains(@name,'data[tracker]')]"))->selectOptionByLabel("Read only");
+ $this->select($this->byXpath("//tr/td[.='Patches']/../td/fieldset/select[contains(@name,'data[tracker]')]"))->selectOptionByLabel("No Access");
+ $this->select($this->byXpath("//tr/td[.='To Do']/../td/fieldset/select[contains(@name,'data[pm]')]"))->selectOptionByLabel("Read only");
+ $this->select($this->byXpath("//tr/td[.='Next Release']/../td/fieldset/select[contains(@name,'data[pm]')]"))->selectOptionByLabel("No Access");
+ $this->select($this->byXpath("//tr/td[.='open-discussion']/../td/fieldset/select[contains(@name,'data[forum]')]"))->selectOptionByLabel("Read only");
+ $this->select($this->byXpath("//tr/td[.='developers-discussion']/../td/fieldset/select[contains(@name,'data[forum]')]"))->selectOptionByLabel("No Access");
+ $this->select($this->byXpath("//select[contains(@name,'data[docman]')]"))->selectOptionByLabel("Read only");
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
- $this->click("link=Users and permissions");
+ $this->clickAndWait("link=Users and permissions");
$this->waitForPageToLoad("30000");
- $this->click ("//td/form/div[contains(.,'Anonymous')]/../div/input[@value='Edit Permissions']") ;
+ $this->clickAndWait("//td/form/div[contains(.,'Anonymous')]/../div/input[@value='Edit Permissions']") ;
$this->waitForPageToLoad("30000");
- $this->select("//select[contains(@name,'data[project_read]')]", "label=Visible");
- $this->select("//tr/td[.='Bugs']/../td/fieldset/select[contains(@name,'data[tracker]')]", "label=No Access");
- $this->select("//tr/td[.='Patches']/../td/fieldset/select[contains(@name,'data[tracker]')]", "label=No Access");
- $this->select("//tr/td[.='To Do']/../td/fieldset/select[contains(@name,'data[pm]')]", "label=No Access");
- $this->select("//tr/td[.='Next Release']/../td/fieldset/select[contains(@name,'data[pm]')]", "label=No Access");
- $this->select("//tr/td[.='open-discussion']/../td/fieldset/select[contains(@name,'data[forum]')]", "label=No Access");
- $this->select("//tr/td[.='developers-discussion']/../td/fieldset/select[contains(@name,'data[forum]')]", "label=No Access");
- $this->select("//select[contains(@name,'data[docman]')]", "label=No Access");
- $this->click ("//input[@value='Submit']") ;
+ $this->select($this->byXpath("//select[contains(@name,'data[project_read]')]"))->selectOptionByLabel("Visible");
+ $this->select($this->byXpath("//tr/td[.='Bugs']/../td/fieldset/select[contains(@name,'data[tracker]')]"))->selectOptionByLabel("No Access");
+ $this->select($this->byXpath("//tr/td[.='Patches']/../td/fieldset/select[contains(@name,'data[tracker]')]"))->selectOptionByLabel("No Access");
+ $this->select($this->byXpath("//tr/td[.='To Do']/../td/fieldset/select[contains(@name,'data[pm]')]"))->selectOptionByLabel("No Access");
+ $this->select($this->byXpath("//tr/td[.='Next Release']/../td/fieldset/select[contains(@name,'data[pm]')]"))->selectOptionByLabel("No Access");
+ $this->select($this->byXpath("//tr/td[.='open-discussion']/../td/fieldset/select[contains(@name,'data[forum]')]"))->selectOptionByLabel("No Access");
+ $this->select($this->byXpath("//tr/td[.='developers-discussion']/../td/fieldset/select[contains(@name,'data[forum]')]"))->selectOptionByLabel("No Access");
+ $this->select($this->byXpath("//select[contains(@name,'data[docman]')]"))->selectOptionByLabel("No Access");
+ $this->clickAndWait("//input[@value='Submit']") ;
$this->waitForPageToLoad("30000");
$this->switchUser('ratatouille');
$this->gotoProject('ProjectA');
- $this->select("type_of_search", "label=Search the entire project");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("Search the entire project");
$this->type("//input[@name='words']", "zongo");
$this->clickAndWait("//input[@name='Search']");
$this->assertTrue($this->isTextPresent("Bug1"));
$this->gotoProject('ProjectA');
$this->clickAndWait('Link=Advanced search');
- $this->click("//input[@class='checkthemall']");
+ $this->clickAndWait("//input[@class='checkthemall']");
$this->type("//main[@id='maindiv']//input[@name='words']", "zongo");
$this->clickAndWait("//input[@name='submitbutton']");
$this->assertTrue($this->isTextPresent("Bug1"));
$this->logout();
$this->gotoProject('ProjectA');
- $this->select("type_of_search", "label=Search the entire project");
+ $this->select($this->byName("type_of_search"))->selectOptionByLabel("Search the entire project");
$this->type("//input[@name='words']", "zongo");
$this->clickAndWait("//input[@name='Search']");
$this->assertFalse($this->isTextPresent("Bug1"));
$this->gotoProject('ProjectA');
$this->clickAndWait('Link=Advanced search');
- $this->click("//input[@class='checkthemall']");
+ $this->clickAndWait("//input[@class='checkthemall']");
$this->assertFalse($this->isElementPresent("//input[@name='short_pm_checkall']"));
$this->assertFalse($this->isElementPresent("//input[@name='short_docman_checkall']"));
$this->type("//main[@id='maindiv']//input[@name='words']", "zongo");