① Value assertions
Pure-JS comparisons. No browser needed — these are the same matchers you'd see in Jest. Synchronous; no await on the outer expect.
import { test, expect } from '@playwright/test';
test('value assertions', async () => {
expect(1 + 1).toBe(2);
expect('playwright').toContain('play');
expect([1, 2, 3]).toEqual([1, 2, 3]);
expect(true).toBeTruthy();
expect(false).toBeFalsy();
expect(null).toBeNull();
expect(50).toBeGreaterThan(10);
expect({ role: 'admin' }).toEqual({ role: 'admin' });
expect({ age: 20, role: 'admin' }).toEqual({ role: 'admin', age: 20 });
});