Hello everyone! I always looked skeptically at test automation frameworks with a dual purpose - UI & API test coverage. Usually, you will run different layers of tests in different test runs (or event projects), as each of them probably has its own , and . dependencies configuration, environment variables Recently, I took a look at what has to offer in terms of testing and compared it with my experience, so here’s what I’ve got to share with y’all… Playwright API Cypress Cypress made testing possible a while ago. You can find about how great this tool is in terms of testing with examples. Cypress API an article on the learn portal API Installation Performance In order to run tests, you need to install your project dependencies, correct? Well, comes with , and it might be quite redundant (and time-consuming) to install if you want to run tests exclusively (let’s say, you’ve got separate jobs in CI for UI & API test runs, which is usually the case). Cypress an electron browser API Doesn’t look good, huh? ☝️ Also, when you run tests - it launches a browser anyway. API Test Example A simple test with would look like this: API Cypress it('Sign in with valid credentials', () => { cy.request('POST', '/auth', { login: Cypress.env('username'), password: Cypress.env('password'), }).should(response => { expect(response.body.token).to.be.a('string') expect(response.status).to.eq(200) }) }) Looks pretty simple and straightforward, huh? It’s important to say here that it’s a common syntax - , instead of writing every output into variable (even though ). Cypress i.e. chaining stuff it’s possible with some tweaks Playwright Just like , is a test automation framework - you can use exclusively, or (test runner, assertion library, browser automation tool, HTTP client, reporter, etc). Cypress Playwright just a browser automation tool the whole framework Installation Performance The difference here is that doesn’t come with any browsers out of the box - you have to install them with a separate command (if you want to). Playwright It makes a huge difference here, as in terms of running tests exclusively, it won’t run any browser or any other desktop app and save some run time & resources on your machine. API Test Example A simple test with would look like this: API Playwright import {test, expect} from '@playwright/test' test('Sign in with valid credentials', async ({request}) => { const response = await request.post('/auth', { data: { login: process.env.USERNAME, password: process.env.PASSWORD, }, }) expect(response.status()).toEqual(200) expect(await response.json()).toEqual({ token: expect.any(String), }) }) I’d like to highlight of asserting objects: a Jest-like syntax expect(await response.json()).toEqual({ token: expect.any(String), }) This syntax allows you to verify the whole structure of the object with just a single call ☝️ expect Conclusion API tests are supposed to be small & lightweight as they don’t require too much to run. Let’s sum up the material above… Installation Performance ✅ wins with faster clean installation out of a box. Playwright 13x ℹ️ You can reduce installation time in if or . Cypress CI use an image with pre-installed dependencies cache them in your CI storage Run Performance ✅ wins as it doesn’t require a browser to run API tests, so it goes straight to the point. Playwright ℹ️ There’s no way to “not to run” the browser in API tests, as it’s part of the framework’s logic. Test Syntax Can’t pick a winner here, as there’s no objective advantage for neither nor . Cypress Playwright They both got pretty straightforward syntax with slight differences. I’d say it’s the tester’s decision to pick what they like here. Overall I can definitely say that it’s safe enough to use for test automation due to its performance. It’d be a fair solution if you’ve already got tests with this framework. Playwright API UI My advice for those who use for tests and want to cover the layer - better use something else ( + , you can see an example ). Cypress UI API Jest Axios there