mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
fix: pass parallelIndex to ComfyPage constructor instead of accessing fixture
This commit is contained in:
@@ -8,8 +8,12 @@ import type { FolderStructure } from './ComfyPage'
|
||||
* Uses Firebase auth persistence and cloud API for settings.
|
||||
*/
|
||||
export class CloudComfyPage extends ComfyPage {
|
||||
constructor(page: Page, request: APIRequestContext) {
|
||||
super(page, request)
|
||||
constructor(
|
||||
page: Page,
|
||||
request: APIRequestContext,
|
||||
parallelIndex: number = 0
|
||||
) {
|
||||
super(page, request, parallelIndex)
|
||||
}
|
||||
|
||||
async setupUser(username: string): Promise<string | null> {
|
||||
|
||||
@@ -158,12 +158,13 @@ export abstract class ComfyPage {
|
||||
|
||||
/** Test user ID for the current context */
|
||||
get id() {
|
||||
return this.userIds[comfyPageFixture.info().parallelIndex]
|
||||
return this.userIds[this.parallelIndex]
|
||||
}
|
||||
|
||||
constructor(
|
||||
public readonly page: Page,
|
||||
public readonly request: APIRequestContext
|
||||
public readonly request: APIRequestContext,
|
||||
public readonly parallelIndex: number = 0
|
||||
) {
|
||||
this.url = process.env.PLAYWRIGHT_TEST_URL || 'http://localhost:8188'
|
||||
this.canvas = page.locator('#graph-canvas')
|
||||
|
||||
@@ -8,8 +8,12 @@ import type { FolderStructure } from './ComfyPage'
|
||||
* Uses devtools API and multi-user mode for test isolation.
|
||||
*/
|
||||
export class LocalhostComfyPage extends ComfyPage {
|
||||
constructor(page: Page, request: APIRequestContext) {
|
||||
super(page, request)
|
||||
constructor(
|
||||
page: Page,
|
||||
request: APIRequestContext,
|
||||
parallelIndex: number = 0
|
||||
) {
|
||||
super(page, request, parallelIndex)
|
||||
}
|
||||
|
||||
async setupWorkflowsDirectory(structure: FolderStructure): Promise<void> {
|
||||
|
||||
@@ -15,9 +15,9 @@ export const comfyPageFixture = base.extend<{
|
||||
comfyMouse: ComfyMouse
|
||||
}>({
|
||||
comfyPage: async ({ page, request }, use, testInfo) => {
|
||||
const comfyPage = new LocalhostComfyPage(page, request)
|
||||
|
||||
const { parallelIndex } = testInfo
|
||||
const comfyPage = new LocalhostComfyPage(page, request, parallelIndex)
|
||||
|
||||
const username = `playwright-test-${parallelIndex}`
|
||||
const userId = await comfyPage.setupUser(username)
|
||||
if (userId) {
|
||||
|
||||
Reference in New Issue
Block a user