import { chromium } from 'playwright'; const BASE = process.env.BASE_URL ?? 'http://localhost:5173'; const b = await chromium.launch(); const ctx = await b.newContext(); const p = await ctx.newPage(); await p.goto(BASE + '/uix/components/button', { waitUntil: 'networkidle' }); await p.waitForTimeout(400); // Try to set color=affirm via the color chips const affirmChip = p.locator('button[data-uix-chip]:has-text("affirm")').first(); if ((await affirmChip.count()) > 0) { await affirmChip.click(); await p.waitForTimeout(200); const d = await p .locator('[data-button]') .first() .evaluate((el: Element) => ({ dataColor: el.getAttribute('data-color'), bg: getComputedStyle(el).backgroundColor, paletteSolid: getComputedStyle(el).getPropertyValue('--button-palette-solid').trim(), solidBg: getComputedStyle(el).getPropertyValue('--button-solid-bg').trim() })); console.log('button data-color=affirm', JSON.stringify(d)); } await b.close();