Skip to content

gokugong/testmonkey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 

Repository files navigation

TestMonkey
Automated HTML and Javascript Unit Test Framework

WARNING: This is brand new spanking code and is not yet stable and should be used with precaution. 

Look in the tests folder for the manifest.js file for an example of a set of suites.

Each test suite has one or more tests.  Each test has one or more test assertions.

For each assertion, there are some built-in assertion helpers:

- assert: generic assertion
- assertVisible: assert that visibility:visible
- assertHidden: assert that visibility:hidden
- assertDisabled: assert that the element is disabled
- assertEnabled: assert that the element is enabled
- assertCSS: assert a CSS value, for example a border
- assertValue: assert the value of an element, usually a form element
- assertText: assert the text value of an element
- assertAttr: assert an element's attribute value
- assertClass: assert that an element has a specific CSS class
- assertHTML: assert that an element's HTML equals a specific value
- assertEmpty: assert that an element is empty (no children)
- assertChecked: assert that a checkbox is checked
- assertUnchecked: assert that a checkbox is unchecked

You use the assertions with a jQuery selector.  For example:

$('#my_div').assertHidden();

or

$('#my_div').assertCSS('border','1px solid red');


You can introduce your own new assertion types by calling the function 
TestMonkey.installAssertionType.  Example for empty:

TestMonkey.installAssertionType('Empty',function(testcase,assertion,args)
{
	return [this.text()=='',this.text()];
});



Interested in helping out?  Email me at [email protected].



Copyright 2008 Appcelerator, Inc.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

About

Automated Javascript Testing Framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published