test: configure Playwright tests to always run as nightly builds

- Set IS_NIGHTLY=true for all Playwright test runs
- Update CI workflows to pass IS_NIGHTLY=true to test commands
- Update package.json test:browser scripts to include IS_NIGHTLY=true
- Update dialog test to expect 'oss-nightly' instead of 'oss'
- Also update playwright expectations workflow to use IS_NIGHTLY=true

This ensures consistent test behavior regardless of where tests run,
since Playwright tests now always run with IS_NIGHTLY=true.
This commit is contained in:
Johnpaul
2026-01-27 23:24:59 +01:00
parent 0ac13a6f8d
commit 664be8fc19
7 changed files with 24 additions and 118 deletions

View File

@@ -70,6 +70,7 @@ jobs:
run: pnpm exec playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
env:
PLAYWRIGHT_BLOB_OUTPUT_DIR: ./blob-report
IS_NIGHTLY: 'true'
- name: Upload blob report
uses: actions/upload-artifact@v4
@@ -117,6 +118,7 @@ jobs:
run: pnpm exec playwright test --project=${{ matrix.browser }} --reporter=blob
env:
PLAYWRIGHT_BLOB_OUTPUT_DIR: ./blob-report
IS_NIGHTLY: 'true'
- name: Generate HTML and JSON reports
if: always()

View File

