Tina4Stack  v1.0.1
The Tina4 Stack
Tessa.php File Reference

Classes

class  Tessa
 
class  TestElement
 

Functions

 tessaErrorHandler ($errno, $errstr, $errfile, $errline)
 
 message ($msg)
 
 tryingTo ($msg)
 
 IWantTo ($msg)
 
 IExpectToSee ($text)
 
 ISee ($text)
 
 WaitFor2Seconds ()
 
 WaitFor1Second ()
 
 byId ($id)
 
 LookFor ($id)
 
 ClickOn ($id)
 
 byCSS ($css)
 
 byClass ($class)
 
 byPath ($path)
 
 waitFor ($id)
 
 checkDB ($tablename, $fieldname, $value)
 
 fetchRecords ($sql)
 
 fetchRecord ($sql)
 
 screenShot ()
 
 equals ($test1, $test2)
 
 IsDifferent ($test1, $test2)
 
 openSite ($URL)
 
 navigateTo ($URL)
 
 getActions ()
 
 deleteAllCookies ()
 
 AcceptAlert ()
 
 DismissAlert ()
 
 ExecJS ($script, $args=array())
 

Variables

global $TESSA
 

Function Documentation

AcceptAlert ( )

Accept Popup

Returns
mixed
byClass (   $class)
Parameters
string$classThe class name of the HTML element we are looking for
Returns
TestElement
byCSS (   $css)

Find an element by its CSS tag and return a TestElement object

Parameters
string$cssThe CSS path of the HTML element we are looking for
Returns
TestElement The element that was found
byId (   $id)

Find an element by its ID on the page, returns a TestElement object

Parameters
string$idThe ID of the html element, see <tag id="{id}"></tag>
Returns
TestElement The element to be used for further testing
byPath (   $path)
Parameters
$path
Returns
mixed
checkDB (   $tablename,
  $fieldname,
  $value 
)
Parameters
string$tablenameThe name of the table to check in the database
string$fieldnameThe name of the field to reference
string$valueThe value expected for that field
Returns
RecordObject
ClickOn (   $id)

Using the lookFor function this function calls the click event on the found element.

Parameters
string$idThe id, path or css of the element we are looking to click on
deleteAllCookies ( )
Returns
mixed
DismissAlert ( )

Dismiss Popup

Returns
mixed
equals (   $test1,
  $test2 
)
Parameters
$test1
$test2
Returns
mixed
ExecJS (   $script,
  $args = array() 
)

Execute JS

Parameters
$script$args
Returns
mixed
fetchRecord (   $sql)

Function to retrieve a record from the database

Parameters
String$sql
Returns
Object
fetchRecords (   $sql)

Function to retrieve records from the database

Parameters
String$sql
Returns
Object
getActions ( )
Returns
mixed
IExpectToSee (   $text)

A function which tests if a certain text string is on the screen, if its not there the function will kill the test process.

Parameters
string$textThe text you wish to see on the screen
IsDifferent (   $test1,
  $test2 
)
Parameters
$test1
$test2
Returns
mixed
ISee (   $text)

A function which checks if a certain string is on the screen and returns true or false, this is to be used in an if statement Example:

if (ISee("Home")) { .... } else { .... }

Parameters
string$textThe text you want to see on the screen
Returns
bool True of False, whether the string existed on the screen.
IWantTo (   $msg)

Outputs a message prefixed with I want to

Parameters
string$msgThe message you want to be displayed
LookFor (   $id)

Find an element by ID, Path or Class, if all these fail the function causes the test process to fail

Parameters
string$idThe id, path or class of the element we are looking for.
Returns
TestElement
message (   $msg)

Displays a message on the screen

Parameters
string$msgThe message you want displayed.
navigateTo (   $URL)

type $TESSA

Parameters
type$URL
Returns
type
openSite (   $URL)
Parameters
$URL
Returns
mixed
screenShot ( )

Creates a screen shot of the page where the error occured

Returns
HTML An Html string and link to the generated screen shot
tessaErrorHandler (   $errno,
  $errstr,
  $errfile,
  $errline 
)
tryingTo (   $msg)

Outputs a message prefixed with Trying to

Parameters
string$textThe message you want displayed
waitFor (   $id)
Parameters
string$idThe ID of the HTML element we are expecting
Returns
TestElement
WaitFor1Second ( )

A function that waits for 1 seconds

WaitFor2Seconds ( )

A function that waits for 2 seconds

Variable Documentation

global $TESSA

Created by PhpStorm. User: andrevanzuydam Date: 4/13/2015 Time: 1:14 PM