From 71324f24088bc81dc1cb8c8aff343c199219e536 Mon Sep 17 00:00:00 2001 From: bymyself Date: Sat, 31 Jan 2026 19:29:46 -0800 Subject: [PATCH] fix: use specific role selectors to avoid strict mode violations Section headers in Global Settings are uppercase buttons (NODES, CANVAS, CONNECTION LINKS), not plain text. Using getByRole with exact name avoids matching tabs and setting labels with similar text. Amp-Thread-ID: https://ampcode.com/threads/T-019c16eb-8621-7473-9062-a57b0a1e782a --- .../propertiesPanelGlobalSettings.spec.ts | 10 +++++++--- .../tests/propertiesPanel/propertiesPanelTabs.spec.ts | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/browser_tests/tests/propertiesPanel/propertiesPanelGlobalSettings.spec.ts b/browser_tests/tests/propertiesPanel/propertiesPanelGlobalSettings.spec.ts index a9936a9445..d7a827892a 100644 --- a/browser_tests/tests/propertiesPanel/propertiesPanelGlobalSettings.spec.ts +++ b/browser_tests/tests/propertiesPanel/propertiesPanelGlobalSettings.spec.ts @@ -13,20 +13,24 @@ test.describe('Properties panel global settings', { tag: ['@ui'] }, () => { test('displays Nodes section', async ({ comfyPage }) => { const { propertiesPanel } = comfyPage - await expect(propertiesPanel.root.getByText('Nodes')).toBeVisible() + await expect( + propertiesPanel.root.getByRole('button', { name: 'NODES' }) + ).toBeVisible() }) test('displays Canvas section', async ({ comfyPage }) => { const { propertiesPanel } = comfyPage - await expect(propertiesPanel.root.getByText('Canvas')).toBeVisible() + await expect( + propertiesPanel.root.getByRole('button', { name: 'CANVAS' }) + ).toBeVisible() }) test('displays Connection Links section', async ({ comfyPage }) => { const { propertiesPanel } = comfyPage await expect( - propertiesPanel.root.getByText('Connection Links') + propertiesPanel.root.getByRole('button', { name: 'CONNECTION LINKS' }) ).toBeVisible() }) diff --git a/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts b/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts index 80272ad0fa..b9ca6cb7cc 100644 --- a/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts +++ b/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts @@ -20,8 +20,12 @@ test.describe('Properties panel tab navigation', { tag: ['@ui'] }, () => { await expect(propertiesPanel.root.getByText('KSampler')).toBeVisible() await propertiesPanel.clickTab('Global Settings') - await expect(propertiesPanel.root.getByText('Nodes')).toBeVisible() - await expect(propertiesPanel.root.getByText('Canvas')).toBeVisible() + await expect( + propertiesPanel.root.getByRole('button', { name: 'NODES' }) + ).toBeVisible() + await expect( + propertiesPanel.root.getByRole('button', { name: 'CANVAS' }) + ).toBeVisible() }) test('switches between tabs in single node mode', async ({ comfyPage }) => {