The My Picos page will be at http://localhost:8080/ , assuming that you have used the default port and are running the pico engine on your own machine.
When you visit this page, you will see a rounded rectangle which represents your owner pico. It can be dragged to move it to a different location on the canvas. You can drag a corner to reshape and resize it.
A single left mouse click on the rounded rectangle will open it up for a more detailed look at the properties of your owner pico.
The information about the pico is organized with tabs.
io.picolabs.logging
ruleset in the pico, and then turn logging on.The tests in the Testing tab are generated from information that you, the developer of a ruleset, define in your ruleset. The information must be bound to the name __testing
and that name must be shared by a pragma in the meta block of your ruleset. That is, the meta block must specify that the ruleset shares __testing
.
For example, consider this annotated screenshot of a Testing tab. The pico has three rulesets installed. Only the ruleset whose RID is timing_tracker
has its checkbox checked, so only its tests are showing. We just clicked on the link "__testing" so the Results area is showing the __testing
map itself.
Notice that this ruleset has defined four tests:
__testing
entries
timing/started
event with two event attributes, named number
and name
timing/finished
event with one event attribute, named number
By following the green arrows you can see which part of the __testing
map specified each test.
The timing_tracker
ruleset meta and global blocks are shown here:
ruleset timing_tracker { meta { shares entries, __testing } global { entries = function() { ent:timings.defaultsTo({}).values() } __testing = { "queries": [ { "name": "__testing" }, { "name": "entries" } ], "events": [ { "domain": "timing", "type": "started", "attrs": [ "number", "name" ] }, { "domain": "timing", "type": "finished", "attrs": [ "number" ] }] } } |
The name __testing
is bound to a map with two keys, "queries"
and "events"
, each of which is an array of maps.
Each query map has a key "name"
for the shared name bound to a function or value, and if needed, a key "args"
whose value is an array of argument names for a function.
An event map has keys "domain"
and "type"
for the domain and type of the event, and if needed, a key "attrs"
whose value is an array of attribute names.
For some specific uses of a test in the Testing tab, you might feel the need for variations. Some of these can be done by right-clicking on one of the text boxes and clicking "Inspect". Then, some simple edits of the generated HTML can let you adapt a test to your needs.
For example. for some testing during develpment of the technique for Triggering Events from Email Messages we needed to make the "to" box wider and, especially, the "text" box needed to be multi-lined in order to properly test the mail:parsed
event.
Inspecting the "to" box showed this HTML (edited to elide the actual ECI) in the browser's developer tools.
<form class="js-test sky-event" action="/sky/event/ECI/__testing/mail/parsed"> <input type="text" name="to" placeholder="to"> <input type="text" name="text" placeholder="text"> <button type="submit">mail/parsed</button> </form> |
Adding size="50"
to the "to" input
field and changing the "text" field from an input
tag to a textarea
tag will change the HTML shown in the developer tools to
<form class="js-test sky-event" action="/sky/event/ECI/__testing/mail/parsed"> <input type="text" name="to" placeholder="to" size="50"> <textarea type="text" name="text" placeholder="text"></textarea> <button type="submit">mail/parsed</button> </form> |
which, after some dragging of the lower-right corner of the textarea
box, will look like this.