mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
## Summary See https://typescript-eslint.io/blog/project-service/ for context. Creates a browser_tests specific tsconfig so that they can be linted. Does not add a package.json script to do the linting yet, but `pnpm exec eslint browser_tests` should work for now. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5633-lint-add-tsconfig-for-browser_tests-fix-existing-violations-2726d73d3650819d8ef2c4b0abc31e14) by [Unito](https://www.unito.io)
49 lines
1.2 KiB
TypeScript
49 lines
1.2 KiB
TypeScript
import type { Page } from '@playwright/test'
|
|
|
|
import type { ComfyPage } from '../ComfyPage'
|
|
|
|
export class SettingDialog {
|
|
constructor(
|
|
public readonly page: Page,
|
|
public readonly comfyPage: ComfyPage
|
|
) {}
|
|
|
|
get root() {
|
|
return this.page.locator('div.settings-container')
|
|
}
|
|
|
|
async open() {
|
|
await this.comfyPage.executeCommand('Comfy.ShowSettingsDialog')
|
|
await this.page.waitForSelector('div.settings-container')
|
|
}
|
|
|
|
/**
|
|
* Set the value of a text setting
|
|
* @param id - The id of the setting
|
|
* @param value - The value to set
|
|
*/
|
|
async setStringSetting(id: string, value: string) {
|
|
const settingInputDiv = this.page.locator(
|
|
`div.settings-container div[id="${id}"]`
|
|
)
|
|
await settingInputDiv.locator('input').fill(value)
|
|
}
|
|
|
|
/**
|
|
* Toggle the value of a boolean setting
|
|
* @param id - The id of the setting
|
|
*/
|
|
async toggleBooleanSetting(id: string) {
|
|
const settingInputDiv = this.page.locator(
|
|
`div.settings-container div[id="${id}"]`
|
|
)
|
|
await settingInputDiv.locator('input').click()
|
|
}
|
|
|
|
async goToAboutPanel() {
|
|
const aboutButton = this.page.locator('li[aria-label="About"]')
|
|
await aboutButton.click()
|
|
await this.page.waitForSelector('div.about-container')
|
|
}
|
|
}
|