mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-10 01:50:08 +00:00
test: migrate brittle :nth-child() selectors to getByRole('radio')
- Replace 4 CSS selectors with semantic locators in nodeLibrary.spec.ts - Uses PrimeVue SelectButton's accessible radio button names - Part of Playwright best practices remediation Amp-Thread-ID: https://ampcode.com/threads/T-019c11ff-0d10-771a-abaf-7d8d908800b3 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -197,12 +197,8 @@ test.describe('Node library sidebar', () => {
|
||||
const tab = comfyPage.menu.nodeLibraryTab
|
||||
await tab.getFolder('foo').click({ button: 'right' })
|
||||
await comfyPage.page.getByLabel('Customize').click()
|
||||
await comfyPage.page
|
||||
.locator('.icon-field .p-selectbutton > *:nth-child(2)')
|
||||
.click()
|
||||
await comfyPage.page
|
||||
.locator('.color-field .p-selectbutton > *:nth-child(2)')
|
||||
.click()
|
||||
await comfyPage.page.getByRole('radio', { name: 'Folder' }).click()
|
||||
await comfyPage.page.getByRole('radio', { name: 'Blue' }).click()
|
||||
await comfyPage.page.getByRole('button', { name: 'Confirm' }).click()
|
||||
await comfyPage.nextFrame()
|
||||
expect(
|
||||
@@ -220,9 +216,7 @@ test.describe('Node library sidebar', () => {
|
||||
const tab = comfyPage.menu.nodeLibraryTab
|
||||
await tab.getFolder('foo').click({ button: 'right' })
|
||||
await comfyPage.page.getByLabel('Customize').click()
|
||||
await comfyPage.page
|
||||
.locator('.icon-field .p-selectbutton > *:nth-child(2)')
|
||||
.click()
|
||||
await comfyPage.page.getByRole('radio', { name: 'Folder' }).click()
|
||||
await comfyPage.page.getByRole('button', { name: 'Confirm' }).click()
|
||||
await comfyPage.nextFrame()
|
||||
expect(
|
||||
@@ -258,9 +252,7 @@ test.describe('Node library sidebar', () => {
|
||||
await comfyPage.page.locator('.p-colorpicker-color-background').click()
|
||||
|
||||
// Finalize the customization
|
||||
await comfyPage.page
|
||||
.locator('.icon-field .p-selectbutton > *:nth-child(2)')
|
||||
.click()
|
||||
await comfyPage.page.getByRole('radio', { name: 'Folder' }).click()
|
||||
await comfyPage.page.getByRole('button', { name: 'Confirm' }).click()
|
||||
await comfyPage.nextFrame()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user