mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 23:04:06 +00:00
Amp-Thread-ID: https://ampcode.com/threads/T-019c1373-f6d0-7426-a3ee-5673891f9dcc Co-authored-by: Amp <amp@ampcode.com>
21 lines
604 B
TypeScript
21 lines
604 B
TypeScript
import type { Page } from '@playwright/test'
|
|
|
|
export class SettingsHelper {
|
|
constructor(private readonly page: Page) {}
|
|
|
|
async setSetting(settingId: string, settingValue: unknown): Promise<void> {
|
|
await this.page.evaluate(
|
|
async ({ id, value }) => {
|
|
await window['app'].extensionManager.setting.set(id, value)
|
|
},
|
|
{ id: settingId, value: settingValue }
|
|
)
|
|
}
|
|
|
|
async getSetting<T = unknown>(settingId: string): Promise<T> {
|
|
return await this.page.evaluate(async (id) => {
|
|
return await window['app'].extensionManager.setting.get(id)
|
|
}, settingId)
|
|
}
|
|
}
|