@@ -110,6 +110,8 @@ jobs:
- name: Update snapshots (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
id: playwright-tests
run: pnpm exec playwright test --update-snapshots --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
env:
IS_NIGHTLY: 'true'
continue-on-error: true
- name: Stage changed snapshot files

View File

@@ -308,64 +308,21 @@ test.describe('Settings', () => {
})
test.describe('Support', () => {
test.describe('with nightly build', () => {
test.beforeEach(async ({ page }) => {
// Mock __IS_NIGHTLY__ to true before page loads
await page.addInitScript(() => {
Object.defineProperty(window, '__IS_NIGHTLY__', {
value: true,
writable: false,
configurable: true
})
})
})
test('Should open external zendesk link with OSS tag', async ({
comfyPage
}) => {
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
const pagePromise = comfyPage.page.context().waitForEvent('page')
await comfyPage.menu.topbar.triggerTopbarCommand(['Help', 'Support'])
const newPage = await pagePromise
test('Should open external zendesk link with oss-nightly tag', async ({
comfyPage
}) => {
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
const pagePromise = comfyPage.page.context().waitForEvent('page')
await comfyPage.menu.topbar.triggerTopbarCommand(['Help', 'Support'])
const newPage = await pagePromise
await newPage.waitForLoadState('networkidle')
await expect(newPage).toHaveURL(/.*support\.comfy\.org.*/)
await newPage.waitForLoadState('networkidle')
await expect(newPage).toHaveURL(/.*support\.comfy\.org.*/)
const url = new URL(newPage.url())
expect(url.searchParams.get('tf_42243568391700')).toBe('oss-nightly')
const url = new URL(newPage.url())
expect(url.searchParams.get('tf_42243568391700')).toBe('oss-nightly')
await newPage.close()
})
})
test.describe('with stable build', () => {
test.beforeEach(async ({ page }) => {
// Mock __IS_NIGHTLY__ to false before page loads
await page.addInitScript(() => {
Object.defineProperty(window, '__IS_NIGHTLY__', {
value: false,
writable: false,
configurable: true
})
})
})
test('Should open external zendesk link with oss tag', async ({
comfyPage
}) => {
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
const pagePromise = comfyPage.page.context().waitForEvent('page')
await comfyPage.menu.topbar.triggerTopbarCommand(['Help', 'Support'])
const newPage = await pagePromise
await newPage.waitForLoadState('networkidle')
await expect(newPage).toHaveURL(/.*support\.comfy\.org.*/)
const url = new URL(newPage.url())
expect(url.searchParams.get('tf_42243568391700')).toBe('oss')
await newPage.close()
})
await newPage.close()
})
})

View File

@@ -9,40 +9,13 @@ test.describe('Mobile Baseline Snapshots', () => {
expect(await comfyPage.getGraphNodesCount()).toBe(0)
}).toPass({ timeout: 256 })
await comfyPage.nextFrame()
// Get viewport size and clip top 15%
const viewportSize = comfyPage.page.viewportSize()
const clipRegion = viewportSize
? {
x: 0,
y: Math.floor(viewportSize.height * 0.15),
width: viewportSize.width,
height: Math.ceil(viewportSize.height * 0.85)
}
: undefined
await expect(comfyPage.canvas).toHaveScreenshot('mobile-empty-canvas.png', {
clip: clipRegion
})
await expect(comfyPage.canvas).toHaveScreenshot('mobile-empty-canvas.png')
})
test('@mobile default workflow', async ({ comfyPage }) => {
await comfyPage.loadWorkflow('default')
// Get viewport size and clip top 15%
const viewportSize = comfyPage.page.viewportSize()
const clipRegion = viewportSize
? {
x: 0,
y: Math.floor(viewportSize.height * 0.15),
width: viewportSize.width,
height: Math.ceil(viewportSize.height * 0.85)
}
: undefined
await expect(comfyPage.canvas).toHaveScreenshot(
'mobile-default-workflow.png',
{ clip: clipRegion }
'mobile-default-workflow.png'
)
})

View File

@@ -11,21 +11,8 @@ test.describe('Vue Nodes Canvas Pan', () => {
test('@mobile Can pan with touch', async ({ comfyPage }) => {
await comfyPage.panWithTouch({ x: 64, y: 64 }, { x: 256, y: 256 })
// Get viewport size and clip top 15%
const viewportSize = comfyPage.page.viewportSize()
const clipRegion = viewportSize
? {
x: 0,
y: Math.floor(viewportSize.height * 0.15),
width: viewportSize.width,
height: Math.ceil(viewportSize.height * 0.85)
}
: undefined
await expect(comfyPage.canvas).toHaveScreenshot(
'vue-nodes-paned-with-touch.png',
{ clip: clipRegion }
'vue-nodes-paned-with-touch.png'
)
})
})

View File

@@ -1,8 +1,5 @@
import {
comfyExpect as expect,
comfyPageFixture as test
} from '../../../../fixtures/ComfyPage'
import type { ComfyPage } from '../../../../fixtures/ComfyPage'
import { comfyExpect as expect, comfyPageFixture as test } from '../../../../fixtures/ComfyPage';
import type { ComfyPage } from '../../../../fixtures/ComfyPage';
import type { Position } from '../../../../fixtures/types'
test.describe('Vue Node Moving', () => {
@@ -60,20 +57,8 @@ test.describe('Vue Node Moving', () => {
const newHeaderPos = await getLoadCheckpointHeaderPos(comfyPage)
await expectPosChanged(loadCheckpointHeaderPos, newHeaderPos)
// Get viewport size and clip top 15%
const viewportSize = comfyPage.page.viewportSize()
const clipRegion = viewportSize
? {
x: 0,
y: Math.floor(viewportSize.height * 0.15),
width: viewportSize.width,
height: Math.ceil(viewportSize.height * 0.85)
}
: undefined
await expect(comfyPage.canvas).toHaveScreenshot(
'vue-node-moved-node-touch.png',
{ clip: clipRegion }
'vue-node-moved-node-touch.png'
)
})
})

View File

@@ -43,8 +43,8 @@
"storybook:desktop": "nx run @comfyorg/desktop-ui:storybook",
"stylelint:fix": "stylelint --cache --fix '{apps,packages,src}/**/*.{css,vue}'",
"stylelint": "stylelint --cache '{apps,packages,src}/**/*.{css,vue}'",
"test:browser": "pnpm exec nx e2e",
"test:browser:local": "cross-env PLAYWRIGHT_LOCAL=1 pnpm test:browser",
"test:browser": "cross-env IS_NIGHTLY=true pnpm exec nx e2e",
"test:browser:local": "cross-env PLAYWRIGHT_LOCAL=1 IS_NIGHTLY=true pnpm test:browser",
"test:unit": "nx run test",
"typecheck": "vue-tsc --noEmit",
"typecheck:desktop": "nx run @comfyorg/desktop-ui:typecheck",