My favourite VS Code extensions for writing tests in Cypress
by Filip Hric, September 11, 2020
2 min read
That’s what we needed, right? Another VS code extension blog 😂 But I guess I got your attention, so why not share a little bit of my workflow? This one is for all you testers and developers writing tests in Cypress.
Here’s to the lazy ones among us 🍻 Add .only extension does exactly what it claims to do. It filters your test by adding .only keyword to your it() block. It’s about 1 second faster than typing it yourself. Use that time well.
This plugin actually saves you more than 1 second, and maybe even a couple of minutes. Depends on how many tests you write. These snippets help you create a quick describe() or it() block, and can create a combination of these two for you. You can quickly create a before() or beforeEach() hook. And after() too. But don’t use that one.
With many tests in one spec, you might want to look into just the names of your tests. If you wan’t to fold all your it() blocks, you might find Fold plus extension really useful. Works something like this.
With all the different code blocks, it is easy to get lost in all the brackets. If you are like me, and like to move stuff around, chances are you will forget a bracket pair spend couple of days trying to find out which one is missing (or extra). With highlighting code blocks, it may take a little less.
Just a nice little addition to your VS code. To keep things organized different folders get different icons. Cypress-related files and folder get a nice little Cypress icon, so you can find them more easily.
Want to learn Cypress? Join the upcoming workshop!
Learn the core concepts, best practices and how write stable tests! Four sessions packed with great tips and on a live online workshop where you’ll learn by writing code, solving testing problems and getting your hands on Cypress. Register here!