PHP Class PMA_SeleniumBase, phpmyadmin

Inheritance: extends PHPUnit_Extensions_Selenium2TestCase
显示文件 Open project: phpmyadmin/phpmyadmin Class Usage Examples

Public Properties

Property Type Description
$database_name string Name of database for the test

Public Methods

Method Description
alertText ( ) : mixed Wrapper around alertText method to not use it on not supported browsers.
browsers ( ) : Array Lists browsers to test
dbQuery ( string $query ) : void | boolean | mysqli_result Executes a database query
expandMore ( ) : void Kills the More link in the menu
getCellByTableClass ( string $tableClass, integer $row, integer $column ) : text Get table cell data by the class attribute of the table
getCellByTableId ( string $tableID, integer $row, integer $column ) : text Get table cell data by the ID of the table
gotoHomepage ( ) : void Used to go to the homepage
isElementPresent ( string $func, string $arg ) : boolean Check if element is present or not
isLoggedIn ( ) : boolean Check if user is logged in to phpmyadmin
isSuccessLogin ( ) : boolean Checks whether the login is successful
isUnsuccessLogin ( ) : boolean Checks whether the login is unsuccessful
keys ( string $text ) : void Wrapper around keys method to not use it on not supported browsers.
logOutIfLoggedIn ( ) : void Perform a logout, if logged in
login ( string $username = '', string $password = '' ) : void perform a login
moveto ( object $element ) : void Wrapper around moveto method to not use it on not supported browsers.
navigateTable ( string $table ) : void Navigates browser to a table page.
sleep ( ) : void Sleeps while waiting for browser to perform an action.
tearDown ( ) : void Tear Down function for test cases
typeInTextArea ( string $text ) : void Type text in textarea (CodeMirror enabled)
waitForElement ( string $func, string $arg ) : PHPUnit_Extensions_Selenium2TestCase_Element Wait for an element to be present on the page
waitForElementNotPresent ( string $func, string $arg ) : boolean Wait for an element to disappear

Protected Methods

Method Description
isSuperUser ( ) : boolean Checks whether user is a superuser.
setUp ( ) : void Configures the selenium and database link.
skipIfNotPMADB ( ) : void Skips test if pmadb is not configured.
skipIfNotSuperUser ( ) : void Skips test if test user is not a superuser.

Method Details

alertText() public method

Wrapper around alertText method to not use it on not supported browsers.
public alertText ( ) : mixed
return mixed

browsers() public static method

Lists browsers to test
public static browsers ( ) : Array
return Array of browsers to test

dbQuery() public method

Executes a database query
public dbQuery ( string $query ) : void | boolean | mysqli_result
$query string SQL Query to be executed
return void | boolean | mysqli_result

expandMore() public method

Kills the More link in the menu
public expandMore ( ) : void
return void

getCellByTableClass() public method

Get table cell data by the class attribute of the table
public getCellByTableClass ( string $tableClass, integer $row, integer $column ) : text
$tableClass string Class of the table
$row integer Table row
$column integer Table column
return text Data from the particular table cell

getCellByTableId() public method

Get table cell data by the ID of the table
public getCellByTableId ( string $tableID, integer $row, integer $column ) : text
$tableID string Table identifier
$row integer Table row
$column integer Table column
return text Data from the particular table cell

gotoHomepage() public method

Used to go to the homepage
public gotoHomepage ( ) : void
return void

isElementPresent() public method

Check if element is present or not
public isElementPresent ( string $func, string $arg ) : boolean
$func string Locate using - byCss, byXPath, etc
$arg string Selector
return boolean Whether or not the element is present

isLoggedIn() public method

Check if user is logged in to phpmyadmin
public isLoggedIn ( ) : boolean
return boolean Where or not user is logged in

isSuccessLogin() public method

Checks whether the login is successful
public isSuccessLogin ( ) : boolean
return boolean

isSuperUser() protected method

Checks whether user is a superuser.
protected isSuperUser ( ) : boolean
return boolean

isUnsuccessLogin() public method

Checks whether the login is unsuccessful
public isUnsuccessLogin ( ) : boolean
return boolean

keys() public method

Wrapper around keys method to not use it on not supported browsers.
public keys ( string $text ) : void
$text string Keys to send
return void

logOutIfLoggedIn() public method

Perform a logout, if logged in
public logOutIfLoggedIn ( ) : void
return void

login() public method

perform a login
public login ( string $username = '', string $password = '' ) : void
$username string Username
$password string Password
return void

moveto() public method

Wrapper around moveto method to not use it on not supported browsers.
public moveto ( object $element ) : void
$element object element
return void

navigateTable() public method

Navigates browser to a table page.
public navigateTable ( string $table ) : void
$table string Name of table
return void

setUp() protected method

Configures the selenium and database link.
protected setUp ( ) : void
return void

skipIfNotPMADB() protected method

Skips test if pmadb is not configured.
protected skipIfNotPMADB ( ) : void
return void

skipIfNotSuperUser() protected method

Skips test if test user is not a superuser.
protected skipIfNotSuperUser ( ) : void
return void

sleep() public method

Sleeps while waiting for browser to perform an action.
public sleep ( ) : void
return void

tearDown() public method

Tear Down function for test cases
public tearDown ( ) : void
return void

typeInTextArea() public method

Type text in textarea (CodeMirror enabled)
public typeInTextArea ( string $text ) : void
$text string Text to type
return void

waitForElement() public method

Wait for an element to be present on the page
public waitForElement ( string $func, string $arg ) : PHPUnit_Extensions_Selenium2TestCase_Element
$func string Locate using - byCss, byXPath, etc
$arg string Selector
return PHPUnit_Extensions_Selenium2TestCase_Element Element waited for

waitForElementNotPresent() public method

Wait for an element to disappear
public waitForElementNotPresent ( string $func, string $arg ) : boolean
$func string Locate using - byCss, byXPath, etc
$arg string Selector
return boolean Whether or not the element disappeared

Property Details

$database_name public_oe property

Name of database for the test
public string $database_name
return string