mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +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>
106 lines
3.1 KiB
TypeScript
106 lines
3.1 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
|
|
import { TestIds } from '@e2e/fixtures/selectors'
|
|
import { openErrorsTabViaSeeErrors } from '@e2e/tests/propertiesPanel/ErrorsTabHelper'
|
|
|
|
test.describe('Errors tab - Missing nodes', { tag: '@ui' }, () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Top')
|
|
await comfyPage.settings.setSetting(
|
|
'Comfy.RightSidePanel.ShowErrorsTab',
|
|
true
|
|
)
|
|
})
|
|
|
|
test('Should show MissingNodeCard in errors tab', async ({ comfyPage }) => {
|
|
await openErrorsTabViaSeeErrors(comfyPage, 'missing/missing_nodes')
|
|
|
|
await expect(
|
|
comfyPage.page.getByTestId(TestIds.dialogs.missingNodeCard)
|
|
).toBeVisible()
|
|
})
|
|
|
|
test('Should show missing node packs group', async ({ comfyPage }) => {
|
|
await openErrorsTabViaSeeErrors(comfyPage, 'missing/missing_nodes')
|
|
|
|
await expect(
|
|
comfyPage.page.getByTestId(TestIds.dialogs.missingNodePacksGroup)
|
|
).toBeVisible()
|
|
})
|
|
|
|
test('Should expand pack group to reveal node type names', async ({
|
|
comfyPage
|
|
}) => {
|
|
await openErrorsTabViaSeeErrors(
|
|
comfyPage,
|
|
'missing/missing_nodes_in_subgraph'
|
|
)
|
|
|
|
const missingNodeCard = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingNodeCard
|
|
)
|
|
await expect(missingNodeCard).toBeVisible()
|
|
|
|
await missingNodeCard
|
|
.getByRole('button', { name: /expand/i })
|
|
.first()
|
|
.click()
|
|
await expect(
|
|
missingNodeCard.getByText('MISSING_NODE_TYPE_IN_SUBGRAPH')
|
|
).toBeVisible()
|
|
})
|
|
|
|
test('Should collapse expanded pack group', async ({ comfyPage }) => {
|
|
await openErrorsTabViaSeeErrors(
|
|
comfyPage,
|
|
'missing/missing_nodes_in_subgraph'
|
|
)
|
|
|
|
const missingNodeCard = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingNodeCard
|
|
)
|
|
await missingNodeCard
|
|
.getByRole('button', { name: /expand/i })
|
|
.first()
|
|
.click()
|
|
await expect(
|
|
missingNodeCard.getByText('MISSING_NODE_TYPE_IN_SUBGRAPH')
|
|
).toBeVisible()
|
|
|
|
await missingNodeCard
|
|
.getByRole('button', { name: /collapse/i })
|
|
.first()
|
|
.click()
|
|
await expect(
|
|
missingNodeCard.getByText('MISSING_NODE_TYPE_IN_SUBGRAPH')
|
|
).toBeHidden()
|
|
})
|
|
|
|
test('Locate node button is visible for expanded pack nodes', async ({
|
|
comfyPage
|
|
}) => {
|
|
await openErrorsTabViaSeeErrors(
|
|
comfyPage,
|
|
'missing/missing_nodes_in_subgraph'
|
|
)
|
|
|
|
const missingNodeCard = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingNodeCard
|
|
)
|
|
await missingNodeCard
|
|
.getByRole('button', { name: /expand/i })
|
|
.first()
|
|
.click()
|
|
|
|
const locateButton = missingNodeCard.getByRole('button', {
|
|
name: /locate/i
|
|
})
|
|
await expect(locateButton.first()).toBeVisible()
|
|
// TODO: Add navigation assertion once subgraph node ID deduplication
|
|
// timing is fixed. Currently, collectMissingNodes runs before
|
|
// configure(), so execution IDs use pre-remapped node IDs that don't
|
|
// match the runtime graph. See PR #9510 / #8762.
|
|
})
|
|
})
|