-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
86 lines (85 loc) · 4.46 KB
/
test.html
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>PHAISTOS :: Verification Test Example</title>
<script src="phaistos.js"></script>
</head>
<body>
<script>
var new_phaistos = new phaistos(),
test_definition_model =
{
"arguments" : [
{
"key" : { "name" : "type", "optional" : false },
"value" : {
"type" : "string",
"choices" : ["data", "request"]
}
},
{
"key" : { "name" : "url", "optional" : false },
"value" : { "type" : "string" }
},
{
"key" : { "name" : "data", "optional" : true },
"value" : { "type" : "*" }
},
{
"key" : { "name" : "element_id", "optional" : true },
"value" : { "type" : "string" }
},
{
"key" : { "name" : "method", "optional" : true },
"value" : {
"type" : "string",
"choices" : ["get", "post"]
}
},
{
"key" : { "name" : "ajax_mode", "optional" : true },
"value" : {
"type" : "string",
"choices" : ["asynchronous", "synchronous"]
}
},
{
"key" : { "name" : "content_fill_mode", "optional" : true },
"value" : {
"type" : "string",
"choices" : ["replace", "append"]
}
},
{
"key" : { "name" : "response_timeout", "optional" : true },
"value" : { "type" : "number" }
},
{
"key" : { "name" : "on_success", "optional" : true },
"value" : { "type" : "function" }
},
{
"key" : { "name" : "on_fail", "optional" : true },
"value" : { "type" : "function" }
},
{
"key" : { "name" : "on_timeout", "optional" : true },
"value" : { "type" : "function" }
}
]
},
test_config =
{
"type" : "request",
"url" : "/",
"data" : "test data",
"ajax_mode" : "asynchronous",
"on_success" : function()
{
// Do stuff...
}
};
console.log(new_phaistos.verify(test_definition_model, test_config));
</script>
</body>
</html>