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
This commit is contained in:
bymyself
2026-01-31 19:29:46 -08:00
parent 610165cde9
commit 71324f2408
2 changed files with 13 additions and 5 deletions

View File

@@ -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()
})

View File

@@ -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 }) => {