diff options
Diffstat (limited to 'exampleData/ruleSets/miscRules.json')
-rw-r--r-- | exampleData/ruleSets/miscRules.json | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/exampleData/ruleSets/miscRules.json b/exampleData/ruleSets/miscRules.json new file mode 100644 index 0000000..7ec4c33 --- /dev/null +++ b/exampleData/ruleSets/miscRules.json @@ -0,0 +1,40 @@ +/* + * miscRules.json + * + * Simple rules for checking miscellaneous things. + * + */ + +{ 'name': "Misc" +, 'description': "Miscellaneous rules" +, 'rules': [ + //--------------------------------------------------------- + { 'name': "Footer check" + , 'description': "Footer should appear on the page" + , 'rule': + function() { + if ($5("div.footer").length === 0) { + report('Footer does not appear', elt); + } + } + }, + //--------------------------------------------------------- + { 'name': "Main content width check" + , 'description': "Main content div should be between 520px and 1200px wide" + , 'rule': + function() { + var width; + var elt = $5("#content"); + if (elt) { + width = elt.width(); + if (width > 1200) { + report('Main content is too wide: ' + width, elt); + } else if (width < 520) { + report('Main content is too narrow: ' + width, elt); + } + } + } + }//, + //--------------------------------------------------------- +] +} |