Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions e2e/apps-local.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import path from 'node:path'
import { expect, test } from '@playwright/test'
import { launchApp, type AppContext } from './launchApp'
import { waitForWebContents, WebContentsPage } from './support/cdpPages'
import { pacedForVideo } from './support/videoRecording'
import { getRunningSessionSnapshot } from './support/devHooks'
import {
FAKE_COMFY_API_SERVER,
Expand Down Expand Up @@ -217,7 +218,7 @@ test.afterAll(async () => {
else process.env['COMFY_APPS_URL'] = inheritedAppsUrl
})

test('An app page is offered the build on this computer, stopped, by name and version @linux', async () => {
test('An app page is offered the build on this computer, stopped, by name and version @linux @macos', async () => {
await ctx.panel.waitForVisible(SIDEBAR_APPS)
expect(await ctx.panel.click(SIDEBAR_APPS)).toBe(true)
await ctx.panel.waitForVisible(CUTOUT_CARD)
Expand All @@ -230,7 +231,7 @@ test('An app page is offered the build on this computer, stopped, by name and ve
expect(await getRunningSessionSnapshot(ctx.app, BUILD_ID)).toBeNull()
})

test('Starting from the page runs that build with no ComfyUI window @linux', async () => {
test('Starting from the page runs that build with no ComfyUI window @linux @macos', async () => {
const windowsBefore = await windowCount()

expect(await appPage().click('#start')).toBe(true)
Expand All @@ -242,7 +243,7 @@ test('Starting from the page runs that build with no ComfyUI window @linux', asy
expect(await windowCount(), 'no window was opened for ComfyUI').toBe(windowsBefore)
})

test('A run goes from a picture to its result, with updates on the way, through Desktop only @linux', async () => {
test('A run goes from a picture to its result, with updates on the way, through Desktop only @linux @macos', async () => {
expect(await appPage().click('#run')).toBe(true)

await expect.poll(() => appPage().textOf('#result'), LONG_WAIT).toContain('"result"')
Expand All @@ -265,7 +266,7 @@ test('A run goes from a picture to its result, with updates on the way, through
])
})

test('The page cannot reach anything that is not its own run @linux', async () => {
test('The page cannot reach anything that is not its own run @linux @macos', async () => {
expect(await appPage().click('#pry')).toBe(true)

await expect.poll(() => appPage().textOf('#pried'), LONG_WAIT).toBe('403,403,403,403,403')
Expand All @@ -279,7 +280,7 @@ test('The page cannot reach anything that is not its own run @linux', async () =
expect(seen.interrupted).toEqual([])
})

test('Opening the build an app started shows ComfyUI in its own window @linux', async () => {
test('Opening the build an app started shows ComfyUI in its own window @linux @macos', async () => {
const windowsBefore = await windowCount()

expect(
Expand All @@ -289,4 +290,9 @@ test('Opening the build an app started shows ComfyUI in its own window @linux',
await expect.poll(() => windowCount(), LONG_WAIT).toBe(windowsBefore + 1)
const port = (await getRunningSessionSnapshot(ctx.app, BUILD_ID))?.port
await waitForWebContents(ctx.app, `127.0.0.1:${port}`)
const comfyPage = new WebContentsPage(ctx.app, `127.0.0.1:${port}`)
await comfyPage.waitFor(() =>
comfyPage.evaluate<boolean>(`document.body?.innerText.includes('ComfyUI stub') ?? false`)
)
expect(await pacedForVideo(() => comfyPage.isVisible('body'))).toBe(true)
})
13 changes: 9 additions & 4 deletions e2e/assets-startup-failure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { reserveFreePort, writeFakeComfyInstall } from './support/fakeComfyInsta
const INSTALL_ID = 'inst-assets-startup-failure'
const INSTALL_NAME = 'Assets Startup Failure Install'
const DISABLE_HINT = 'Or start ComfyUI without the assets system: --disable-assets'
const NEW_ERROR_BADGE = '.chooser-tile-error-badge:not([data-earlier-failure])'

let rootDir = ''
let installPath = ''
Expand All @@ -29,10 +30,14 @@ function coreRefusal(kind: string, ...message: string[]): string {

async function launchAndReadError(stderr: string): Promise<string | null> {
await writeFile(path.join(installPath, 'startup-failure'), stderr)
await ctx!.panel.evaluate<boolean>(`(() => {
document.querySelector('.chooser-tile-error-badge')?.setAttribute('data-earlier-failure', '')
return true
})()`)
await clickInstallTile(ctx!.panel, INSTALL_NAME)
await expect.poll(() => hasActiveLaunch(ctx!.app, INSTALL_ID), { timeout: 60_000 }).toBe(false)
await ctx!.panel.waitForVisible('.chooser-tile-error-badge', { timeout: 30_000 })
expect(await ctx!.panel.click('.chooser-tile-error-badge')).toBe(true)
await ctx!.panel.waitForVisible(NEW_ERROR_BADGE, { timeout: 30_000 })
expect(await ctx!.panel.click(NEW_ERROR_BADGE)).toBe(true)
await ctx!.panel.waitForVisible('[data-testid="build-progress-step-detail"]', {
timeout: 10_000
})
Expand Down Expand Up @@ -83,7 +88,7 @@ test.afterAll(async () => {
if (rootDir) await rm(rootDir, { recursive: true, force: true })
})

test("shows the core's message for an asset database it cannot open @linux", async () => {
test("shows the core's message for an asset database it cannot open @linux @macos", async () => {
const what = "The asset database '/x/user/comfyui.db' is corrupt (file is not a database)."
const fix = 'Move that file aside, or delete it, and start again.'

Expand All @@ -92,7 +97,7 @@ test("shows the core's message for an asset database it cannot open @linux", asy
expect(text).toBe(`${what}\n${fix}\n${DISABLE_HINT}`)
})

test('shows the lock message when another ComfyUI holds the database, without --enable-assets @linux', async () => {
test('shows the lock message when another ComfyUI holds the database, without --enable-assets @linux @macos', async () => {
const text = await launchAndReadError(
coreRefusal(
'in_use',
Expand Down
2 changes: 1 addition & 1 deletion e2e/beta-activation-notice-firstrun.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ test.afterAll(async () => {
else process.env['POSTHOG_HOST'] = previousPosthogHost
})

test('first run: the hint takes the popup, and dismissing it releases the beta card @linux', async () => {
test('first run: the hint takes the popup, and dismissing it releases the beta card @linux @macos', async () => {
await clickInstallTile(ctx.panel, INSTALL_NAME)
await ctx.panel.waitFor(
async () =>
Expand Down
2 changes: 1 addition & 1 deletion e2e/beta-activation-notice-lockdown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ test.afterAll(async () => {
else process.env['POSTHOG_HOST'] = previousPosthogHost
})

test('first-use lockdown never costs the user the beta notice @linux', async () => {
test('first-use lockdown never costs the user the beta notice @linux @macos', async () => {
const popup = coachmarkPopup(ctx.app)

await ctx.panel.evaluate(`window.api.setFirstUseMode('post-consent')`)
Expand Down
2 changes: 1 addition & 1 deletion e2e/beta-activation-notice-named.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ test.afterAll(async () => {
else process.env['POSTHOG_HOST'] = previousPosthogHost
})

test('a payload-supplied feature name reaches the card @linux', async () => {
test('a payload-supplied feature name reaches the card @linux @macos', async () => {
await clickInstallTile(ctx.panel, INSTALL_NAME)

await ctx.panel.waitFor(
Expand Down
10 changes: 5 additions & 5 deletions e2e/beta-activation-notice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ test.afterAll(async () => {
else process.env['POSTHOG_HOST'] = previousPosthogHost
})

test('a first beta activation raises a nonblocking notice over live ComfyUI @linux', async () => {
test('a first beta activation raises a nonblocking notice over live ComfyUI @linux @macos', async () => {
await clickInstallTile(ctx.panel, INSTALL_NAME)

await ctx.panel.waitFor(
Expand Down Expand Up @@ -119,7 +119,7 @@ test('a first beta activation raises a nonblocking notice over live ComfyUI @lin
test.info().attach('notice over ComfyUI', { path: shot, contentType: 'image/png' })
})

test('the card is anchored on the bell it points at @linux', async () => {
test('the card is anchored on the bell it points at @linux @macos', async () => {
const bellCentre = await ctx.titleBar.evaluate<number>(`(() => {
const el = document.querySelector('.title-announcement-button')
if (!el) return -1
Expand Down Expand Up @@ -216,7 +216,7 @@ test('the card is anchored on the bell it points at @linux', async () => {
}
})

test('the notice does not block the canvas underneath it @linux', async () => {
test('the notice does not block the canvas underneath it @linux @macos', async () => {
const bounds = await ctx.app.evaluate(({ BrowserWindow, WebContentsView }) => {
const win = BrowserWindow.getAllWindows().find((w) => !w.isDestroyed() && w.isVisible())
if (!win) throw new Error('no visible window')
Expand All @@ -235,7 +235,7 @@ test('the notice does not block the canvas underneath it @linux', async () => {
expect(bounds!.card.width).toBeLessThan(bounds!.window.width / 2)
})

test('the settings link lands on the beta opt-in row and retires the card @linux', async () => {
test('the settings link lands on the beta opt-in row and retires the card @linux @macos', async () => {
const popup = coachmarkPopup(ctx.app)
expect(await popup.click('.coachmark-action')).toBe(true)

Expand Down Expand Up @@ -265,7 +265,7 @@ test('the settings link lands on the beta opt-in row and retires the card @linux
test.info().attach('settings opt-out highlighted', { path: shot, contentType: 'image/png' })
})

test('the notice is spent: a second launch stays silent @linux', async () => {
test('the notice is spent: a second launch stays silent @linux @macos', async () => {
const stillPending = await ctx.titleBar.evaluate<unknown>(
`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`
)
Expand Down
6 changes: 3 additions & 3 deletions e2e/core-beta-args-pill-commit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ async function expectAnsweredWithNoPill(popup: WebContentsPage, message: string)
}
}

test('a commit grant whose range contains HEAD shows before any launch @linux', async () => {
test('a commit grant whose range contains HEAD shows before any launch @linux @macos', async () => {
const popup = await openStartupArgs()
await popup.waitForVisible(PILL, { timeout: 15_000 })
expect(await pillLabel(popup)).toBe('1 beta argument eligible for the next launch, show details')
})

test('moving HEAD below the range hides it @linux', async () => {
test('moving HEAD below the range hides it @linux @macos', async () => {
git('reset', '-q', '--hard', sha.base!)
const popup = await openCounted()
await expectAnsweredWithNoPill(popup, 'the grant was still shown with HEAD below its range')
Expand All @@ -180,7 +180,7 @@ test('moving HEAD below the range hides it @linux', async () => {
await back.waitForVisible(PILL, { timeout: 15_000 })
})

test('an object store git cannot read hides the grant, and the settings view still loads @linux', async () => {
test('an object store git cannot read hides the grant, and the settings view still loads @linux @macos', async () => {
sha.next = commit('next')
const objects = path.join(repo, '.git', 'objects')
for (const entry of await readdir(objects)) {
Expand Down
2 changes: 1 addition & 1 deletion e2e/core-beta-args-pill-restart.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const pillLabel = (popup: WebContentsPage): Promise<string | null> =>
`document.querySelector(${JSON.stringify(PILL)})?.getAttribute('aria-label') ?? null`
)

test('the pill follows the new session after a Restart that drops a grant @linux', async () => {
test('the pill follows the new session after a Restart that drops a grant @linux @macos', async () => {
await clickInstallTile(ctx.panel, INSTALL_NAME)
let before: Awaited<ReturnType<typeof getRunningSessionSnapshot>> = null
await expect
Expand Down
10 changes: 5 additions & 5 deletions e2e/core-beta-args-pill-stopped.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function expectNoPill(popup: WebContentsPage): Promise<void> {
expect(await pillAriaLabel(popup)).toBeNull()
}

test('shows the grants the next launch is eligible for @linux', async () => {
test('shows the grants the next launch is eligible for @linux @macos', async () => {
const popup = await openStartupArgs()
await popup.waitForVisible(PILL, { timeout: 15_000 })
expect(await pillAriaLabel(popup)).toBe(
Expand All @@ -120,7 +120,7 @@ test('shows the grants the next launch is eligible for @linux', async () => {
expect(text).toContain('Asset hashing')
})

test('turning the beta opt-in off removes the pill on the next open, and on restores it @linux', async () => {
test('turning the beta opt-in off removes the pill on the next open, and on restores it @linux @macos', async () => {
let popup = await openStartupArgs()
await popup.waitForVisible(PILL, { timeout: 10_000 })
await popup.clickUntilVisible(PILL, MANAGE, { timeout: 10_000 })
Expand Down Expand Up @@ -152,7 +152,7 @@ test('turning the beta opt-in off removes the pill on the next open, and on rest
await popup.waitForVisible(PILL, { timeout: 10_000 })
})

test('an opt-in change made while the picker is hidden shows on reopen @linux', async () => {
test('an opt-in change made while the picker is hidden shows on reopen @linux @macos', async () => {
let popup = await openStartupArgs()
await popup.waitForVisible(PILL, { timeout: 10_000 })
await closeTitlePopupIfOpen(ctx.app)
Expand Down Expand Up @@ -184,7 +184,7 @@ async function commitArgs(popup: WebContentsPage, value: string): Promise<void>
)
}

test("only the pill asks: another field's save asks nothing, an args commit asks once @linux", async () => {
test("only the pill asks: another field's save asks nothing, an args commit asks once @linux @macos", async () => {
const popup = await openStartupArgs()
await popup.waitForVisible(PILL, { timeout: 10_000 })
await resetIpcInvocations(ctx.app, 'get-core-beta-args')
Expand All @@ -207,7 +207,7 @@ test("only the pill asks: another field's save asks nothing, an args commit asks
expect(await betaArgsRequests()).toBe(1)
})

test("adding the grant's opposite to the startup args removes it @linux", async () => {
test("adding the grant's opposite to the startup args removes it @linux @macos", async () => {
const popup = await openStartupArgs()
await popup.waitForVisible(PILL, { timeout: 10_000 })
await popup.evaluate(
Expand Down
2 changes: 1 addition & 1 deletion e2e/launch-own-window.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function windowState(): Promise<WindowState> {
)
}

test('Start on a Home card opens ComfyUI in its own window and the dashboard stays on Home @linux', async () => {
test('Start on a Home card opens ComfyUI in its own window and the dashboard stays on Home @linux @macos', async () => {
await ctx.panel.waitForVisible(CARD, { timeout: 15_000 })
expect(await ctx.panel.click(CARD)).toBe(true)

Expand Down
6 changes: 3 additions & 3 deletions e2e/performance-test-guardrail.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ test.afterAll(async () => {
for (const dir of Object.values(installPaths)) await rm(dir, { recursive: true, force: true })
})

test('a Performance Test is refused while another installation runs, and named @linux', async () => {
test('a Performance Test is refused while another installation runs, and named @linux @macos', async () => {
const other = await launch(OTHER_ID, OTHER_ID)
expect(other, other.message).toMatchObject({ ok: true })

Expand All @@ -115,7 +115,7 @@ test('a Performance Test is refused while another installation runs, and named @
expect(await getRunningSessionSnapshot(ctx!.app, OTHER_ID)).not.toBeNull()
})

test('once that is stopped, the Performance Test boots on its installation, on its own port @linux', async () => {
test('once that is stopped, the Performance Test boots on its installation, on its own port @linux @macos', async () => {
await stop(OTHER_ID)

const perf = await launch(BENCH_ID, PERF_SESSION)
Expand All @@ -130,7 +130,7 @@ test('once that is stopped, the Performance Test boots on its installation, on i
})
})

test('another installation still launches while a Performance Test runs @linux', async () => {
test('another installation still launches while a Performance Test runs @linux @macos', async () => {
const other = await launch(OTHER_ID, OTHER_ID)

expect(other, other.message).toMatchObject({ ok: true })
Expand Down
4 changes: 2 additions & 2 deletions e2e/support/fakeComfyInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ export async function writeFakeComfyInstall(opts: {
const serverPath = path.join(installPath, 'stub-server.cjs')
await writeFile(serverPath, serverScript)

if (process.platform !== 'linux') {
if (process.platform === 'win32') {
throw new Error(
'writeFakeComfyInstall is Linux-only (see the file header); tag the spec @linux.'
'writeFakeComfyInstall needs a shell script for python3, which Windows cannot run as python.exe; tag the spec @linux or @macos.'
)
}

Expand Down
2 changes: 1 addition & 1 deletion e2e/whats-new-over-canvas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async function panelViewVisible(): Promise<boolean> {
})
}

test("What's New shows over the live canvas and closing brings the canvas back @linux", async () => {
test("What's New shows over the live canvas and closing brings the canvas back @linux @macos", async () => {
await clickInstallTile(ctx.panel, INSTALL_NAME)
await ctx.panel.waitFor(
async () =>
Expand Down
7 changes: 6 additions & 1 deletion src/main/apps/__fixtures__/fakeComfyApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ const server = http.createServer((req, res) => {
if (url.pathname.startsWith('/object_info/')) return json(res, {})
if (url.pathname === '/system_stats') return json(res, { system: { comfyui_version: '0.42.1' } })
res.writeHead(200, { 'content-type': 'text/html; charset=utf-8' })
res.end('<!doctype html><title>ComfyUI (e2e stub)</title><p>ComfyUI stub</p>')
res.end(
'<!doctype html><title>ComfyUI (e2e stub)</title>' +
'<body style="margin:0;height:100vh;display:flex;align-items:center;justify-content:center;' +
'background:#16121a;color:#e3ff3c;font:32px system-ui,sans-serif">' +
'<p>ComfyUI stub, started by the app page</p></body>'
)
})

server.on('upgrade', (req, socket) => {
Expand Down
Loading