mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +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
|
const tab = comfyPage.menu.nodeLibraryTab
|
||||||
await tab.getFolder('foo').click({ button: 'right' })
|
await tab.getFolder('foo').click({ button: 'right' })
|
||||||
await comfyPage.page.getByLabel('Customize').click()
|
await comfyPage.page.getByLabel('Customize').click()
|
||||||
await comfyPage.page
|
await comfyPage.page.getByRole('radio', { name: 'Folder' }).click()
|
||||||
.locator('.icon-field .p-selectbutton > *:nth-child(2)')
|
await comfyPage.page.getByRole('radio', { name: 'Blue' }).click()
|
||||||
.click()
|
|
||||||
await comfyPage.page
|
|
||||||
.locator('.color-field .p-selectbutton > *:nth-child(2)')
|
|
||||||
.click()
|
|
||||||
await comfyPage.page.getByRole('button', { name: 'Confirm' }).click()
|
await comfyPage.page.getByRole('button', { name: 'Confirm' }).click()
|
||||||
await comfyPage.nextFrame()
|
await comfyPage.nextFrame()
|
||||||
expect(
|
expect(
|
||||||
@@ -220,9 +216,7 @@ test.describe('Node library sidebar', () => {
|
|||||||
const tab = comfyPage.menu.nodeLibraryTab
|
const tab = comfyPage.menu.nodeLibraryTab
|
||||||
await tab.getFolder('foo').click({ button: 'right' })
|
await tab.getFolder('foo').click({ button: 'right' })
|
||||||
await comfyPage.page.getByLabel('Customize').click()
|
await comfyPage.page.getByLabel('Customize').click()
|
||||||
await comfyPage.page
|
await comfyPage.page.getByRole('radio', { name: 'Folder' }).click()
|
||||||
.locator('.icon-field .p-selectbutton > *:nth-child(2)')
|
|
||||||
.click()
|
|
||||||
await comfyPage.page.getByRole('button', { name: 'Confirm' }).click()
|
await comfyPage.page.getByRole('button', { name: 'Confirm' }).click()
|
||||||
await comfyPage.nextFrame()
|
await comfyPage.nextFrame()
|
||||||
expect(
|
expect(
|
||||||
@@ -258,9 +252,7 @@ test.describe('Node library sidebar', () => {
|
|||||||
await comfyPage.page.locator('.p-colorpicker-color-background').click()
|
await comfyPage.page.locator('.p-colorpicker-color-background').click()
|
||||||
|
|
||||||
// Finalize the customization
|
// Finalize the customization
|
||||||
await comfyPage.page
|
await comfyPage.page.getByRole('radio', { name: 'Folder' }).click()
|
||||||
.locator('.icon-field .p-selectbutton > *:nth-child(2)')
|
|
||||||
.click()
|
|
||||||
await comfyPage.page.getByRole('button', { name: 'Confirm' }).click()
|
await comfyPage.page.getByRole('button', { name: 'Confirm' }).click()
|
||||||
await comfyPage.nextFrame()
|
await comfyPage.nextFrame()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user