Rod is a High-level Chrome Devtools controller directly based on Chrome DevTools Protocol. Rod also tries to expose low-level interfaces to users, so that whenever a function is missing users can easily send control requests to the browser directly.
- Fluent interface design to reduce verbose code
- Chained context design, intuitive to timeout or cancel the long-running task
- Debugging friendly, auto input tracing, and screenshots
- Automatically find or download chrome
- No external dependencies, CI tested on Linux, Mac, and Windows
- High-level helpers like WaitStable, WaitRequestIdle, GetDownloadFile, Resource
- Two-step WaitEvent design, never miss an event
- Correctly handles nested iframes
- No zombie chrome process after the crash (how it works)
Here are the basic examples. For more details, please read the unit tests.
A cli google translator example.
To let rod work with docker is very easy. Here's the example to demonstrate how to build an image and run the unit tests of Rod:
docker build -t test https://github.com/ysmood/rod.git
docker run --rm --cap-add=SYS_ADMIN -it test
There are a lot of great projects, but no one is perfect, choose the best one that fits your needs is important.
-
With Puppeteer, you have to handle promise/async/await a lot. It requires a deep understanding of how promises works which are usually painful for QA to write automation tests. End to end tests usually requires a lot of sync operations to simulate human inputs, because Puppeteer is based on Nodejs all control signals it sends to chrome will be async calls, so it's unfriendly for QA from the beginning.
-
With Chromedp, you have to use their verbose DSL like tasks to handle the main logic and it's painful to deal with iframes. Because Chromedp uses several wrappers to handle execution with context and options which makes it very hard to understand their code when bugs happen. When a crash happens, Chromedp will leave the zombie chrome process on Windows and Mac.
-
Cypress is very limited, to test cross-domain iframes such as payments, it's almost unusable. Read their limitation doc.