From fa4ab02349ee34732ee009fef4770323ed094f07 Mon Sep 17 00:00:00 2001 From: huchenlei Date: Thu, 9 Jan 2025 11:45:52 -0500 Subject: [PATCH] [BrowserTest] Replace ComfyPage.reload with ComfyPage.setup --- browser_tests/colorPalette.spec.ts | 2 +- browser_tests/fixtures/ComfyPage.ts | 5 ----- browser_tests/interaction.spec.ts | 4 ++-- browser_tests/menu.spec.ts | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/browser_tests/colorPalette.spec.ts b/browser_tests/colorPalette.spec.ts index d827e22d0..14a5c0a9c 100644 --- a/browser_tests/colorPalette.spec.ts +++ b/browser_tests/colorPalette.spec.ts @@ -150,7 +150,7 @@ test.describe('Color Palette', () => { await comfyPage.setSetting('Comfy.CustomColorPalettes', customColorPalettes) // Reload to apply the new setting. Setting Comfy.CustomColorPalettes directly // doesn't update the store immediately. - await comfyPage.reload() + await comfyPage.setup() await comfyPage.setSetting('Comfy.ColorPalette', 'obsidian_dark') await expect(comfyPage.canvas).toHaveScreenshot( diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index 89128a995..e6544972d 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -369,11 +369,6 @@ export class ComfyPage { }, settingId) } - async reload({ clearStorage = true }: { clearStorage?: boolean } = {}) { - await this.page.reload({ timeout: 15000 }) - await this.setup({ clearStorage }) - } - async goto() { await this.page.goto(this.url) } diff --git a/browser_tests/interaction.spec.ts b/browser_tests/interaction.spec.ts index 4893adcce..df79d9aeb 100644 --- a/browser_tests/interaction.spec.ts +++ b/browser_tests/interaction.spec.ts @@ -593,7 +593,7 @@ test.describe('Load workflow', () => { }) => { await comfyPage.loadWorkflow('single_ksampler') 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') }) @@ -610,7 +610,7 @@ test.describe('Load workflow', () => { await expect(comfyPage.canvas).toHaveScreenshot( 'single_ksampler_modified.png' ) - await comfyPage.reload({ clearStorage: false }) + await comfyPage.setup({ clearStorage: false }) await expect(comfyPage.canvas).toHaveScreenshot( 'single_ksampler_modified.png' ) diff --git a/browser_tests/menu.spec.ts b/browser_tests/menu.spec.ts index b8df2086d..5dedc0d71 100644 --- a/browser_tests/menu.spec.ts +++ b/browser_tests/menu.spec.ts @@ -21,7 +21,7 @@ test.describe('Menu', () => { expect(await comfyPage.menu.getThemeId()).toBe('light') // Theme id should persist after reload. - await comfyPage.reload() + await comfyPage.setup() expect(await comfyPage.menu.getThemeId()).toBe('light') await comfyPage.menu.toggleTheme() @@ -569,7 +569,7 @@ test.describe('Menu', () => { }) await comfyPage.setSetting('Comfy.Locale', 'zh') - await comfyPage.reload() + await comfyPage.setup() const downloadedContentZh = await comfyPage.getExportedWorkflow({ api: false