mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-01 03:04:11 +00:00
fix(browser_tests): use getByRole for interactive elements
Replace fragile CSS selectors with Playwright getByRole() for better accessibility-based testing: - bottomPanelShortcuts.spec.ts: button[aria-label] -> getByRole - execution.spec.ts: .p-dialog-close-button -> getByRole - backgroundImageUpload.spec.ts: button:has(.pi-*) -> getByRole - nodeHelp.spec.ts: button:has(.pi-question) -> getByRole - BaseDialog.ts: closeButton uses getByRole - ComfyNodeSearchBox.ts: Add button uses getByRole - Topbar.ts: close-button uses getByRole Amp-Thread-ID: https://ampcode.com/threads/T-019c155c-92e1-76f3-b6ce-7fc3ffa11582 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -88,7 +88,9 @@ test.describe('Node Help', { tag: ['@slow', '@ui'] }, () => {
|
||||
await ksamplerNode.hover()
|
||||
|
||||
// Click the help button
|
||||
const helpButton = ksamplerNode.locator('button:has(.pi-question)')
|
||||
const helpButton = ksamplerNode.getByRole('button', {
|
||||
name: /learn more/i
|
||||
})
|
||||
await expect(helpButton).toBeVisible()
|
||||
await helpButton.click()
|
||||
|
||||
@@ -118,7 +120,9 @@ test.describe('Node Help', { tag: ['@slow', '@ui'] }, () => {
|
||||
.filter({ hasText: 'KSampler' })
|
||||
.first()
|
||||
await ksamplerNode.hover()
|
||||
const helpButton = ksamplerNode.locator('button:has(.pi-question)')
|
||||
const helpButton = ksamplerNode.getByRole('button', {
|
||||
name: /learn more/i
|
||||
})
|
||||
await helpButton.click()
|
||||
|
||||
// Verify help page is shown
|
||||
|
||||
Reference in New Issue
Block a user