+1
日增长
9,103
stars
423
forks
153
watchers
113
prs
87
issues
2
releases
README
gremlins.js A monkey testing library written in JavaScript, for Node.js and the browser. Use it to check the robustness of web applications by unleashing a horde of undisciplined gremlins. Generate bookmarklet | Install docs Kate: _What are they, Billy?_ Billy Peltzer: _They're gremlins, Kate, just like Mr. Futterman said._ Table of Contents - Purpose - Installation - Basic Usage - Advanced Usage - Setting Gremlins and Mogwais To Use In A Test - Configuring Gremlins - Seeding The Randomizer - Executing Code Before or After The Attack - Setting Up a Strategy - Stopping The Attack - Customizing The Logger - Cypress - Playwright - Docs - Issues - 🐛 Bugs - 💡 Feature Requests - License Purpose While developing an HTML5 application, did you anticipate uncommon user interactions? Did you manage to detect and patch all memory leaks? If not, the application may break sooner or later. If n random actions can make an application fail, it's better to acknowledge it during testing, rather than letting users discover it. Gremlins.js simulates random user actions: gremlins click anywhere in the window, enter random data in forms, or move the mouse over elements that don't expect it. Their goal: triggering JavaScript errors, or making the application fail. If gremlins can't break an application, congrats! The application is robust enough to be released to real users. This practice, also known as Monkey testing or Fuzz testing, is very common in mobile application development (see for instance the Android Monkey program). Now that frontend (MV\, d3.js, Backbone.js, Angular.js, etc.) and backend (Node.js) development use persistent JavaScript applications, this technique becomes valuable for web applications. Installation This module is distributed via npm which is bundled with node and should be installed as one of your project's dependencies: npm i gremlins.js This library has dependencies listings for chance. gremlins.js is also available as a bookmarklet. Go to this page, grab it, and unleash hordes on any web page. Basic Usage A gremlins _horde_ is an army of specialized gremlins ready to mess up your application. _unleash_ the gremlins to start the stress test: js const horde = gremlins.createHorde(); horde.unleash(); // gremlins will act randomly, at 10 ms interval, 1000 times gremlins.js provides several gremlin _species_: some click everywhere on the page, others enter data in form inputs, others scroll the window in every possible direction, etc. You will see traces of the gremlins actions on the screen (they leave red traces) and in the console log: gremlin formFiller input 5 in gremlin formFiller input [email protected] in gremlin clicker click at 1219 301 gremlin scroller scroll to 100 25 ... A horde also contains _mogwais_, which are harmless gremlins (or, you could say that gremlins are harmful mogwais). Mogwais only monitor the activity of
Top issues
#199Is there an example of successfully finding a bug or error?3 comments · 2024-03-01#173Detailed logs 3 comments · 2020-10-16#182Bug: gremlins is not defined in some page2 comments · 2021-12-28#184Add support for right click (or in general other buttons)1 comments · 2022-01-20#178Unable to capture the result /log 1 comments · 2021-06-23#194Running gremlins.js on a webview0 comments · 2022-07-28#187Bug: gremlins.js aborts too early.0 comments · 2022-03-31#176the newly opened windows also be monkey tested0 comments · 2021-01-14
Latest release
Last release of 1.x.x 1.0.0 2020-04-08The 1.x.x is already a legacy version. Check roadmap to 2.0.