mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-04 05:02:17 +00:00
test: add toBeVisible assertions before every click in E2E tests
Adds `await expect(locator).toBeVisible()` before `.click()` calls across 104 test and fixture files (431 assertions). Gives immediate, descriptive failures instead of generic actionability timeouts. Skips force clicks, canvas/mouse coordinate clicks, custom click methods, catch chains, and toPass retry blocks. Updates FLAKE_PREVENTION_RULES.md with the new rule.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { Locator, Page } from '@playwright/test'
|
||||
import { expect } from '@playwright/test'
|
||||
|
||||
import type { ComfyPage } from '../ComfyPage'
|
||||
|
||||
@@ -52,6 +53,7 @@ export class AppModeWidgetHelper {
|
||||
/** Select an option from a combo/select widget. */
|
||||
async selectOption(key: string, optionName: string) {
|
||||
const widget = this.getWidgetItem(key)
|
||||
await expect(widget.getByRole('combobox')).toBeVisible()
|
||||
await widget.getByRole('combobox').click()
|
||||
await this.page
|
||||
.getByRole('option', { name: optionName, exact: true })
|
||||
@@ -84,6 +86,7 @@ export class AppModeWidgetHelper {
|
||||
)
|
||||
|
||||
const responsePromise = this.page.waitForResponse('**/api/prompt')
|
||||
await expect(this.comfyPage.appMode.runButton).toBeVisible()
|
||||
await this.comfyPage.appMode.runButton.click()
|
||||
await responsePromise
|
||||
|
||||
|
||||
Reference in New Issue
Block a user