mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +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>
62 lines
2.0 KiB
TypeScript
62 lines
2.0 KiB
TypeScript
import {
|
|
comfyPageFixture as test,
|
|
comfyExpect as expect
|
|
} from '@e2e/fixtures/ComfyPage'
|
|
|
|
test.describe('App mode welcome states', { tag: '@ui' }, () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.appMode.enableLinearMode()
|
|
})
|
|
|
|
test('Empty workflow text is visible when no nodes', async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.nodeOps.clearGraph()
|
|
await comfyPage.appMode.toggleAppMode()
|
|
|
|
await expect(comfyPage.appMode.welcome).toBeVisible()
|
|
await expect(comfyPage.appMode.emptyWorkflowText).toBeVisible()
|
|
await expect(comfyPage.appMode.buildAppButton).toBeHidden()
|
|
})
|
|
|
|
test('Build app button is visible when no outputs selected', async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.appMode.toggleAppMode()
|
|
|
|
await expect(comfyPage.appMode.welcome).toBeVisible()
|
|
await expect(comfyPage.appMode.buildAppButton).toBeVisible()
|
|
await expect(comfyPage.appMode.emptyWorkflowText).toBeHidden()
|
|
})
|
|
|
|
test('Empty workflow and build app are hidden when app has outputs', async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.appMode.enterAppModeWithInputs([['3', 'seed']])
|
|
|
|
await expect(comfyPage.appMode.linearWidgets).toBeVisible()
|
|
await expect(comfyPage.appMode.emptyWorkflowText).toBeHidden()
|
|
await expect(comfyPage.appMode.buildAppButton).toBeHidden()
|
|
})
|
|
|
|
test('Back to workflow returns to graph mode', async ({ comfyPage }) => {
|
|
await comfyPage.appMode.toggleAppMode()
|
|
|
|
await expect(comfyPage.appMode.welcome).toBeVisible()
|
|
await comfyPage.appMode.backToWorkflowButton.click()
|
|
|
|
await expect(comfyPage.canvas).toBeVisible()
|
|
await expect(comfyPage.appMode.welcome).toBeHidden()
|
|
})
|
|
|
|
test('Load template opens template selector', async ({ comfyPage }) => {
|
|
await comfyPage.nodeOps.clearGraph()
|
|
await comfyPage.appMode.toggleAppMode()
|
|
|
|
await expect(comfyPage.appMode.welcome).toBeVisible()
|
|
await comfyPage.appMode.loadTemplateButton.click()
|
|
|
|
await expect(comfyPage.templates.content).toBeVisible()
|
|
})
|
|
})
|