Permalink
Browse files

Test fixes

  • Loading branch information...
1 parent c24694b commit e3aa611672f773653f8e888b96ac5cbcb116f53d @ianmacl committed Aug 26, 2011

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -9,7 +9,7 @@ class SiteSettings
class SeleniumSettings
{
- public static $browser = '*googlechrome';
+ public static $browser = 'firefox';
public static $host = '127.0.0.1';
public static $port = 4444;
}
@@ -4,8 +4,8 @@ class AdminLoginPage extends BasePage
{
private $locators = array(
- "username" => "mod-login-username",
- "password" => "mod-login-password",
+ "username" => "name=username",
+ "password" => "name=passwd",
"submit_button" => "link=Log in",
"error_message" => "css=#system-message li"
);
@@ -47,6 +47,8 @@ function wait_until_loaded()
function open_default_base_url()
{
$this->driver->load(SiteSettings::$url . 'administrator');
+ //$this->driver->load('http://google.com');
+ //$element = $this->driver->get_element('tag name=div');
}
function login_success($username = null, $password = null)
@@ -9,7 +9,8 @@ class ControlPanelPage extends BasePage
);
private $menuOptions = array(
- 'UserManagerPage' => 'link=User Manager'
+ 'UserManagerPage' => array('link=Users', 'link=User Manager'),
+ 'MyProfilePage' => array('link=Site', 'link=My Profile')
);
function __set($property, $value)
@@ -48,7 +49,18 @@ function wait_until_loaded()
public function open_from_menu($page)
{
- $this->driver->get_element($this->menuOptions[$page])->click();
+ $menuOption = $this->menuOptions[$page];
+ print_r($menuOption);
+ $this->driver->get_element($menuOption[0])->hover();
+ sleep(3);
+ //echo $menuOption[0]; die();
+ if (count($menuOption) == 2) {
+ $this->driver->get_element($menuOption[1])->click();
+ echo $menuOption[1];
+ } else {
+ $this->driver->get_element($menuOption[1])->hover();
+ $this->driver->get_element($menuOption[2])->click();
+ }
$resultPage = new $page;
$resultPage->wait_until_loaded();
return $resultPage;
@@ -21,9 +21,12 @@ public function createNewUserTest()
{
$landing = new AdminLoginPage();
$landing->open_default_base_url();
+
+
$control = $landing->login_success();
$control->wait_until_loaded();
$user_manager = $control->open_from_menu('UserManagerPage');
+
$user_edit_page = $user_manager->new_user();
$user_edit_page->name = 'testuser';
$user_edit_page->username = 'testusername';
@@ -32,6 +35,7 @@ public function createNewUserTest()
$user_edit_page->email = 'testemail@example.com';
$user_manager = $user_edit_page->save_and_close_success();
$user_manager->delete_user('testuser');
+
}
catch (Exception $e)
{

0 comments on commit e3aa611

Please sign in to comment.