How to Record Screen Actions as a Puppeteer Script

One of the new (experimental) additions to the Chrome 89 DevTools is the Puppeteer Recorder: DevTools can now generate Puppeteer scripts based on your interaction with the browser, making it easier for you to automate browser testing. Simply start a new recording and as you click around you’ll see Puppeteer code being generated. Stefan Judis …

Find the Commit that Broke the Tests with `git rebase –exec`

Nice tip by Kamran Ahmed: Find the commit that broke the tests $ git rebase -i –exec "yarn test" d294ae9 This will run "yarn test" on all the commits between d294ae9 and HEAD and stop on the commit where the tests fail — Kamran Ahmed (@kamranahmedse) February 2, 2020 If you want to go back …

Testing React Hooks With Enzyme and React Testing Library

Solid intro to test your React apps with either Enzyme or React Testing Library: In this tutorial, we will look at how to do that by making use of a to-do application built with hooks. We’ll cover writing of tests using Ezyme and React Testing Library, both of which are able to do just that. …

Tests and types

Brent has some thoughts on strong and weakly typed programming languages. Starting point: a simple function that needs testing: rgbToHex(red, green, blue) { // … } Testing the result the function should return is easy. But what about edge cases? What happens though if we pass doubles instead of integers? Or numbers outside of the …

Speeding up Your PHPUnit tests

Some nice tips by Tim MacDonald on how to speed up your PHPUnit tests! Having a fast test suite can be just as important as having a fast application. As a developer, getting feedback quickly about the state of your code allows for a much quicker development turnaround. Here we are going to run through …

Run your tests using Jest & Puppeteer with jest-puppeteer

With jest-puppeteer – and its included expect-puppeteer assertion library – it’s possible to use Puppeteer within your Jest tests. Writing integration test can be done using Puppeteer API but it can be complicated and hard because API is not designed for testing. To make it simpler, an expectPage() is automatically installed and available, it provides …

Automatic visual diffing with Puppeteer

A few years ago we got Wraith and Huxley to perform visual regression testing. Monica Dinculescu has created a likewise thingy, powered by Puppeteer: I did a little song-and-dance that sets up Puppeteer, takes screenshots of your app (like, all the routes you care about), and then compares them to the “golden” ones. If they …

End-to-end Tests that Don’t Suck with Puppeteer

Good introduction to using Puppeteer for your e2e tests: One of the most popular tools for e2e testing is Selenium, which is a tool for automating web browsers. Selenium sounds cool in theory: write one set of tests that run on all browsers and devices, woohoo! Jk. In practice, Selenium tests are slow, brittle, and …

Gremlins.js – Monkey testing library for web apps and Node.js

gremlins.js is 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. I especially like the syntax to start a test: var horde = gremlins.createHorde(); horde.unleash(); And oh, make sure you don’t run any tests after midnight …