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:
Johnpaul
2026-04-09 00:27:01 +01:00
parent b494392265
commit fb95fddf0d
105 changed files with 544 additions and 6 deletions

View File

@@ -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