aboutsummaryrefslogtreecommitdiff
path: root/headless/src/test/resources
diff options
context:
space:
mode:
authorGravatar Benjamin Jones <bjones@galois.com>2012-11-12 18:07:51 -0800
committerGravatar Benjamin Jones <bjones@galois.com>2012-11-12 18:07:51 -0800
commitb2233f4d08e922416c1c10080744e6dd5513be9b (patch)
treef4afb9cd6c42101676ab355c3b979dc5f8fed986 /headless/src/test/resources
parent5bb6964861acba3439a1430e999f7d014a796591 (diff)
initial commit of headless rule set tester
Diffstat (limited to 'headless/src/test/resources')
-rw-r--r--headless/src/test/resources/ruleSets/emptyRuleSet.json4
-rw-r--r--headless/src/test/resources/ruleSets/headingGuidelines.json37
-rw-r--r--headless/src/test/resources/runDescriptions/headlessRunTest0.json4
-rw-r--r--headless/src/test/resources/runDescriptions/headlessRunTestCNN.json4
-rw-r--r--headless/src/test/resources/runDescriptions/headlessRunTestGalois.json11
-rw-r--r--headless/src/test/resources/runDescriptions/headlessSample0.json4
-rw-r--r--headless/src/test/resources/runDescriptions/headlessSample1.json4
-rw-r--r--headless/src/test/resources/runDescriptions/headlessSample2.json9
8 files changed, 77 insertions, 0 deletions
diff --git a/headless/src/test/resources/ruleSets/emptyRuleSet.json b/headless/src/test/resources/ruleSets/emptyRuleSet.json
new file mode 100644
index 0000000..a01bc68
--- /dev/null
+++ b/headless/src/test/resources/ruleSets/emptyRuleSet.json
@@ -0,0 +1,4 @@
+{ "name": "emptyRuleSet"
+, "description": ""
+, "rules": []
+}
diff --git a/headless/src/test/resources/ruleSets/headingGuidelines.json b/headless/src/test/resources/ruleSets/headingGuidelines.json
new file mode 100644
index 0000000..be69fac
--- /dev/null
+++ b/headless/src/test/resources/ruleSets/headingGuidelines.json
@@ -0,0 +1,37 @@
+{ "name": "Heading Guidelines"
+, "description": "Guidelines pertaining to the formatting and content of headings."
+, "rules": [ { "id": 1
+ , "name": "Headings are capitalized"
+ , "description": "Check to see if all headings use leading capital letters."
+ , "rule":
+ function() {
+ var badHeadings =
+ fiveui.query(':header').filter(
+ function(idx) {
+ var ch = $(this).text()[0];
+ if (ch) {
+ return (ch == ch.toLowerCase() );
+ } else {
+ return false;
+ }
+ });
+ $(badHeadings).map(function(idx, elt){
+ report('Heading does not start with a capitol letter.', elt);
+ });
+
+ }
+ },
+ { "id": 2
+ , "name": "Disallow Empty Headers"
+ , "description": "Heading elements should contain text."
+ , "rule": function() {
+ fiveui.query(':header').each(
+ function(ix, elt) {
+ if($(elt).text() == '') {
+ report('Heading does not contain text', elt);
+ }
+ });
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/headless/src/test/resources/runDescriptions/headlessRunTest0.json b/headless/src/test/resources/runDescriptions/headlessRunTest0.json
new file mode 100644
index 0000000..e6c4c3b
--- /dev/null
+++ b/headless/src/test/resources/runDescriptions/headlessRunTest0.json
@@ -0,0 +1,4 @@
+[{
+ 'url': 'http://localhost:8000',
+ 'ruleSet': '../ruleSets/emptyRuleSet.json'
+}]
diff --git a/headless/src/test/resources/runDescriptions/headlessRunTestCNN.json b/headless/src/test/resources/runDescriptions/headlessRunTestCNN.json
new file mode 100644
index 0000000..07aaab8
--- /dev/null
+++ b/headless/src/test/resources/runDescriptions/headlessRunTestCNN.json
@@ -0,0 +1,4 @@
+[{
+ 'url': 'http://www.cnn.com',
+ 'ruleSet': '../ruleSets/headingGuidelines.json'
+}]
diff --git a/headless/src/test/resources/runDescriptions/headlessRunTestGalois.json b/headless/src/test/resources/runDescriptions/headlessRunTestGalois.json
new file mode 100644
index 0000000..d12f9b0
--- /dev/null
+++ b/headless/src/test/resources/runDescriptions/headlessRunTestGalois.json
@@ -0,0 +1,11 @@
+{
+ 'rulePath' : '/Users/bjones/galois/FiveUI/exampleData/ruleSets',
+ 'crawlType' : 'none',
+ 'runs': [
+ { 'url': 'http://corp.galois.com', 'ruleSet': 'colorRulesRF.json' },
+ { 'url': 'http://corp.galois.com', 'ruleSet': 'emptyHeadings.json' },
+ { 'url': 'http://corp.galois.com', 'ruleSet': 'fontRules.json' },
+ { 'url': 'http://corp.galois.com', 'ruleSet': 'headingGuidelines.json' },
+ { 'url': 'http://corp.galois.com', 'ruleSet': 'imageRules.json' }
+ ]
+}
diff --git a/headless/src/test/resources/runDescriptions/headlessSample0.json b/headless/src/test/resources/runDescriptions/headlessSample0.json
new file mode 100644
index 0000000..2b3a51a
--- /dev/null
+++ b/headless/src/test/resources/runDescriptions/headlessSample0.json
@@ -0,0 +1,4 @@
+[{
+ 'url': 'http://testhost',
+ 'ruleSet': '../ruleSets/emptyRuleSet.json'
+}]
diff --git a/headless/src/test/resources/runDescriptions/headlessSample1.json b/headless/src/test/resources/runDescriptions/headlessSample1.json
new file mode 100644
index 0000000..a3ee34d
--- /dev/null
+++ b/headless/src/test/resources/runDescriptions/headlessSample1.json
@@ -0,0 +1,4 @@
+[{
+ 'url': 'http://testhost',
+ 'ruleSet': '../ruleSets/headingGuidelines.json'
+}]
diff --git a/headless/src/test/resources/runDescriptions/headlessSample2.json b/headless/src/test/resources/runDescriptions/headlessSample2.json
new file mode 100644
index 0000000..277bd4d
--- /dev/null
+++ b/headless/src/test/resources/runDescriptions/headlessSample2.json
@@ -0,0 +1,9 @@
+[
+{
+ 'url': 'http://testhost1',
+ 'ruleSet': '../ruleSets/emptyRuleSet.json'
+},
+{
+ 'url': 'http://testhost2',
+ 'ruleSet': '../ruleSets/headingGuidelines.json'
+}]