mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
## Summary Add eslint-plugin-playwright as an oxlint JS plugin scoped to browser_tests/, enforcing Playwright best practices at lint time. ## Changes - **What**: Configure eslint-plugin-playwright@2.10.1 via oxlint's alpha `jsPlugins` field (`.oxlintrc.json` override scoped to `browser_tests/**/*.ts`). 18 recommended rules + `prefer-native-locators` + `require-to-pass-timeout` at error severity. All 173 initial violations resolved (config, auto-fix, manual fixes). `no-force-option` set to off — 28 violations need triage (canvas overlay workarounds vs unnecessary force) in a dedicated PR. - **Dependencies**: `eslint-plugin-playwright@^2.10.1` (devDependency, required by oxlint jsPlugins at runtime) ## Review Focus - `.oxlintrc.json` override structure — this is the first use of oxlint's JS plugins alpha feature in this repo - Manual fixes in spec files: `waitForSelector` → `locator.waitFor`, deprecated page methods → locator equivalents, `toPass()` timeout additions - Compound CSS selectors replaced with `.and()` (Playwright native locator composition) to avoid `prefer-native-locators` suppressions - Lint script changes in `package.json` to include `browser_tests/` in oxlint targets --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: GitHub Action <action@github.com>
87 lines
2.7 KiB
TypeScript
87 lines
2.7 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '@e2e/fixtures/ComfyPage'
|
|
|
|
test.describe('Vue Node Collapse', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.Graph.CanvasMenu', false)
|
|
await comfyPage.settings.setSetting('Comfy.EnableTooltips', true)
|
|
await comfyPage.settings.setSetting('Comfy.VueNodes.Enabled', true)
|
|
await comfyPage.setup()
|
|
await comfyPage.vueNodes.waitForNodes()
|
|
})
|
|
|
|
test('should allow collapsing node with collapse icon', async ({
|
|
comfyPage
|
|
}) => {
|
|
const vueNode = await comfyPage.vueNodes.getFixtureByTitle('KSampler')
|
|
await expect(vueNode.root).toBeVisible()
|
|
|
|
// Initially should not be collapsed
|
|
const body = vueNode.body
|
|
await expect(body).toBeVisible()
|
|
const expandedBoundingBox = await vueNode.boundingBox()
|
|
if (!expandedBoundingBox)
|
|
throw new Error('Failed to get node bounding box before collapse')
|
|
|
|
// Collapse the node
|
|
await vueNode.toggleCollapse()
|
|
await comfyPage.nextFrame()
|
|
|
|
// Verify node content is hidden
|
|
await expect(body).toBeHidden()
|
|
await expect
|
|
.poll(async () => (await vueNode.boundingBox())?.height)
|
|
.toBeLessThan(expandedBoundingBox.height)
|
|
|
|
// Expand again
|
|
await vueNode.toggleCollapse()
|
|
await comfyPage.nextFrame()
|
|
await expect(body).toBeVisible()
|
|
|
|
// Size should be restored
|
|
await expect
|
|
.poll(async () => (await vueNode.boundingBox())?.height)
|
|
.toBeGreaterThanOrEqual(expandedBoundingBox.height)
|
|
})
|
|
|
|
test('should show collapse/expand icon state', async ({ comfyPage }) => {
|
|
const vueNode = await comfyPage.vueNodes.getFixtureByTitle('KSampler')
|
|
await expect(vueNode.root).toBeVisible()
|
|
|
|
// Check initial expanded state icon
|
|
await expect(vueNode.collapseIcon).not.toHaveClass(/-rotate-90/)
|
|
|
|
// Collapse and check icon
|
|
await vueNode.toggleCollapse()
|
|
await expect(vueNode.collapseIcon).toHaveClass(/-rotate-90/)
|
|
|
|
// Expand and check icon
|
|
await vueNode.toggleCollapse()
|
|
await expect(vueNode.collapseIcon).not.toHaveClass(/-rotate-90/)
|
|
})
|
|
|
|
test('should preserve title when collapsing/expanding', async ({
|
|
comfyPage
|
|
}) => {
|
|
const vueNode = await comfyPage.vueNodes.getFixtureByTitle('KSampler')
|
|
await expect(vueNode.root).toBeVisible()
|
|
|
|
// Set custom title
|
|
await vueNode.setTitle('Test Sampler')
|
|
await expect(vueNode.title).toHaveText('Test Sampler')
|
|
|
|
// Collapse
|
|
await vueNode.toggleCollapse()
|
|
await expect(vueNode.title).toHaveText('Test Sampler')
|
|
|
|
// Expand
|
|
await vueNode.toggleCollapse()
|
|
await expect(vueNode.title).toHaveText('Test Sampler')
|
|
|
|
// Verify title is still displayed
|
|
await expect(vueNode.header).toContainText('Test Sampler')
|
|
})
|
|
})
|