mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
## Summary Add tests verifying real model loading: - Upload cube.obj via file chooser button - Drag-and-drop cube.obj onto the 3D canvas - Add data-testid to LoadingOverlay for stable test selectors. Add tests verifying 3d viewer openning: - Open viewer from Load3D node via expand button, verify canvas and controls sidebar - Cancel button closes the viewer dialog ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10957-test-add-E2E-tests-for-Load3D-model-upload-and-drag-drop-and-basic-e2e-for-3d-viewer-33c6d73d3650810c8ff8ed656a5164a6) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <github-actions@github.com>
31 lines
754 B
TypeScript
31 lines
754 B
TypeScript
import { expect } from '@playwright/test'
|
|
import type { Locator, Page } from '@playwright/test'
|
|
|
|
export class Load3DViewerHelper {
|
|
readonly dialog: Locator
|
|
|
|
constructor(readonly page: Page) {
|
|
this.dialog = page.locator('[aria-labelledby="global-load3d-viewer"]')
|
|
}
|
|
|
|
get canvas(): Locator {
|
|
return this.dialog.locator('canvas')
|
|
}
|
|
|
|
get sidebar(): Locator {
|
|
return this.dialog.getByTestId('load3d-viewer-sidebar')
|
|
}
|
|
|
|
get cancelButton(): Locator {
|
|
return this.dialog.getByRole('button', { name: /cancel/i })
|
|
}
|
|
|
|
async waitForOpen(): Promise<void> {
|
|
await expect(this.dialog).toBeVisible({ timeout: 10000 })
|
|
}
|
|
|
|
async waitForClosed(): Promise<void> {
|
|
await expect(this.dialog).toBeHidden({ timeout: 5000 })
|
|
}
|
|
}
|