public
Description: Automated Javascript Testing Framework
Homepage: http://www.appcelerator.org
Clone URL: git://github.com/jhaynie/testmonkey.git
testmonkey / README
100644 64 lines (41 sloc) 2.193 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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 jhaynie@gmail.com.
 
 
 
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.