DocumentationGetting StartedWrite your first test

Write your first test

8 min readLast updated 2026-04-22

Create a passing test using the Visual Builder, Playwright codegen, or writing TypeScript directly.

Check Studio supports three authoring modes. This guide covers all three so you can choose the best fit for your team.

Option 1: Visual Builder (no-code)

  1. 1Open the Check Studio dashboard and click "New Test"
  2. 2Enter your app URL and click "Start recording"
  3. 3Interact with your app normally — clicks, typing, navigation
  4. 4Add assertions by clicking elements and selecting checks (text visible, element exists, etc.)
  5. 5Save and run the test

Option 2: Playwright codegen

1

Start codegen

Use the built-in codegen to record interactions and output Playwright code.

checkstudio codegen https://your-app.com
bash
2

Edit the generated script

The output is standard Playwright code. Add assertions and structure it into a test file.

import { test, expect } from '@playwright/test';

test('homepage loads', async ({ page }) => {
  await page.goto('https://your-app.com');
  await expect(page.locator('h1')).toContainText('Welcome');
});
typescript

Option 3: Write from scratch

Create a .spec.ts file in your tests directory. Use role-based and label-based selectors for resilience.

test('user can sign in', async ({ page }) => {
  await page.goto('/login');
  await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
  await page.getByRole('button', { name: 'Sign in' }).click();
  await expect(page.getByText('Dashboard')).toBeVisible();
});
typescript

Best practice

Always prefer getByRole and getByLabel over CSS selectors. They survive DOM changes and improve accessibility.

Was this article helpful?

Still have questions?

Our support team is here to help. Reach out directly or search the docs.