whipcream
Chai-style chaining sugar for webdriverjs
An experimental wrapper around webdriverjs that lets you write browser automation tests as one readable, chainable sentence instead of messy nested callbacks.
Whipcream makes writing browser automation tests feel more natural and readable. Instead of writing clunky test code with lots of callbacks and method calls, you can chain commands together in a fluent, left-to-right style that reads almost like English.
When you're testing a web application, you need to automate a browser — click buttons, fill in forms, check if elements are visible, and verify text content. Normally this involves writing code with nested callbacks or promise chains that can get messy fast. Whipcream wraps the webdriverjs library (a tool for controlling browsers programmatically) and adds a layer of syntactic sugar inspired by Chai, a popular assertion library. This means you can write one long chain of commands instead of breaking them into separate statements.
For example, you can find an element on the page with .$('#new-todo'), type text into it with .enter('test1'), press a key with .key('Enter'), then immediately check another element's state with .$('.todo').should.have.count(1) — all in one readable chain. Each assertion and action flows into the next, and you only call .call(done) once at the very end to finish. You'd use this if you're building end-to-end tests for a web app — say, testing a to-do list app to make sure creating a new item actually works.
The project is still marked as work-in-progress, so it's an experiment rather than a polished, production-ready tool. The README doesn't go into detail about installation, setup, or the full list of available assertions and actions, but the core idea is clear: it trades some technical complexity for test code that's easier for humans to read and write.
Where it fits
- Write end-to-end browser tests as a single readable chain instead of nested callbacks.
- Test a to-do list style app by chaining clicks, typing, and assertions in one flow.
- Prototype more human-readable test syntax on top of webdriverjs for your own project.