Guide
How to check a web page against its Figma design, automatically
A page drifts from its design one small change at a time: a corner radius here, a font weight there. A design check makes an end-to-end test compare a component on the real page with its node in your Figma file on every run, and fail with the expected and the found value side by side. This guide shows how it works in Assertline.
What a design check compares
You link one component on the page, such as a button or a card, to its node in your project's Figma file. Each run then reads how the browser actually draws that component and compares it with the design:
- Colours, such as the background and the text colour.
- Typography: the font, its weight and its size.
- Corner radius.
- Size.
A second kind, the spacing check, measures the gap between two elements, or how far an element sits from the edges of its container, against the number of pixels you expect.
A design check compares values, not pictures. It does not compare whole screenshots, so a change somewhere else on the page does not fail it, and a difference is reported as a value: "Radius 8 px in the design, 4 px on the page".
What you need
- Your design in Figma, with the component as a node of its own.
- A Figma personal access token with read access to file content. In Figma it is under Settings, Security, Personal access tokens.
- An owner or an admin of your Assertline organization, to connect the file once.
- The free recorder in Chrome, Edge or Brave. Design checks are included on every plan, the Free plan too.
Step 1: connect the Figma file to your project
- In the Assertline dashboard open Projects and, on your project, choose Set up Figma.
- Paste the link of the Figma file and the personal access token.
- Press Save. The token is checked by opening the file, then stored encrypted and never shown again.
The token can be removed at any time. It is then deleted from Assertline; at Figma it stays valid until you revoke it there.
Step 2: add a design check while you record
- Start a recording on your site and go to the page that holds the component. (How to record a test.)
- Press Add check on the recorder's toolbar and choose the design check.
- Point at the component on the page, then choose its node in the Figma file.
- Carry on recording, or press Stop.
For a spacing check you point at two elements instead, or at an element and the box it sits in, and say how many pixels there should be.
Step 3: run the test and read the differences
Every run of the test now makes the comparison. When the page matches, the step passes. When it does not, the run fails and lists each property with the value in the design and the value found on the page:
| Property | In the Figma design | On the page | Result |
|---|---|---|---|
| Background | #5b47f2 | #7362ff | Differs |
| Radius | 8 px | 4 px | Differs |
| Font | Inter 600 · 13 px | Inter 600 · 13 px | Same |
| Height | 36 px | 36 px | Same |
Because the check is a step of an ordinary test, it runs wherever the test runs: in your own Chrome, on your computer, on a schedule, from your pipeline or in the cloud. A design that drifted is caught by the next run, not by the next design review.
What a design check does not do
- It does not compare screenshots, and it does not judge a whole page at once: each check is about one component you chose.
- It does not work on something inside an embedded frame. The recorder tells you so when you try.
- It reads designs from Figma only.
- At a phone or tablet size a design check still compares with the node it was linked to. Link a separate node for a separate mobile design.
Questions
Does a design check compare screenshots?
No. It compares values: the colours, typography, corner radius and size the browser uses for a component, with the values of its node in Figma. A difference is reported as two values side by side.
Is my Figma token safe?
The token is stored encrypted and is never shown again, not even to you. It can be removed from the project at any time, and you can revoke it at Figma.
Are design checks on the Free plan?
Yes. Page, network and design checks are included on every plan.
Can a design check run in my pipeline?
Yes. A design check is a step of a test, so it runs wherever that test runs. Starting tests from a pipeline is part of Pro.
Catch design drift on the next run
Connect a Figma file, link one component, and let every run compare it. The recorder and the Free plan cost nothing.