mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
## Summary Add Playwright tests covering widget rendering, controls menu interaction, background color change, and recording controls visibility. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10731-test-add-basic-E2E-tests-for-Load3D-node-3336d73d36508194bff9eb2a7c9356b9) by [Unito](https://www.unito.io)
41 lines
986 B
TypeScript
41 lines
986 B
TypeScript
import type { Locator } from '@playwright/test'
|
|
|
|
export class Load3DHelper {
|
|
constructor(readonly node: Locator) {}
|
|
|
|
get canvas(): Locator {
|
|
return this.node.locator('canvas')
|
|
}
|
|
|
|
get menuButton(): Locator {
|
|
return this.node.getByRole('button', { name: /show menu/i })
|
|
}
|
|
|
|
get recordingButton(): Locator {
|
|
return this.node.getByRole('button', { name: /start recording/i })
|
|
}
|
|
|
|
get colorInput(): Locator {
|
|
return this.node.locator('input[type="color"]')
|
|
}
|
|
|
|
getUploadButton(label: string): Locator {
|
|
return this.node.getByText(label)
|
|
}
|
|
|
|
getMenuCategory(name: string): Locator {
|
|
return this.node.getByText(name, { exact: true })
|
|
}
|
|
|
|
async openMenu(): Promise<void> {
|
|
await this.menuButton.click()
|
|
}
|
|
|
|
async setBackgroundColor(hex: string): Promise<void> {
|
|
await this.colorInput.evaluate((el, value) => {
|
|
;(el as HTMLInputElement).value = value
|
|
el.dispatchEvent(new Event('input', { bubbles: true }))
|
|
}, hex)
|
|
}
|
|
}
|