import { expect } from '@playwright/test'; import { createBdd } from 'playwright-bdd'; const { Given: given, When: when, Then: then } = createBdd(); then('the item should have a 7-character ID', async ({ page }) => { const idEl = page.locator('.font-mono.text-lg'); const text = await idEl.textContent(); expect(text?.trim()).toMatch(/^[23456789a-hjkmnp-z]{7}$/); }); then('the barcode URI should contain the ID', async ({ page }) => { const uri = page.locator('.font-mono').filter({ hasText: 'haus.toph.so' }); await expect(uri).toBeVisible(); });