Skip to content

Commit

Permalink
[BrowserTest] Replace ComfyPage.reload with ComfyPage.setup (#2208)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Jan 9, 2025
1 parent 93e184e commit e8cd9c7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion browser_tests/colorPalette.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 0 additions & 5 deletions browser_tests/fixtures/ComfyPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions browser_tests/interaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})

Expand All @@ -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'
)
Expand Down
4 changes: 2 additions & 2 deletions browser_tests/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e8cd9c7

Please sign in to comment.