Skip to content

Commit

Permalink
Document remaining gremlin species
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Jan 7, 2014
1 parent 520b3ef commit 806f3e5
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/species/clicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* By default, the clicker gremlin activity is showed by a red circle.
*
* var clickerGremlin = gremlins.gremlins.clicker();
* var clickerGremlin = gremlins.species.clicker();
* horde.gremlin(clickerGremlin);
*
* The clicker gremlin can be customized as follows:
Expand All @@ -22,7 +22,7 @@
*
* Example usage:
*
* horde.gremlin(gremlins.gremlins.clicker()
* horde.gremlin(gremlins.species.clicker()
* .clickTypes(['click'])
* .positionSelector(function() {
* // only click inside the foo element area
Expand Down
21 changes: 21 additions & 0 deletions src/species/formFiller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/**
* The formFiller gremlin fills forms by entering data, selecting options, clicking checkboxes, etc
*
* As much as possible, the form filling is done using mouse and keyboard
* events, to trigger any listener bound to it.
*
* By default, the formFiller gremlin activity is showed by changing the
* element border to solid red.
*
* var formFillerGremlin = gremlins.species.formFiller();
* horde.gremlin(formFillerGremlin);
*
* The formFiller gremlin can be customized as follows:
*
* formFillerGremlin.elementMapTypes({'select': function selectFiller(element) {} }); // form element filler functions
* formFillerGremlin.showAction(function(element) { // show the gremlin activity on screen });
* formFillerGremlin.canFillElement(function(element) { return true }); // to limit where the gremlin can fill
* formFillerGremlin.maxNbTries(5); // How many times the gremlin must look for a fillable element before quitting
* formFillerGremlin.logger(loggerObject); // inject a logger
* formFillerGremlin.randomizer(randomizerObject); // inject a randomizer
*/
define(function(require) {
"use strict";

Expand Down
27 changes: 27 additions & 0 deletions src/species/scroller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
/**
* The scroller gremlin scrolls the viewport to reveal another part of the document
*
* var scrollerGremlin = gremlins.species.scroller();
* horde.gremlin(scrollerGremlin);
*
* The scrollerGremlin gremlin can be customized as follows:
*
* scrollerGremlin.positionSelector(function() { // return a random position to scroll to });
* scrollerGremlin.showAction(function(element) { // show the gremlin activity on screen });
* scrollerGremlin.logger(loggerObject); // inject a logger
* scrollerGremlin.randomizer(randomizerObject); // inject a randomizer
*
* Example usage:
*
* horde.gremlin(gremlins.species.clicker()
* .positionSelector(function() {
* // only click in the app
* var $list = $('#todoapp');
* var offset = $list.offset();
* return [
* parseInt(Math.random() * $list.outerWidth() + offset.left),
* parseInt(Math.random() * ($list.outerHeight() + $('#info').outerHeight()) + offset.top)
* ];
* })
* )
*/
define(function(require) {
"use strict";

Expand Down
20 changes: 20 additions & 0 deletions src/species/typer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/**
* The typer gremlin types keys on the keyboard
*
* Note that keyboard events must be localized somewhere on screen, so this
* gremlins picks a random screen location first.
*
* By default, the typer gremlin activity is showed by a letter surrounded by
* a red circle.
*
* var typerGremlin = gremlins.species.typer();
* horde.gremlin(typerGremlin);
*
* The typerGremlin gremlin can be customized as follows:
*
* typerGremlin.eventTypes(['keypress', 'keyup', 'keydown']); // types of events to trigger
* typerGremlin.showAction(function(element) { // show the gremlin activity on screen });
* typerGremlin.logger(loggerObject); // inject a logger
* typerGremlin.randomizer(randomizerObject); // inject a randomizer
*
*/
define(function(require) {
"use strict";

Expand Down

0 comments on commit 806f3e5

Please sign in to comment.