Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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
67 changes: 55 additions & 12 deletions browser_tests/tests/dialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,21 +308,64 @@ test.describe('Settings', () => {
})

test.describe('Support', () => {
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.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
})
})
})

await newPage.waitForLoadState('networkidle')
await expect(newPage).toHaveURL(/.*support\.comfy\.org.*/)
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

const url = new URL(newPage.url())
expect(url.searchParams.get('tf_42243568391700')).toBe('oss')
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')

await newPage.close()
})
})

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()
})
})
Comment thread
Myestery marked this conversation as resolved.
Outdated
})

Expand Down
31 changes: 29 additions & 2 deletions browser_tests/tests/mobileBaseline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,40 @@ test.describe('Mobile Baseline Snapshots', () => {
expect(await comfyPage.getGraphNodesCount()).toBe(0)
}).toPass({ timeout: 256 })
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot('mobile-empty-canvas.png')

// 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
})
})

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
Comment thread
Myestery marked this conversation as resolved.
Outdated

await expect(comfyPage.canvas).toHaveScreenshot(
'mobile-default-workflow.png'
'mobile-default-workflow.png',
{ clip: clipRegion }
)
})

Expand Down
15 changes: 14 additions & 1 deletion browser_tests/tests/vueNodes/interactions/canvas/pan.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,21 @@ 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
Comment thread
Myestery marked this conversation as resolved.
Outdated

await expect(comfyPage.canvas).toHaveScreenshot(
'vue-nodes-paned-with-touch.png'
'vue-nodes-paned-with-touch.png',
{ clip: clipRegion }
)
})
})
21 changes: 15 additions & 6 deletions browser_tests/tests/vueNodes/interactions/node/move.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {
type ComfyPage,
comfyExpect as expect,
comfyPageFixture as test
} 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', () => {
Expand Down Expand Up @@ -60,8 +57,20 @@ 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'
'vue-node-moved-node-touch.png',
{ clip: clipRegion }
)
})
})
Loading