Post Reply 
Author Easy method for testing the API methods ("InstantAPI";)
jakub-g
AT core team member

Find all posts by this user
Quote this message in a reply
Default  9 December 2013 12:49
It could be interesting to provide an easy way to test the API methods of certain AT classes without much overhead (mostly singleton util classes).

Say I want to test certain methods of http://aria/aria-templates/apidocs.html#aria.utils.Number with various inputs.

It's doable with InstantAT, but I'd have to:
- create a method in tpl script which calls the method-under-test and returns its value
- add stuff to $dependencies in tpl script
- call the method in tpl

One way would be to make a dumb HTML page doing all that by itself (perhaps a subpage of InstantAT), i.e. having the whole framework preloaded, or doing it lazily when needed.

We could bind http://ternjs.net/doc/demo.html to have the autocompletion if we want stuff to be displayed in the browser, or if we don't want to, then tell people to use their favorite dev tools for the autocompletion.

Even more interesting would be to integrate this functionality into API doc viewer, so that on each page you'd have a button which e.g. opens an inline mini-console and Aria.load()s the current class.

http://jakub-g.github.io/
(This post was last modified: 30 January 2014 12:12 by jakub-g.)
Olaf
Administrator

Find all posts by this user
Quote this message in a reply
30 January 2014 17:20
I like the idea (and even more the ability to test some methods directly from the APIdoc) but I'm not sure that's a very frequent use case. Most of the times I'd just go on the a page where AT is loaded, launch Firebug and test. Is it really something you do often?
jakub-g
AT core team member

Find all posts by this user
Quote this message in a reply
31 January 2014 11:24
(30 January 2014 17:20)Olaf Wrote:  Most of the times I'd just go on the a page where AT is loaded, launch Firebug and test.

This is exactly what I mean. Which URL do you use? Probably http://aria/aria-templates/aria/guide/ I guess, which is kind-of deprecated. Is there some good public URL easily accessible (easily = don't need to click through 3 pages)?
Anyway whatever the URL, for sure not all the classes are loaded there naturally - if you want to test some exotic class, you'd have to `Aria.load` it in your dev tools to use them first.

A dumb empty HTML page with everything from AT preloaded and easy URL would do the trick.

APIdoc integration would be even better 'cause
1) you could see the documentation just few lines above your console and not in another browser window
2) the magic button will fetch & load only what's needed, not the whole framework -> faster

http://jakub-g.github.io/
Post Reply