// Auto-generated from _hyperscript upstream test suite // Source: spec/tests/hyperscript-upstream-tests.json // 378 tests (453 skipped) // // DO NOT EDIT — regenerate with: python3 tests/playwright/generate-hs-tests.py module.exports = [ { "category": "add", "name": "can add class ref on a single div", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "add", "name": "can add class ref w/ double dash on a single div", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo--bar\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "add", "name": "can add class ref on a single form", "html": "
", "action": "qs(\"form\").click()", "checks": [ { "expr": "qs(\"form\").classList.contains(\"foo\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "add", "name": "can target another div for class ref", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "byId(\"bar\").classList.contains(\"foo\")", "op": "==", "expected": "true" }, { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "false" } ], "async": false }, { "category": "add", "name": "can add to query in me", "html": "

", "action": "qs(\"div\").click()", "checks": [ { "expr": "byId(\"p1\").classList.contains(\"foo\")", "op": "==", "expected": "true" }, { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "false" } ], "async": false }, { "category": "add", "name": "can add to children", "html": "

", "action": "qs(\"div\").click()", "checks": [ { "expr": "byId(\"p1\").classList.contains(\"foo\")", "op": "==", "expected": "true" }, { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "false" } ], "async": false }, { "category": "add", "name": "can add multiple class refs", "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": false }, { "category": "add", "name": "can add class refs w/ colons and dashes", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo:bar-doh\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "add", "name": "can filter class addition via the when clause", "html": "
", "action": "byId(\"div1\") && byId(\"div1\").click()", "checks": [ { "expr": "byId(\"div2\").classList.contains(\"rey\")", "op": "==", "expected": "false" }, { "expr": "byId(\"div3\").classList.contains(\"rey\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "add", "name": "can filter property addition via the when clause", "html": "
", "action": "byId(\"div1\") && byId(\"div1\").click()", "checks": [ { "expr": "byId(\"div2\").hasAttribute(\"rey\")", "op": "==", "expected": "false" }, { "expr": "byId(\"div3\").hasAttribute(\"rey\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "add", "name": "can add to an HTMLCollection", "html": "
", "action": "byId(\"div1\") && byId(\"div1\").click()", "checks": [ { "expr": "byId(\"c1\").classList.contains(\"foo\")", "op": "==", "expected": "true" }, { "expr": "byId(\"c2\").classList.contains(\"foo\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "remove", "name": "can remove class ref on a single div", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "false" } ], "async": false }, { "category": "remove", "name": "can remove class ref on a single form", "html": "
", "action": "qs(\"form\").click()", "checks": [ { "expr": "qs(\"form\").classList.contains(\"foo\")", "op": "==", "expected": "false" } ], "async": false }, { "category": "remove", "name": "can target another div for class ref", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "byId(\"bar\").classList.contains(\"foo\")", "op": "==", "expected": "false" }, { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "false" } ], "async": false }, { "category": "remove", "name": "can remove elements", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").parentElement", "op": "==", "expected": "null" } ], "async": false }, { "category": "remove", "name": "can remove other elements", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "byId(\"div2\").parentElement", "op": "==", "expected": "null" } ], "async": false }, { "category": "remove", "name": "can remove parent element", "html": "
", "action": "btn.click()", "checks": [ { "expr": "qs(\"div\").parentElement", "op": "==", "expected": "null" } ], "async": false }, { "category": "remove", "name": "can remove multiple class refs", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "false" }, { "expr": "qs(\"div\").classList.contains(\"bar\")", "op": "==", "expected": "false" }, { "expr": "qs(\"div\").classList.contains(\"doh\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "remove", "name": "can remove query refs from specific things", "html": "

foo

bar

doh

", "action": "byId(\"d1\").click()", "checks": [ { "expr": "qs(\"div\").innerHTML.includes(\"foo\")", "op": "==", "expected": "false" }, { "expr": "qs(\"div\").innerHTML.includes(\"bar\")", "op": "==", "expected": "true" }, { "expr": "qs(\"div\").innerHTML.includes(\"doh\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "toggle", "name": "can toggle class ref on a single div", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "false" } ], "async": false }, { "category": "toggle", "name": "can toggle class ref on a single form", "html": "
", "action": "qs(\"form\").click(); qs(\"form\").click()", "checks": [ { "expr": "qs(\"form\").classList.contains(\"foo\")", "op": "==", "expected": "false" } ], "async": false }, { "category": "toggle", "name": "can target another div for class ref toggle", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "byId(\"bar\").classList.contains(\"foo\")", "op": "==", "expected": "false" }, { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "false" } ], "async": false }, { "category": "toggle", "name": "can toggle for a fixed amount of time", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "false" } ], "async": true }, { "category": "toggle", "name": "can toggle until an event on another element", "html": "
", "action": "qs(\"div\").click(); byId(\"d1\").dispatchEvent(new CustomEvent(\"foo\")", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "false" } ], "async": true }, { "category": "toggle", "name": "can toggle between two classes", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "true" }, { "expr": "qs(\"div\").classList.contains(\"bar\")", "op": "==", "expected": "false" } ], "async": false }, { "category": "toggle", "name": "can toggle multiple class refs", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "false" }, { "expr": "qs(\"div\").classList.contains(\"bar\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "toggle", "name": "can toggle display", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).display", "op": "==", "expected": "\"block\"" } ], "async": false }, { "category": "toggle", "name": "can toggle opacity", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).opacity", "op": "==", "expected": "\"1\"" } ], "async": false }, { "category": "toggle", "name": "can toggle opacity", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).visibility", "op": "==", "expected": "\"visible\"" } ], "async": false }, { "category": "toggle", "name": "can toggle display w/ my", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).display", "op": "==", "expected": "\"block\"" } ], "async": false }, { "category": "toggle", "name": "can toggle display w/ my", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).opacity", "op": "==", "expected": "\"1\"" } ], "async": false }, { "category": "toggle", "name": "can toggle display w/ my", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).visibility", "op": "==", "expected": "\"visible\"" } ], "async": false }, { "category": "toggle", "name": "can toggle display on other elt", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(div2).display", "op": "==", "expected": "\"block\"" } ], "async": false }, { "category": "toggle", "name": "can toggle display on other elt", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(div2).opacity", "op": "==", "expected": "\"1\"" } ], "async": false }, { "category": "toggle", "name": "can toggle display on other elt", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(div2).visibility", "op": "==", "expected": "\"visible\"" } ], "async": false }, { "category": "set", "name": "can set properties", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set indirect properties", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set complex indirect properties lhs", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set complex indirect properties rhs", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set chained indirect properties", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set styles", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style.color", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "set", "name": "can set javascript globals", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "window[\"temp\"]", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "set", "name": "can set local variables", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set into id ref", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set into class ref", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" }, { "expr": "byId(\"d2\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set into attribute ref", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").getAttribute(\"bar\")", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set into indirect attribute ref", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d2\").getAttribute(\"bar\")", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set into indirect attribute ref 2", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d2\").getAttribute(\"bar\")", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set into indirect attribute ref 3", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d2\").getAttribute(\"bar\")", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "set", "name": "can set into style ref", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style[\"color\"]", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "set", "name": "can set into indirect style ref", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d2\").style[\"color\"]", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "set", "name": "can set into indirect style ref 2", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d2\").style[\"color\"]", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "set", "name": "can set into indirect style ref 3", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d2\").style[\"color\"]", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "set", "name": "can set many properties at once with object literal", "html": "
", "action": "", "checks": [ { "expr": "obj", "op": "deep==", "expected": "{ foo: 1, bar: 2, baz: 3 }" } ], "async": false }, { "category": "set", "name": "can set props w/ array access syntax", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style.color", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "set", "name": "can set props w/ array access syntax and var", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style.color", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "set", "name": "can set arrays w/ array access syntax", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style.color", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "set", "name": "can set arrays w/ array access syntax and var", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style.color", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "put", "name": "can set properties", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can put directly into nodes", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").textContent", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can put nodes into nodes", "html": "
", "action": "byId(\"d2\").click()", "checks": [ { "expr": "byId(\"d2\").firstChild", "op": "==", "expected": "d1" } ], "async": false }, { "category": "put", "name": "can put directly into symbols", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "me symbol doesn't get stomped on direct write", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"bar\"" } ], "async": false }, { "category": "put", "name": "can set styles", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style.color", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "put", "name": "can set javascript globals", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "window[\"temp\"]", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "put", "name": "can set into class ref w/ flatmapped property", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "byId(\"d1\").textContent", "op": "==", "expected": "\"foo\"" }, { "expr": "byId(\"d2\").textContent", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can set into class ref w/ flatmapped property using of", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "byId(\"d1\").textContent", "op": "==", "expected": "\"foo\"" }, { "expr": "byId(\"d2\").textContent", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can set local variables", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can set into id ref", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can insert before", "html": "
foo
", "action": "byId(\"d2\").click()", "checks": [ { "expr": "byId(\"d2\").byId(\"previousSibling\").textContent", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can insert after", "html": "
foo
", "action": "byId(\"d2\").click()", "checks": [ { "expr": "byId(\"d2\").byId(\"nextSibling\").textContent", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can insert after beginning", "html": "
*
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").textContent", "op": "==", "expected": "\"foo*\"" } ], "async": false }, { "category": "put", "name": "can insert before end", "html": "
*
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").textContent", "op": "==", "expected": "\"*foo\"" } ], "async": false }, { "category": "put", "name": "can set into attribute ref", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").getAttribute(\"bar\")", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can set into indirect attribute ref", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").getAttribute(\"bar\")", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can set into indirect attribute ref 2", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d2\").getAttribute(\"bar\")", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can set into indirect attribute ref 3", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d2\").getAttribute(\"bar\")", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "put", "name": "can set into style ref", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style[\"color\"]", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "put", "name": "can set into indirect style ref", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style[\"color\"]", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "put", "name": "can set into indirect style ref 2", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d2\").style[\"color\"]", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "put", "name": "can set into indirect style ref 3", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d2\").style[\"color\"]", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "put", "name": "can put properties w/ array access syntax", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style.color", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "put", "name": "can put properties w/ array access syntax and var", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style.color", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "put", "name": "can put array vals w/ array access syntax", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style.color", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "put", "name": "can put array vals w/ array access syntax and var", "html": "
lolwat
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").style.color", "op": "==", "expected": "\"red\"" } ], "async": false }, { "category": "put", "name": "is null tolerant", "html": "
", "action": "byId(\"d1\").click()", "checks": [], "async": false }, { "category": "hide", "name": "can hide element with no target", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).display", "op": "==", "expected": "\"none\"" } ], "async": false }, { "category": "hide", "name": "hide element then show element retains original display", "html": "
", "action": "qs(\"div\").click(); qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").style.display", "op": "==", "expected": "\"\"" }, { "expr": "getComputedStyle(qs(\"div\")).display", "op": "==", "expected": "\"block\"" } ], "async": false }, { "category": "hide", "name": "can hide element with no target followed by command", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).display", "op": "==", "expected": "\"none\"" }, { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "hide", "name": "can hide element with no target followed by then", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).display", "op": "==", "expected": "\"none\"" }, { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "hide", "name": "can hide element with no target with a with", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).display", "op": "==", "expected": "\"none\"" }, { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "hide", "name": "can hide element, with display:none by default", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).display", "op": "==", "expected": "\"none\"" } ], "async": false }, { "category": "hide", "name": "can hide element with display:none explicitly", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).display", "op": "==", "expected": "\"none\"" } ], "async": false }, { "category": "hide", "name": "can hide element with opacity:0", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).opacity", "op": "==", "expected": "\"0\"" } ], "async": false }, { "category": "hide", "name": "can hide element with opacity style literal", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).opacity", "op": "==", "expected": "\"0\"" } ], "async": false }, { "category": "hide", "name": "can hide element, with visibility:hidden", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(qs(\"div\")).visibility", "op": "==", "expected": "\"hidden\"" } ], "async": false }, { "category": "hide", "name": "can hide other elements", "html": "
", "action": "qs(\"div\").click()", "checks": [ { "expr": "getComputedStyle(hideme).display", "op": "==", "expected": "\"none\"" } ], "async": false }, { "category": "hide", "name": "can hide with custom strategy", "html": "
", "action": "classList.remove(\"foo\"); qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "hide", "name": "can set default to custom strategy", "html": "
", "action": "classList.remove(\"foo\"); qs(\"div\").click()", "checks": [ { "expr": "qs(\"div\").classList.contains(\"foo\")", "op": "==", "expected": "true" } ], "async": false }, { "category": "if", "name": "basic true branch works", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "basic true branch works with multiple commands", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "basic true branch works with end", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "basic true branch works with naked else", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "basic true branch works with naked else end", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "basic else branch works", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "basic else branch works with end", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "basic else if branch works", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "basic else if branch works with end", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "otherwise alias works", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "triple else if branch works", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "triple else if branch works with end", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "basic else branch works with multiple commands", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "true branch with a wait works", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": true }, { "category": "if", "name": "false branch with a wait works", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": true }, { "category": "if", "name": "if properly passes execution along if child is not executed", "html": "
", "action": "byId(\"d1\").click()", "checks": [ { "expr": "byId(\"d1\").innerHTML", "op": "==", "expected": "\"foo\"" } ], "async": false }, { "category": "if", "name": "if properly supports nested if statements and end block", "html": "
", "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 HTMLWith 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\">
", "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 }, { "category": "dialog", "name": "show opens a dialog as modal", "html": "

Hello

", "action": "find('button').click()", "checks": [], "async": true }, { "category": "dialog", "name": "open opens a dialog", "html": "

Hello

", "action": "find('button').click()", "checks": [], "async": true }, { "category": "dialog", "name": "open opens a details element", "html": "
More

Content

", "action": "find('button').click()", "checks": [], "async": true }, { "category": "dialog", "name": "close closes a details element", "html": "
More

Content

", "action": "find('button').click()", "checks": [], "async": true }, { "category": "dialog", "name": "open on implicit me", "html": "", "action": "find('button').click()", "checks": [], "async": true }, { "category": "empty", "name": "can empty an element", "html": "

hello

world

", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "empty", "name": "empty with no target empties me", "html": "
content
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "empty", "name": "can empty multiple elements", "html": "

a

b

", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "empty", "name": "can empty an array", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "empty", "name": "can empty a text input", "html": "\n\t\t\t\n\t\t\t\n\t\t", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "empty", "name": "can empty a textarea", "html": "\n\t\t\t\n\t\t\t\n\t\t", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "empty", "name": "can empty a checkbox", "html": "\n\t\t\t\n\t\t\t\n\t\t", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "empty", "name": "can empty a form (clears all inputs)", "html": "\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "empty", "name": "clear is an alias for empty", "html": "\n\t\t\t\n\t\t\t\n\t\t", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "empty", "name": "clear works on elements", "html": "

content

", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "halt", "name": "halts event propagation and default", "html": "", "action": "find('#inner').dispatchEvent('click')", "checks": [], "async": true }, { "category": "halt", "name": "halt stops execution after the halt", "html": "
test
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "halt", "name": "halt the event stops propagation but continues execution", "html": "
click me
", "action": "find('#inner').dispatchEvent('click')", "checks": [], "async": true }, { "category": "halt", "name": "halt the event's stops propagation but continues execution", "html": "
click me
", "action": "find('#inner').dispatchEvent('click')", "checks": [], "async": true }, { "category": "halt", "name": "halt bubbling only stops propagation, not default", "html": "
click me
", "action": "find('#inner').dispatchEvent('click')", "checks": [], "async": true }, { "category": "halt", "name": "halt default only prevents default, not propagation", "html": "
click me
", "action": "find('#inner').dispatchEvent('click')", "checks": [], "async": true }, { "category": "morph", "name": "basic morph updates content", "html": "
old
", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "morph", "name": "morph updates attributes", "html": "
content
", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "morph", "name": "morph initializes hyperscript on new elements", "html": "

old

'\\\">go", "action": "find('#go').dispatchEvent('click'); find('#inner').dispatchEvent('click')", "checks": [], "async": true }, { "category": "morph", "name": "morph with variable content", "html": "
original
", "action": "find('#go').dispatchEvent('click')", "checks": [], "async": true }, { "category": "reset", "name": "can reset a form", "html": "\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t", "action": "find('#t1').fill('changed'); find('#rst').dispatchEvent('click')", "checks": [], "async": true }, { "category": "reset", "name": "reset with no target resets me (form)", "html": "\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t", "action": "find('#t2').fill('modified'); find('form').dispatchEvent('custom')", "checks": [], "async": true }, { "category": "reset", "name": "can reset a text input to defaultValue", "html": "\n\t\t\t\n\t\t\t\n\t\t", "action": "find('#t3').fill('goodbye'); find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "reset", "name": "can reset a checkbox", "html": "\n\t\t\t\n\t\t\t\n\t\t", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "reset", "name": "can reset an unchecked checkbox", "html": "\n\t\t\t\n\t\t\t\n\t\t", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "reset", "name": "can reset a textarea", "html": "\n\t\t\t\n\t\t\t\n\t\t", "action": "find('#ta1').fill('new text'); find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "reset", "name": "can reset a select", "html": "\n\t\t\t\n\t\t\t\n\t\t", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "reset", "name": "can reset multiple inputs", "html": "\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "swap", "name": "can swap two variables", "html": "
", "action": "find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "swap", "name": "can swap two properties", "html": "
\n\t\t\txy", "action": "find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "swap", "name": "can swap a variable with a property", "html": "
\n\t\t\t", "action": "find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "bind", "name": "attribute bound to another element input value", "html": "

", "action": "find('#title-input').fill('World')", "checks": [], "async": true }, { "category": "when", "name": "detects changes from :element variable", "html": "
0
", "action": "find('div').click(); find('div').click()", "checks": [], "async": true }, { "category": "when", "name": "works with on handlers that modify the watched variable", "html": "
initial
", "action": "find('div').click()", "checks": [], "async": true }, { "category": "when", "name": "isolates element-scoped variables between elements", "html": "
A
B
", "action": "find('#d1').click(); find('#d2').click()", "checks": [], "async": true }, { "category": "when", "name": "value of #element is tracked", "html": "", "action": "find('#of-input').fill('changed')", "checks": [], "async": true }, { "category": "liveTemplate", "name": "processes hyperscript on inner elements", "html": "\n\t\t\t\n\t\t", "action": "find('[data-live-template] button').click()", "checks": [], "async": true }, { "category": "assignableElements", "name": "set closest replaces ancestor", "html": "
", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "assignableElements", "name": "hyperscript in replacement content is initialized", "html": "
old
'\\\">go", "action": "find('#go').dispatchEvent('click'); find('#target').dispatchEvent('click')", "checks": [], "async": true }, { "category": "assignableElements", "name": "put into still works as innerHTML", "html": "
old
", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "collectionExpressions", "name": "works with DOM elements", "html": "
", "action": "find('button').click()", "checks": [], "async": true }, { "category": "collectionExpressions", "name": "where binds after in on closest", "html": "
ABC
", "action": "find('#b2').click()", "checks": [], "async": true }, { "category": "collectionExpressions", "name": "where in init followed by on feature", "html": "
AB
", "action": "find('button').click()", "checks": [], "async": true }, { "category": "collectionExpressions", "name": "where in component init followed by on feature", "html": "\n\t\t\t
AB
\n\t\t\t\n\t\t\tgo\n\t\t", "action": "find('test-where-comp').click()", "checks": [], "async": true }, { "category": "collectionExpressions", "name": "where with is not me followed by on feature", "html": "\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t
in the closest where it is not me\n\t\t\t\t on change set checked of the :checkboxes to my checked\">\n\t\t\t
\n\t\t", "action": "find('#master').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "child reads ^var set by parent", "html": "
0
", "action": "find('span').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "child writes ^var and parent sees it", "html": "
0
", "action": "find('button').click(); find('span').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "deeply nested child reads ^var from grandparent", "html": "
empty
", "action": "find('span').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "closest ancestor wins (shadowing)", "html": "
empty
", "action": "find('span').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "sibling subtrees have independent ^vars", "html": "
empty
empty
", "action": "find('#a span').click(); find('#b span').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "write to ^var not found anywhere creates on current element", "html": "
empty
", "action": "find('button').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "child write updates the ancestor, not a local copy", "html": "
0
", "action": "find('button').click(); find('span').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "increment works on inherited var", "html": "
", "action": "find('button').click(); find('button').click(); find('button').click(); find('span').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "dom keyword works as scope modifier", "html": "
0
", "action": "find('span').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "set ^var on explicit element", "html": "
read
", "action": "find('button').click(); find('span').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "on clause targets a specific ancestor", "html": "
read
", "action": "find('span').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "on clause with id reference", "html": "
read", "action": "find('button').click(); find('span').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "when reacts to ^var changes", "html": "
", "action": "find('button').click(); find('button').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "always reacts to ^var changes", "html": "
", "action": "find('button').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "multiple children react to same ^var", "html": "
", "action": "find('button').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "sibling subtrees react independently with ^var", "html": "
", "action": "find('#a button').click(); find('#a button').click(); find('#b button').click()", "checks": [], "async": true }, { "category": "dom-scope", "name": "bind works with ^var", "html": "
", "action": "find('input').fill('hello')", "checks": [], "async": true }, { "category": "dom-scope", "name": "derived ^var chains reactively", "html": "
", "action": "find('#price-btn').click(); find('#qty-btn').click()", "checks": [], "async": true }, { "category": "component", "name": "processes _ on inner elements", "html": "\n\t\t\t\n\t\t\t\n\t\t", "action": "find('test-inner button').click()", "checks": [], "async": true }, { "category": "component", "name": "supports multiple independent instances", "html": "\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t", "action": "find('#a button').click()", "checks": [], "async": true }, { "category": "component", "name": "blocks processing of inner hyperscript until render", "html": "\n\t\t\t\n\t\t\t\n\t\t", "action": "find('test-block span').click()", "checks": [], "async": true }, { "category": "component", "name": "does not process slotted _ attributes prematurely", "html": "\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tbefore\n\t\t\t\t\n\t\t\t
\n\t\t", "action": "find('test-slot-hs span').click()", "checks": [], "async": true }, { "category": "add", "name": "when clause sets result to matched elements", "html": "
", "action": "find('#trigger').dispatchEvent('click')", "checks": [], "async": true }, { "category": "add", "name": "when clause result is empty when nothing matches", "html": "
", "action": "find('#trigger').dispatchEvent('click')", "checks": [], "async": true }, { "category": "default", "name": "can default possessive properties", "html": "
", "action": "find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "default", "name": "can default of-expression properties", "html": "
", "action": "find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "default", "name": "can default array elements", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "default", "name": "default array element respects existing value", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "default", "name": "default preserves zero", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "default", "name": "default overwrites empty string", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "default", "name": "default preserves false", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "default", "name": "can default style ref when unset", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "default", "name": "default style ref preserves existing value", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "hide", "name": "can filter hide via the when clause", "html": "
", "action": "find('#trigger').dispatchEvent('click')", "checks": [], "async": true }, { "category": "increment", "name": "can increment an array element", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "increment", "name": "can decrement an array element", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "increment", "name": "can increment a possessive property", "html": "
5
", "action": "find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "increment", "name": "can increment a property of expression", "html": "
5
", "action": "find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "increment", "name": "can increment a style ref", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "js", "name": "handles rejected promises without hanging", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "put", "name": "put null into attribute removes it", "html": "
", "action": "find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "remove", "name": "can filter class removal via the when clause", "html": "
", "action": "find('#trigger').dispatchEvent('click')", "checks": [], "async": true }, { "category": "repeat", "name": "basic raw for loop with null works", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "repeat", "name": "basic property for loop works", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "repeat", "name": "bottom-tested repeat until", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "repeat", "name": "bottom-tested repeat while", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "repeat", "name": "bottom-tested loop always runs at least once", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "repeat", "name": "break exits a simple repeat loop", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "repeat", "name": "continue skips rest of iteration in simple repeat loop", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "repeat", "name": "break exits a for-in loop", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "repeat", "name": "break exits a while loop", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "repeat", "name": "for loop over undefined skips without error", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "settle", "name": "can settle a collection of elements", "html": "
", "action": "find('#trigger').dispatchEvent('click')", "checks": [], "async": true }, { "category": "show", "name": "the result in a when clause refers to previous command result, not element being tested", "html": "
in me when the result is 'found'\\\">
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "show", "name": "the result after show...when is the matched elements", "html": "
in me when its textContent is 'yes' if the result is empty put 'none' into #out else put 'some' into #out\\\">

yes

no

--
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "toggle", "name": "can toggle visibility", "html": "
", "action": "find('div').dispatchEvent('click'); find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "toggle", "name": "can toggle opacity w/ my", "html": "
", "action": "find('div').dispatchEvent('click'); find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "toggle", "name": "can toggle visibility w/ my", "html": "
", "action": "find('div').dispatchEvent('click'); find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "toggle", "name": "can toggle *display between two values", "html": "", "action": "find('div').dispatchEvent('click'); find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "toggle", "name": "can toggle *opacity between three values", "html": "
", "action": "find('div').dispatchEvent('click'); find('div').dispatchEvent('click'); find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "on", "name": "caught exceptions do not trigger 'exception' event", "html": "", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "on", "name": "rethrown exceptions trigger 'exception' event", "html": "", "action": "find('button').dispatchEvent('click')", "checks": [], "async": true }, { "category": "on", "name": "can ignore when target doesn\\'t exist", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "parser", "name": "can have comments in attributes (triple dash)", "html": "
", "action": "find('div').dispatchEvent('click')", "checks": [], "async": true }, { "category": "parser", "name": "element-level isolation still works with error recovery", "html": "
", "action": "find('#d2').dispatchEvent('click')", "checks": [], "async": true }, { "category": "scoping", "name": "element scoped variables span features w/short syntax", "html": "
", "action": "find('#d1').dispatchEvent('click'); find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "closest", "name": "closest does not consume a following where clause", "html": "
in the closest where it is not me on click put :others.length into #out\\\">
", "action": "find('#master').click()", "checks": [], "async": true }, { "category": "comparisonOperator", "name": "is a works with instanceof fallback", "html": "
", "action": "find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "comparisonOperator", "name": "is a Node works via instanceof", "html": "
", "action": "find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "comparisonOperator", "name": "is not a works with instanceof fallback", "html": "
", "action": "find('#d1').dispatchEvent('click')", "checks": [], "async": true }, { "category": "comparisonOperator", "name": "I precede works", "html": "
", "action": "find('#a').dispatchEvent('click')", "checks": [], "async": true }, { "category": "no", "name": "no with where on DOM elements", "html": "
AB
", "action": "find('button').click()", "checks": [], "async": true } ];