How to Get Code Coverage From Playwright Tests in a Sveltekit App

In this post, I will show you how to get code coverage reports from your Playwright tests in your SvelteKit app. So let’s imagine we are starting with the basic SvelteKit template. First, we need to install: npm i -D vite-plugin-istanbul We need the vite plugin to instrument our code using Istanbul. Istanbul is a tool which allows us to instrument our code such that it can determine which lines were covered by our tests. ...

TIL: How to Use Multiple Auth Files in Playwright

TIL: How to Load Authenticate State in Playwright In this post, I will quickly show you how you can reduce boilerplate code to log in to your app in Playwright tests. Log in to our app is a very common action that will likely be required in most of our tests. You can read this documentation here, which will explain how you can set this up. However, what do you do if you want to say test the login flow or the register flow? ...