mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
*PR Created by the Glary-Bot Agent* --- ## Summary - Convert ~120 getter-based locators across 18 browser test fixture files to `public readonly` constructor-assigned properties - Removes unnecessary indirection, makes object shape explicit, and improves IDE auto-complete / type inference - Keeps lazy-init getters (`??=`), computed properties, and `private get page()` convenience accessors as getters ## Changes **`browser_tests/fixtures/components/`** (6 files): `ComfyNodeSearchBox`, `ContextMenu`, `SettingDialog`, `SignInDialog`, `SidebarTab` (all 6 classes), `Topbar` **`browser_tests/fixtures/`** (4 files): `ComfyPage` (ComfyMenu.buttons, ComfyPage.visibleToasts), `UserSelectPage`, `ComfyMouse`, `VueNodeHelpers` **`browser_tests/fixtures/helpers/`** (7 files): `AppModeHelper`, `BuilderFooterHelper`, `BuilderSaveAsHelper`, `BuilderSelectHelper`, `BuilderStepsHelper`, `ToastHelper`, `NodeOperationsHelper` **`browser_tests/fixtures/utils/`** (1 file): `vueNodeFixtures` ## Validation - `pnpm typecheck` ✅ - `pnpm typecheck:browser` ✅ - `pnpm exec eslint browser_tests/fixtures/` ✅ - All pre-commit hooks pass (oxfmt, oxlint, eslint, typecheck, typecheck:browser) ✅ - No visual/manual verification needed — changes are test fixture locator declarations only (no UI or runtime behavior change) Fixes #11131 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11135-refactor-standardize-Page-Object-locators-as-public-readonly-instead-of-getters-33e6d73d3650819690cbc639f3d30daf) by [Unito](https://www.unito.io) --------- Co-authored-by: Glary-Bot <glary-bot@users.noreply.github.com>
61 lines
2.3 KiB
TypeScript
61 lines
2.3 KiB
TypeScript
import type { Locator, Page } from '@playwright/test'
|
|
|
|
import { BaseDialog } from '@e2e/fixtures/components/BaseDialog'
|
|
|
|
export class SignInDialog extends BaseDialog {
|
|
readonly emailInput: Locator
|
|
readonly passwordInput: Locator
|
|
readonly signInButton: Locator
|
|
readonly forgotPasswordLink: Locator
|
|
readonly apiKeyButton: Locator
|
|
readonly termsLink: Locator
|
|
readonly privacyLink: Locator
|
|
readonly heading: Locator
|
|
readonly signUpLink: Locator
|
|
readonly signInLink: Locator
|
|
readonly signUpEmailInput: Locator
|
|
readonly signUpPasswordInput: Locator
|
|
readonly signUpConfirmPasswordInput: Locator
|
|
readonly signUpButton: Locator
|
|
readonly apiKeyHeading: Locator
|
|
readonly apiKeyInput: Locator
|
|
readonly backButton: Locator
|
|
readonly dividerText: Locator
|
|
|
|
constructor(page: Page) {
|
|
super(page)
|
|
this.emailInput = this.root.locator('#comfy-org-sign-in-email')
|
|
this.passwordInput = this.root.locator('#comfy-org-sign-in-password')
|
|
this.signInButton = this.root.getByRole('button', { name: 'Sign in' })
|
|
this.forgotPasswordLink = this.root.getByText('Forgot password?')
|
|
this.apiKeyButton = this.root.getByRole('button', {
|
|
name: 'Comfy API Key'
|
|
})
|
|
this.termsLink = this.root.getByRole('link', { name: 'Terms of Use' })
|
|
this.privacyLink = this.root.getByRole('link', { name: 'Privacy Policy' })
|
|
this.heading = this.root.getByRole('heading').first()
|
|
this.signUpLink = this.root.getByText('Sign up', { exact: true })
|
|
this.signInLink = this.root.getByText('Sign in', { exact: true })
|
|
this.signUpEmailInput = this.root.locator('#comfy-org-sign-up-email')
|
|
this.signUpPasswordInput = this.root.locator('#comfy-org-sign-up-password')
|
|
this.signUpConfirmPasswordInput = this.root.locator(
|
|
'#comfy-org-sign-up-confirm-password'
|
|
)
|
|
this.signUpButton = this.root.getByRole('button', {
|
|
name: 'Sign up',
|
|
exact: true
|
|
})
|
|
this.apiKeyHeading = this.root.getByRole('heading', { name: 'API Key' })
|
|
this.apiKeyInput = this.root.locator('#comfy-org-api-key')
|
|
this.backButton = this.root.getByRole('button', { name: 'Back' })
|
|
this.dividerText = this.root.getByText('Or continue with')
|
|
}
|
|
|
|
async open() {
|
|
await this.page.evaluate(() => {
|
|
void window.app!.extensionManager.dialog.showSignInDialog()
|
|
})
|
|
await this.waitForVisible()
|
|
}
|
|
}
|