record browser events for QA to help make tickets/issues
npm install recordoCreating useful bug reports should be dead-simple.
Normal people don't open a debugging console when testing. They just _"do stuff and then it breaks"_. This records the stuff they did and what they said/got from the server to help when filing bugs. It does everything except push the Report an Issue button for them.
Demo it in action here (note the little [[##]] in the bottom-right)
1. Add ?collect=true to the end of any URL to start collecting a replay log.
2. _(...do stuff until you find a bug...)_
3. Click the Copy button in the bottom-right corner of the page to copy the log (plus your browser info) to your clipboard.
4. Create a ticket in your issue tracker and paste the log
When you hover over the [[23]] (number of messages recorded), the control panel opens up:
- X Stop all the logging and instrumentation
- Clear clear the log (if you are starting a new test)
- Copy copy the log and :sparkles: _Browser Info_ :sparkles: to the clipboard (and eventually the exact manifest/config of the server)
Something like the following will then be on your clipboard which you can paste into the ticket tracker of your choice (it also contains the request/response JSON with the server):
`` some HTMLjs`
current_url: 'http://philschatz.com/gh-board/'
current_window: [800, 600],
browser: {os: "MacIntel", userAgent: "Mozilla/5.0..."},
log: [
["USER:CLICK", "div.collapse.navbar-collapse"]
["XHR:START", "GET", "/api/tasks/226"]
["XHR:LOAD", "GET", "/api/tasks/226", 200, {"id":...}] // <-- request query and POST body
["USER:CLICK", "button.async-button.continue[type='button']>span", "Continue"]
["HISTORY:URL", "/courses/3/tasks/226/steps/2/"] // <-- user going to a different page
["XHR:START", "GET", "/api/steps/3653"]
["XHR:LOAD", "GET", "/api/steps/3653", 200, "
["USER:CLICK", "div.answer-letter"]
["HISTORY:POP", "/courses/3/tasks/226/steps/1/"] // <-- clicked browser back button
["UNCAUGHT", "data is undefined", "index.js", 1000, 10] // <-- uncaught JS errors
["HISTORY:UNLOAD"] // <-- Either refresh was clicked or the user went to another page
["WINDOW:SIZE", 800, 600] // <-- user resized the window
["CONSOLE:LOG", "Some message", 4, [1, true]]
]
Since it's part of the webpage it will. You'll be creating bug reports on mobile devices in no time!
1. npm install --save recordo
2. Add the Javascript file
- For simple sites:
1. add window.__Recordo.initialize(); __Recordo.start()
2. call require('recordo').initialize()
- For browserify projects:
- add to the code"production" !== process.env.NODE_ENV
- if you do not want the code in production, wrap it in @import (inline) '~recordo/recordo.css';
and pass that env variable in a way that Uglify can optimize it out
3. Add the CSS file
- For LessCSS: add
1. run npm starthttp://localhost:8080
2. point your browser to
- [x] Log _all_ console messageswindow.Error` because you shouldn't be constructing errors unless you're throwing them
- [x] Log window resizes
- [ ] wrap