Cypress Tips January 2022 news
Monthly collection of my new tips, videos, blog posts, and upcoming talks
Hello there,
Hard to believe it, but it is the middle of January. Since my last “Cypress Advent Calendar” email, I was pretty busy. Working at Mercari US was very productive, and almost all the new posts and videos are directly related to the questions I wanted to answer for my team. Here are some of the Cypress-related resources you might find useful.
Blog posts
Once Cypress finishes running, you might want to report its results. With my new plugin cypress-json-results it is easy to get the test results as a JSON file, and then you can do whatever you want with them.
I opposed using test tags for a while, instead relying on the integration folder structure to select the tests to run. Finally, I gave up and we are now using test and suite tags to pick the tests to run - and I love it. I wrote a long blog post showing how to tag and execute the tests on CI.
In another blog post “Know Your Tests“, I describe a little utility find-cypress-specs that lets me see all the tests in the current project and how they are tagged.
Videos
In addition to writing, I have been recording lots of little testing videos. Some of my favorite short videos show how to fix “mixing async and sync code” error, how to refactor tests to use the built-in Cypress commands and network control, and how to report a Cypress bug. But my most favorite videos from this month deserve a special mention, so I will embed them below.
I love using Cypress Component Testing, and that is the way to develop React components while seeing the tests run in the real browser.
I also love solving the “Element detached from DOM” error, and in the video below I show how to solve it using Cypress element aliases
The final video teaches you how to write small unit tests to execute in Cypress so you can avoid bringing another test runner just to code up a few tests.
Of course, if you do need to write some Node unit tests, here is a video teaching you to E2E test CLI utilities using Ava snapshots.
Upcoming conferences and workshops
I am taking a break in January, but February will be full of new presentations and online workshops. Catch me at QA Global Summit, ConFoo.CA, and teaching the Smashing Magazine workshop on E2E testing. I even put together a page on my site cypress.tips/workshops with scheduled and available workshops. A quick reminder that my workshops are open source and you can go through the material yourself for free.