",
"action": "byId(\"d1\").click(); byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"foo\""
}
],
"async": false
},
{
"category": "if",
"name": "if on new line does not join w/ else",
"html": "
",
"action": "byId(\"d1\").click(); byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"\""
}
],
"async": false
},
{
"category": "repeat",
"name": "basic for loop works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"123\""
}
],
"async": false
},
{
"category": "repeat",
"name": "basic for loop with null works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"\""
}
],
"async": false
},
{
"category": "repeat",
"name": "waiting in for loop works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"123\""
}
],
"async": true
},
{
"category": "repeat",
"name": "basic raw for loop works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"123\""
}
],
"async": false
},
{
"category": "repeat",
"name": "basic raw for loop works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"\""
}
],
"async": false
},
{
"category": "repeat",
"name": "waiting in raw for loop works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"123\""
}
],
"async": true
},
{
"category": "repeat",
"name": "basic in loop works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"123\""
}
],
"async": false
},
{
"category": "repeat",
"name": "index syntax works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"a0ab1abc2\""
}
],
"async": false
},
{
"category": "repeat",
"name": "indexed by syntax works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"a0ab1abc2\""
}
],
"async": false
},
{
"category": "repeat",
"name": "basic times loop works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"aaa\""
}
],
"async": false
},
{
"category": "repeat",
"name": "times loop with expression works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"aaaaaa\""
}
],
"async": false
},
{
"category": "repeat",
"name": "loop continue works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"success A. success B. success C. expected D. success A. success B. success C. expected D. \""
}
],
"async": false
},
{
"category": "repeat",
"name": "loop break works",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerHTML",
"op": "==",
"expected": "\"ABAB\""
}
],
"async": false
},
{
"category": "wait",
"name": "can wait on time",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "qs(\"div\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
}
],
"async": true
},
{
"category": "wait",
"name": "can wait on event",
"html": "
",
"action": "qs(\"div\").click(); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\")",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "qs(\"div\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
}
],
"async": true
},
{
"category": "wait",
"name": "waiting on an event sets 'it' to the event",
"html": "
",
"action": "qs(\"div\").click(); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\", { detail: \"hyperscript is hyper cool\" })",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"hyperscript is hyper cool\""
}
],
"async": true
},
{
"category": "wait",
"name": "can destructure properties in a wait",
"html": "
",
"action": "qs(\"div\").click(); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\", { detail: { bar: \"bar\" } })",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"bar\""
}
],
"async": true
},
{
"category": "wait",
"name": "can wait on event on another element",
"html": "
",
"action": "qs(\"div\").click(); byId(\"div2\") && byId(\"div2\").dispatchEvent(new CustomEvent(\"foo\")",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "qs(\"div\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
}
],
"async": true
},
{
"category": "wait",
"name": "can wait on event or timeout 1",
"html": "
",
"action": "qs(\"div\").click(); byId(\"div2\") && byId(\"div2\").dispatchEvent(new CustomEvent(\"foo\")",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "qs(\"div\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
}
],
"async": true
},
{
"category": "wait",
"name": "can wait on event or timeout 2",
"html": "
",
"action": "qs(\"div\").click(); byId(\"div2\") && byId(\"div2\").dispatchEvent(new CustomEvent(\"foo\")",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "qs(\"div\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
}
],
"async": true
},
{
"category": "send",
"name": "can send events",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "byId(\"bar\").classList.contains(\"foo-sent\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "send",
"name": "can reference sender in events",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"foo-sent\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "send",
"name": "can send events with args",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "byId(\"bar\").classList.contains(\"foo-sent\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"bar\").innerHTML",
"op": "==",
"expected": "\"42\""
}
],
"async": false
},
{
"category": "send",
"name": "can send events with dots",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "byId(\"bar\").classList.contains(\"foo-sent\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "send",
"name": "can send events with dots with args",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "byId(\"bar\").classList.contains(\"foo-sent\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"bar\").innerHTML",
"op": "==",
"expected": "\"42\""
}
],
"async": false
},
{
"category": "send",
"name": "can send events with colons",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "byId(\"bar\").classList.contains(\"foo-sent\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "send",
"name": "can send events with colons with args",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "byId(\"bar\").classList.contains(\"foo-sent\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"bar\").innerHTML",
"op": "==",
"expected": "\"42\""
}
],
"async": false
},
{
"category": "send",
"name": "can send events to any expression",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "byId(\"bar\").classList.contains(\"foo-sent\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "take",
"name": "can take a class from other elements",
"html": "
",
"action": "byId(\"d2\").click()",
"checks": [
{
"expr": "byId(\"d1\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"d2\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"d3\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
}
],
"async": false
},
{
"category": "take",
"name": "can take a class from other forms",
"html": "
",
"action": "byId(\"f2\").click()",
"checks": [
{
"expr": "byId(\"f1\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"f2\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"f3\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
}
],
"async": false
},
{
"category": "take",
"name": "can take a class for other elements",
"html": "
",
"action": "byId(\"d2\").click()",
"checks": [
{
"expr": "byId(\"d1\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"d2\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"d3\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "take",
"name": "a parent can take a class for other elements",
"html": "
",
"action": "byId(\"d2\").click()",
"checks": [
{
"expr": "byId(\"d1\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"d2\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"d3\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
}
],
"async": false
},
{
"category": "take",
"name": "can take an attribute from other elements",
"html": "
",
"action": "byId(\"d2\").click()",
"checks": [
{
"expr": "byId(\"d1\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"bar\""
},
{
"expr": "byId(\"d2\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"\""
},
{
"expr": "byId(\"d2\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
},
{
"expr": "byId(\"d3\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
},
{
"expr": "byId(\"d1\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
}
],
"async": false
},
{
"category": "take",
"name": "can take an attribute with specific value from other elements",
"html": "
",
"action": "byId(\"d2\").click()",
"checks": [
{
"expr": "byId(\"d1\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"bar\""
},
{
"expr": "byId(\"d2\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"baz\""
},
{
"expr": "byId(\"d2\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
},
{
"expr": "byId(\"d3\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
},
{
"expr": "byId(\"d1\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
}
],
"async": false
},
{
"category": "take",
"name": "can take an attribute value from other elements and set specific values instead",
"html": "
",
"action": "byId(\"d2\").click()",
"checks": [
{
"expr": "byId(\"d1\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"qux\""
},
{
"expr": "byId(\"d2\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"baz\""
},
{
"expr": "byId(\"d3\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"qux\""
},
{
"expr": "byId(\"d2\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
},
{
"expr": "byId(\"d3\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
}
],
"async": false
},
{
"category": "take",
"name": "can take an attribute value from other elements and set value from an expression instead",
"html": "
",
"action": "byId(\"d2\").click()",
"checks": [
{
"expr": "byId(\"d1\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"qux\""
},
{
"expr": "byId(\"d2\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"baz\""
},
{
"expr": "byId(\"d3\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"qux\""
},
{
"expr": "byId(\"d3\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
}
],
"async": false
},
{
"category": "take",
"name": "can take an attribute for other elements",
"html": "
",
"action": "byId(\"d2\").click()",
"checks": [
{
"expr": "byId(\"d1\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"bar\""
},
{
"expr": "byId(\"d3\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"\""
},
{
"expr": "byId(\"d2\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
},
{
"expr": "byId(\"d3\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
},
{
"expr": "byId(\"d1\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
}
],
"async": false
},
{
"category": "take",
"name": "a parent can take an attribute for other elements",
"html": "
",
"action": "byId(\"d2\").click()",
"checks": [
{
"expr": "byId(\"d1\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"bar\""
},
{
"expr": "byId(\"d2\").getAttribute(\"data-foo\")",
"op": "==",
"expected": "\"\""
},
{
"expr": "byId(\"d2\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
},
{
"expr": "byId(\"d3\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
},
{
"expr": "byId(\"d1\").getAttribute(\"data-foo\"",
"op": "==",
"expected": "null"
}
],
"async": false
},
{
"category": "take",
"name": "can take multiple classes from other elements",
"html": "
",
"action": "byId(\"d2\").click()",
"checks": [
{
"expr": "byId(\"d1\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"d2\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"d3\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"d1\").classList.contains(\"bar\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"d2\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"d3\").classList.contains(\"bar\")",
"op": "==",
"expected": "false"
}
],
"async": false
},
{
"category": "take",
"name": "can take multiple classes from specific element",
"html": "
",
"action": "byId(\"d2\").click()",
"checks": [
{
"expr": "byId(\"d1\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"d2\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"d3\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"d1\").classList.contains(\"bar\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"d2\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"d3\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "log",
"name": "can log single item",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [],
"async": false
},
{
"category": "log",
"name": "can log multiple items",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [],
"async": false
},
{
"category": "log",
"name": "can log multiple items with debug",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [],
"async": false
},
{
"category": "log",
"name": "can log multiple items with error",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [],
"async": false
},
{
"category": "call",
"name": "can call javascript instance functions",
"html": "
",
"action": "byId(\"d1\").click()",
"checks": [
{
"expr": "value",
"op": "==",
"expected": "d1"
}
],
"async": false
},
{
"category": "call",
"name": "can call global javascript functions",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "\"foo\"",
"op": "==",
"expected": "calledWith"
}
],
"async": false
},
{
"category": "call",
"name": "can call no argument functions",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "called",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "call",
"name": "can call functions w/ underscores",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "called",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "call",
"name": "can call functions w/ dollar signs",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "called",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "increment",
"name": "can increment an empty variable",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"1\""
}
],
"async": false
},
{
"category": "increment",
"name": "can increment a variable",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"22\""
}
],
"async": false
},
{
"category": "increment",
"name": "can increment refer to result",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"2\""
}
],
"async": false
},
{
"category": "increment",
"name": "can increment an attribute",
"html": "
",
"action": "qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"8\""
}
],
"async": false
},
{
"category": "increment",
"name": "can increment an floating point numbers",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"11.3\""
}
],
"async": false
},
{
"category": "increment",
"name": "can increment a property",
"html": "
3
",
"action": "qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"6\""
}
],
"async": false
},
{
"category": "increment",
"name": "can increment by zero",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"20\""
}
],
"async": false
},
{
"category": "increment",
"name": "can increment a value multiple times",
"html": "
",
"action": "qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"5\""
}
],
"async": false
},
{
"category": "increment",
"name": "can decrement an empty variable",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"-1\""
}
],
"async": false
},
{
"category": "increment",
"name": "can decrement a variable",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"18\""
}
],
"async": false
},
{
"category": "increment",
"name": "can decrement an attribute",
"html": "
",
"action": "qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"2\""
}
],
"async": false
},
{
"category": "increment",
"name": "can decrement an floating point numbers",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"1\""
}
],
"async": false
},
{
"category": "increment",
"name": "can decrement a property",
"html": "
3
",
"action": "qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"0\""
}
],
"async": false
},
{
"category": "increment",
"name": "can decrement a value multiple times",
"html": "
",
"action": "qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"-5\""
}
],
"async": false
},
{
"category": "increment",
"name": "can decrement by zero",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"20\""
}
],
"async": false
},
{
"category": "append",
"name": "can append a string to another string",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"Hello there. General Kenobi.\""
}
],
"async": false
},
{
"category": "append",
"name": "can append a value to a DOM node",
"html": "
This is my inner HTML' to me\n append 'With Tags ' to me\">
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"
This is my inner HTML With Tags \""
}
],
"async": false
},
{
"category": "append",
"name": "can append a value to a DOM element",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"Content\""
}
],
"async": false
},
{
"category": "append",
"name": "can append a value to I",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"Content\""
}
],
"async": false
},
{
"category": "append",
"name": "can append a value to an object property",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").id",
"op": "==",
"expected": "\"id_new\""
}
],
"async": false
},
{
"category": "append",
"name": "multiple appends work",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"foobardoh\""
}
],
"async": false
},
{
"category": "append",
"name": "append to undefined ignores the undefined",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"bar\""
}
],
"async": false
},
{
"category": "append",
"name": "append preserves existing content rather than overwriting it",
"html": "
New Content' to me\">Click Me
",
"action": "btn.click(); qs(\"div\").click(); btn.click()",
"checks": [
{
"expr": "clicks",
"op": "==",
"expected": "1"
},
{
"expr": "btn.parentNode",
"op": "==",
"expected": "div"
}
],
"async": false
},
{
"category": "append",
"name": "new content added by append will be live",
"html": "
Test\\` to me\">
",
"action": "qs(\"div\").click(); btn.click()",
"checks": [
{
"expr": "window.temp",
"op": "==",
"expected": "1"
}
],
"async": false
},
{
"category": "tell",
"name": "establishes a proper beingTold symbol",
"html": "
",
"action": "byId(\"div1\") && byId(\"div1\").click()",
"checks": [
{
"expr": "byId(\"div1\").classList.contains(\"bar\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"div1\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"div2\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"div2\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
}
],
"async": false
},
{
"category": "tell",
"name": "does not overwrite the me symbol",
"html": "
",
"action": "byId(\"div1\") && byId(\"div1\").click()",
"checks": [
{
"expr": "byId(\"div1\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"div1\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"div2\").classList.contains(\"bar\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"div2\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
}
],
"async": false
},
{
"category": "tell",
"name": "works with an array",
"html": "
",
"action": "byId(\"div1\") && byId(\"div1\").click()",
"checks": [
{
"expr": "byId(\"div1\").classList.contains(\"bar\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"div1\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"div2\").classList.contains(\"bar\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"div2\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"p1\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"p1\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"p2\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"p2\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
}
],
"async": false
},
{
"category": "tell",
"name": "restores a proper implicit me symbol",
"html": "
",
"action": "byId(\"div1\") && byId(\"div1\").click()",
"checks": [
{
"expr": "byId(\"div1\").classList.contains(\"bar\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"div1\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"div2\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"div2\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
}
],
"async": false
},
{
"category": "tell",
"name": "ignores null",
"html": "
",
"action": "byId(\"div1\") && byId(\"div1\").click()",
"checks": [
{
"expr": "byId(\"div1\").classList.contains(\"bar\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"div1\").classList.contains(\"foo\")",
"op": "==",
"expected": "true"
},
{
"expr": "byId(\"div2\").classList.contains(\"bar\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"div2\").classList.contains(\"foo\")",
"op": "==",
"expected": "false"
}
],
"async": false
},
{
"category": "tell",
"name": "you symbol represents the thing being told",
"html": "
",
"action": "byId(\"div1\") && byId(\"div1\").click()",
"checks": [
{
"expr": "byId(\"div1\").classList.contains(\"bar\")",
"op": "==",
"expected": "false"
},
{
"expr": "byId(\"div2\").classList.contains(\"bar\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "tell",
"name": "your symbol represents the thing being told",
"html": "
foo
",
"action": "byId(\"div1\") && byId(\"div1\").click()",
"checks": [
{
"expr": "byId(\"div1\").innerText",
"op": "==",
"expected": "\"foo\""
},
{
"expr": "byId(\"div2\").innerText",
"op": "==",
"expected": "\"foo\""
}
],
"async": false
},
{
"category": "tell",
"name": "attributes refer to the thing being told",
"html": "
",
"action": "byId(\"div1\") && byId(\"div1\").click()",
"checks": [
{
"expr": "byId(\"div1\").innerText",
"op": "==",
"expected": "\"bar\""
},
{
"expr": "byId(\"div2\").innerText",
"op": "==",
"expected": "\"\""
}
],
"async": false
},
{
"category": "tell",
"name": "yourself attribute also works",
"html": "
",
"action": "byId(\"div1\") && byId(\"div1\").click()",
"checks": [
{
"expr": "byId(\"div1\").innerHTML",
"op": "==",
"expected": "\"\""
}
],
"async": false
},
{
"category": "tell",
"name": "tell terminates with a feature",
"html": "
",
"action": "byId(\"div1\") && byId(\"div1\").click()",
"checks": [
{
"expr": "byId(\"div1\").innerHTML",
"op": "==",
"expected": "\"\""
}
],
"async": false
},
{
"category": "on",
"name": "can respond to events with dots in names",
"html": "
",
"action": "bar.click()",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"called\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "on",
"name": "can respond to events with colons in names",
"html": "
",
"action": "bar.click()",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"called\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "on",
"name": "can respond to events with minus in names",
"html": "
",
"action": "bar.click()",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"called\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "on",
"name": "can respond to events on other elements",
"html": "
",
"action": "bar.click()",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"clicked\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "on",
"name": "listeners on other elements are removed when the registering element is removed",
"html": "
",
"action": "bar.click(); bar.click()",
"checks": [
{
"expr": "byId(\"bar\").innerHTML",
"op": "==",
"expected": "\"a\""
}
],
"async": false
},
{
"category": "on",
"name": "listeners on self are not removed when the element is removed",
"html": "
",
"action": "qs(\"div\").remove(); qs(\"div\").dispatchEvent(new Event(\"someCustomEvent\")",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"1\""
}
],
"async": false
},
{
"category": "on",
"name": "supports \"elsewhere\" modifier",
"html": "
",
"action": "qs(\"div\").click(); body.click()",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"clicked\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "on",
"name": "supports \"from elsewhere\" modifier",
"html": "
",
"action": "qs(\"div\").click(); body.click()",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"clicked\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "on",
"name": "can pick detail fields out by name",
"html": "
",
"action": "bar.click()",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"fromBar\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "on",
"name": "can pick event properties out by name",
"html": "
",
"action": "bar.click()",
"checks": [
{
"expr": "qs(\"div\").classList.contains(\"fromBar\")",
"op": "==",
"expected": "true"
}
],
"async": false
},
{
"category": "on",
"name": "can fire an event on load",
"html": "
",
"action": "",
"checks": [
{
"expr": "qs(\"div\").innerText",
"op": "==",
"expected": "\"Loaded\""
}
],
"async": true
},
{
"category": "on",
"name": "can have a simple event filter",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "byId(\"d1\").innerText",
"op": "==",
"expected": "\"\""
}
],
"async": false
},
{
"category": "on",
"name": "can refer to event properties directly in filter",
"html": "
",
"action": "qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerText",
"op": "==",
"expected": "\"\""
}
],
"async": false
},
{
"category": "on",
"name": "can refer to event detail properties directly in filter",
"html": "
",
"action": "qs(\"div\").dispatchEvent(event); qs(\"div\").dispatchEvent(event); qs(\"div\").dispatchEvent(event)",
"checks": [
{
"expr": "qs(\"div\").innerText",
"op": "==",
"expected": "\"2\""
}
],
"async": false
},
{
"category": "on",
"name": "can click after a positive event filter",
"html": "
",
"action": "qs(\"div\").dispatchEvent(new CustomEvent(\"foo\", { detail: { bar: false } }); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\", { detail: { bar: true } })",
"checks": [
{
"expr": "qs(\"div\").innerText",
"op": "==",
"expected": "\"triggered\""
}
],
"async": false
},
{
"category": "on",
"name": "multiple event handlers at a time are allowed to execute with the every keyword",
"html": "
",
"action": "qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerText",
"op": "==",
"expected": "\"3\""
}
],
"async": false
},
{
"category": "on",
"name": "can have multiple event handlers",
"html": "
",
"action": "qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\"); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\")",
"checks": [
{
"expr": "qs(\"div\").innerText",
"op": "==",
"expected": "\"3\""
}
],
"async": false
},
{
"category": "on",
"name": "can have multiple event handlers, no end",
"html": "
",
"action": "qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\"); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\")",
"checks": [
{
"expr": "qs(\"div\").innerText",
"op": "==",
"expected": "\"3\""
}
],
"async": false
},
{
"category": "on",
"name": "can queue events",
"html": "
",
"action": "qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\")",
"checks": [
{
"expr": "i",
"op": "==",
"expected": "2"
}
],
"async": true
},
{
"category": "on",
"name": "can queue first event",
"html": "
",
"action": "qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\")",
"checks": [
{
"expr": "i",
"op": "==",
"expected": "2"
}
],
"async": true
},
{
"category": "on",
"name": "can queue last event",
"html": "
",
"action": "qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\")",
"checks": [
{
"expr": "i",
"op": "==",
"expected": "2"
}
],
"async": true
},
{
"category": "on",
"name": "can queue all events",
"html": "
",
"action": "qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\"); qs(\"div\").dispatchEvent(new CustomEvent(\"bar\")",
"checks": [
{
"expr": "i",
"op": "==",
"expected": "3"
}
],
"async": true
},
{
"category": "on",
"name": "queue none does not allow future queued events",
"html": "
",
"action": "qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").dispatchEvent(new CustomEvent(\"customEvent\"); qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerText",
"op": "==",
"expected": "\"2\""
}
],
"async": true
},
{
"category": "on",
"name": "can invoke on multiple events",
"html": "
",
"action": "qs(\"div\").click(); qs(\"div\").dispatchEvent(new CustomEvent(\"foo\")",
"checks": [
{
"expr": "i",
"op": "==",
"expected": "2"
}
],
"async": false
},
{
"category": "on",
"name": "can listen for events in another element (lazy)",
"html": "
",
"action": "byId(\"div1\") && byId(\"div1\").click()",
"checks": [
{
"expr": "div1",
"op": "==",
"expected": "window.tmp"
}
],
"async": false
},
{
"category": "on",
"name": "can mix ranges",
"html": "
0
",
"action": "qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click(); qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"three\""
}
],
"async": false
},
{
"category": "on",
"name": "can listen for general mutations",
"html": "
",
"action": "qs(\"div\").setAttribute(\"foo\", \"bar\")",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"Mutated\""
}
],
"async": true
},
{
"category": "on",
"name": "can listen for attribute mutations",
"html": "
",
"action": "qs(\"div\").setAttribute(\"foo\", \"bar\")",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"Mutated\""
}
],
"async": true
},
{
"category": "on",
"name": "can listen for specific attribute mutations",
"html": "
",
"action": "qs(\"div\").setAttribute(\"foo\", \"bar\")",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"Mutated\""
}
],
"async": true
},
{
"category": "on",
"name": "can listen for specific attribute mutations and filter out other attribute mutations",
"html": "
",
"action": "qs(\"div\").setAttribute(\"foo\", \"bar\")",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"\""
}
],
"async": true
},
{
"category": "on",
"name": "can listen for childList mutations",
"html": "
",
"action": "qs(\"div\").appendChild(document.createElement(\"P\")",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"Mutated\""
}
],
"async": true
},
{
"category": "on",
"name": "can listen for childList mutation filter out other mutations",
"html": "
",
"action": "qs(\"div\").setAttribute(\"foo\", \"bar\")",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"\""
}
],
"async": true
},
{
"category": "on",
"name": "can listen for characterData mutation filter out other mutations",
"html": "
",
"action": "qs(\"div\").setAttribute(\"foo\", \"bar\")",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"\""
}
],
"async": true
},
{
"category": "on",
"name": "can listen for multiple mutations",
"html": "
",
"action": "qs(\"div\").setAttribute(\"foo\", \"bar\")",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"Mutated\""
}
],
"async": true
},
{
"category": "on",
"name": "can listen for multiple mutations 2",
"html": "
",
"action": "qs(\"div\").setAttribute(\"bar\", \"bar\")",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"Mutated\""
}
],
"async": true
},
{
"category": "on",
"name": "can listen for attribute mutations on other elements",
"html": "
",
"action": "byId(\"div1\") && byId(\"div1\").setAttribute(\"foo\", \"bar\")",
"checks": [
{
"expr": "byId(\"div2\").innerHTML",
"op": "==",
"expected": "\"Mutated\""
}
],
"async": true
},
{
"category": "on",
"name": "can catch exceptions thrown in js functions",
"html": "
",
"action": "btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"bar\""
}
],
"async": false
},
{
"category": "on",
"name": "can catch top-level exceptions",
"html": "
",
"action": "btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"bar\""
}
],
"async": false
},
{
"category": "on",
"name": "can catch async top-level exceptions",
"html": "
",
"action": "btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"bar\""
}
],
"async": true
},
{
"category": "on",
"name": "async exceptions don't kill the event queue",
"html": "
",
"action": "btn.click(); btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"success\""
}
],
"async": true
},
{
"category": "on",
"name": "exceptions in catch block don't kill the event queue",
"html": "
",
"action": "btn.click(); btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"success\""
}
],
"async": false
},
{
"category": "on",
"name": "uncaught exceptions trigger 'exception' event",
"html": "
",
"action": "btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"bar\""
}
],
"async": false
},
{
"category": "on",
"name": "caught exceptions do not trigger 'exception' event",
"html": "
",
"action": "btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"foo\""
}
],
"async": false
},
{
"category": "on",
"name": "rethrown exceptions trigger 'exception' event",
"html": "
",
"action": "btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"bar\""
}
],
"async": false
},
{
"category": "on",
"name": "basic finally blocks work",
"html": "
",
"action": "btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"bar\""
}
],
"async": false
},
{
"category": "on",
"name": "finally blocks work when exception thrown in catch",
"html": "
",
"action": "btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"bar\""
}
],
"async": false
},
{
"category": "on",
"name": "async basic finally blocks work",
"html": "
",
"action": "btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"bar\""
}
],
"async": true
},
{
"category": "on",
"name": "async finally blocks work when exception thrown in catch",
"html": "
",
"action": "btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"foobar\""
}
],
"async": true
},
{
"category": "on",
"name": "async exceptions in finally block don't kill the event queue",
"html": "
",
"action": "btn.click(); btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"success\""
}
],
"async": true
},
{
"category": "on",
"name": "exceptions in finally block don't kill the event queue",
"html": "
",
"action": "btn.click(); btn.click()",
"checks": [
{
"expr": "byId(\"btn\").innerHTML",
"op": "==",
"expected": "\"success\""
}
],
"async": false
},
{
"category": "on",
"name": "can ignore when target doesn't exist",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"clicked\""
}
],
"async": false
},
{
"category": "on",
"name": "can handle an or after a from clause",
"html": "
",
"action": "byId(\"d1\").click(); byId(\"d2\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"2\""
}
],
"async": false
},
{
"category": "init",
"name": "can define an init block inline",
"html": "
",
"action": "qs(\"div\").click()",
"checks": [
{
"expr": "qs(\"div\").innerHTML",
"op": "==",
"expected": "\"42\""
}
],
"async": true
},
{
"category": "def",
"name": "can install a function on an element and use in children w/ no leak",
"html": "
",
"action": "",
"checks": [
{
"expr": "byId(\"d3\").innerText",
"op": "==",
"expected": "\"42\""
}
],
"async": false
},
{
"category": "def",
"name": "can install a function on an element and use in children w/ return value",
"html": "
",
"action": "",
"checks": [
{
"expr": "byId(\"d1\").innerText",
"op": "==",
"expected": "\"42\""
}
],
"async": false
},
{
"category": "def",
"name": "can install a function on an element and use me symbol correctly",
"html": "
",
"action": "",
"checks": [
{
"expr": "qs(\"div\").innerText",
"op": "==",
"expected": "\"42\""
}
],
"async": false
}
];