[BrowserTest] Replace ComfyPage.reload with ComfyPage.setup (#2208)

This commit is contained in:
Chenlei Hu
2025-01-09 12:54:05 -05:00
committed by GitHub
parent 93e184e379
commit e8cd9c7642
4 changed files with 5 additions and 10 deletions

View File

@@ -150,7 +150,7 @@ test.describe('Color Palette', () => {
await comfyPage.setSetting('Comfy.CustomColorPalettes', customColorPalettes) await comfyPage.setSetting('Comfy.CustomColorPalettes', customColorPalettes)
// Reload to apply the new setting. Setting Comfy.CustomColorPalettes directly // Reload to apply the new setting. Setting Comfy.CustomColorPalettes directly
// doesn't update the store immediately. // doesn't update the store immediately.
await comfyPage.reload() await comfyPage.setup()
await comfyPage.setSetting('Comfy.ColorPalette', 'obsidian_dark') await comfyPage.setSetting('Comfy.ColorPalette', 'obsidian_dark')
await expect(comfyPage.canvas).toHaveScreenshot( await expect(comfyPage.canvas).toHaveScreenshot(

View File

@@ -369,11 +369,6 @@ export class ComfyPage {
}, settingId) }, settingId)
} }
async reload({ clearStorage = true }: { clearStorage?: boolean } = {}) {
await this.page.reload({ timeout: 15000 })
await this.setup({ clearStorage })
}
async goto() { async goto() {
await this.page.goto(this.url) await this.page.goto(this.url)
} }

View File

@@ -593,7 +593,7 @@ test.describe('Load workflow', () => {
}) => { }) => {
await comfyPage.loadWorkflow('single_ksampler') await comfyPage.loadWorkflow('single_ksampler')
await expect(comfyPage.canvas).toHaveScreenshot('single_ksampler.png') await expect(comfyPage.canvas).toHaveScreenshot('single_ksampler.png')
await comfyPage.reload({ clearStorage: false }) await comfyPage.setup({ clearStorage: false })
await expect(comfyPage.canvas).toHaveScreenshot('single_ksampler.png') await expect(comfyPage.canvas).toHaveScreenshot('single_ksampler.png')
}) })
@@ -610,7 +610,7 @@ test.describe('Load workflow', () => {
await expect(comfyPage.canvas).toHaveScreenshot( await expect(comfyPage.canvas).toHaveScreenshot(
'single_ksampler_modified.png' 'single_ksampler_modified.png'
) )
await comfyPage.reload({ clearStorage: false }) await comfyPage.setup({ clearStorage: false })
await expect(comfyPage.canvas).toHaveScreenshot( await expect(comfyPage.canvas).toHaveScreenshot(
'single_ksampler_modified.png' 'single_ksampler_modified.png'
) )

View File

@@ -21,7 +21,7 @@ test.describe('Menu', () => {
expect(await comfyPage.menu.getThemeId()).toBe('light') expect(await comfyPage.menu.getThemeId()).toBe('light')
// Theme id should persist after reload. // Theme id should persist after reload.
await comfyPage.reload() await comfyPage.setup()
expect(await comfyPage.menu.getThemeId()).toBe('light') expect(await comfyPage.menu.getThemeId()).toBe('light')
await comfyPage.menu.toggleTheme() await comfyPage.menu.toggleTheme()
@@ -569,7 +569,7 @@ test.describe('Menu', () => {
}) })
await comfyPage.setSetting('Comfy.Locale', 'zh') await comfyPage.setSetting('Comfy.Locale', 'zh')
await comfyPage.reload() await comfyPage.setup()
const downloadedContentZh = await comfyPage.getExportedWorkflow({ const downloadedContentZh = await comfyPage.getExportedWorkflow({
api: false api: false