diff --git a/e2e/apps-local.test.ts b/e2e/apps-local.test.ts index 0fa216c27..2689739de 100644 --- a/e2e/apps-local.test.ts +++ b/e2e/apps-local.test.ts @@ -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, @@ -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) @@ -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) @@ -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"') @@ -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') @@ -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( @@ -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(`document.body?.innerText.includes('ComfyUI stub') ?? false`) + ) + expect(await pacedForVideo(() => comfyPage.isVisible('body'))).toBe(true) }) diff --git a/e2e/assets-startup-failure.test.ts b/e2e/assets-startup-failure.test.ts index 85155b36a..40b24ca15 100644 --- a/e2e/assets-startup-failure.test.ts +++ b/e2e/assets-startup-failure.test.ts @@ -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 = '' @@ -29,10 +30,14 @@ function coreRefusal(kind: string, ...message: string[]): string { async function launchAndReadError(stderr: string): Promise { await writeFile(path.join(installPath, 'startup-failure'), stderr) + await ctx!.panel.evaluate(`(() => { + 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 }) @@ -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.' @@ -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', diff --git a/e2e/beta-activation-notice-firstrun.test.ts b/e2e/beta-activation-notice-firstrun.test.ts index bceb77186..101ac44b8 100644 --- a/e2e/beta-activation-notice-firstrun.test.ts +++ b/e2e/beta-activation-notice-firstrun.test.ts @@ -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 () => diff --git a/e2e/beta-activation-notice-lockdown.test.ts b/e2e/beta-activation-notice-lockdown.test.ts index 6bf328329..a679fd999 100644 --- a/e2e/beta-activation-notice-lockdown.test.ts +++ b/e2e/beta-activation-notice-lockdown.test.ts @@ -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')`) diff --git a/e2e/beta-activation-notice-named.test.ts b/e2e/beta-activation-notice-named.test.ts index 09fcb33ff..8740e227f 100644 --- a/e2e/beta-activation-notice-named.test.ts +++ b/e2e/beta-activation-notice-named.test.ts @@ -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( diff --git a/e2e/beta-activation-notice.test.ts b/e2e/beta-activation-notice.test.ts index a0e24a258..f35557ae2 100644 --- a/e2e/beta-activation-notice.test.ts +++ b/e2e/beta-activation-notice.test.ts @@ -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( @@ -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(`(() => { const el = document.querySelector('.title-announcement-button') if (!el) return -1 @@ -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') @@ -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) @@ -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( `window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})` ) diff --git a/e2e/core-beta-args-pill-commit.test.ts b/e2e/core-beta-args-pill-commit.test.ts index 57a7c527f..cccf039e9 100644 --- a/e2e/core-beta-args-pill-commit.test.ts +++ b/e2e/core-beta-args-pill-commit.test.ts @@ -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') @@ -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)) { diff --git a/e2e/core-beta-args-pill-restart.test.ts b/e2e/core-beta-args-pill-restart.test.ts index 7e2cd839e..838fc97ca 100644 --- a/e2e/core-beta-args-pill-restart.test.ts +++ b/e2e/core-beta-args-pill-restart.test.ts @@ -94,7 +94,7 @@ const pillLabel = (popup: WebContentsPage): Promise => `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> = null await expect diff --git a/e2e/core-beta-args-pill-stopped.test.ts b/e2e/core-beta-args-pill-stopped.test.ts index da68796cf..4b4441222 100644 --- a/e2e/core-beta-args-pill-stopped.test.ts +++ b/e2e/core-beta-args-pill-stopped.test.ts @@ -105,7 +105,7 @@ async function expectNoPill(popup: WebContentsPage): Promise { 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( @@ -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 }) @@ -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) @@ -184,7 +184,7 @@ async function commitArgs(popup: WebContentsPage, value: string): Promise ) } -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') @@ -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( diff --git a/e2e/launch-own-window.test.ts b/e2e/launch-own-window.test.ts index 4729662bb..8ef0831b8 100644 --- a/e2e/launch-own-window.test.ts +++ b/e2e/launch-own-window.test.ts @@ -100,7 +100,7 @@ function windowState(): Promise { ) } -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) diff --git a/e2e/performance-test-guardrail.test.ts b/e2e/performance-test-guardrail.test.ts index 702808a3c..c45e281e9 100644 --- a/e2e/performance-test-guardrail.test.ts +++ b/e2e/performance-test-guardrail.test.ts @@ -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 }) @@ -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) @@ -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 }) diff --git a/e2e/support/fakeComfyInstall.ts b/e2e/support/fakeComfyInstall.ts index ad786085d..6e12d7a09 100644 --- a/e2e/support/fakeComfyInstall.ts +++ b/e2e/support/fakeComfyInstall.ts @@ -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.' ) } diff --git a/e2e/whats-new-over-canvas.test.ts b/e2e/whats-new-over-canvas.test.ts index 09006efa6..f73e62345 100644 --- a/e2e/whats-new-over-canvas.test.ts +++ b/e2e/whats-new-over-canvas.test.ts @@ -58,7 +58,7 @@ async function panelViewVisible(): Promise { }) } -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 () => diff --git a/src/main/apps/__fixtures__/fakeComfyApi.ts b/src/main/apps/__fixtures__/fakeComfyApi.ts index 78b6bfe00..d4ecfa876 100644 --- a/src/main/apps/__fixtures__/fakeComfyApi.ts +++ b/src/main/apps/__fixtures__/fakeComfyApi.ts @@ -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('ComfyUI (e2e stub)

ComfyUI stub

') + res.end( + 'ComfyUI (e2e stub)' + + '' + + '

ComfyUI stub, started by the app page

' + ) }) server.on('upgrade', (req, socket) => {