mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 13:59:28 +00:00
Leveraging the fancy coverage functionality of #10930, this PR aims to add coverage to missing dialogue models. This has proven quite constructive as many of the dialogues have since been shown to be bugged. - The APINodes sign in dialog that displays when attempting to run a workflow containing Partner nodes while not logged in was intended to display a list of nodes required to execute the workflow. The import for this component was forgotten in the original commit (#3532) and the backing component was later knipped - Error dialogs resulting are intended to display the file responsible for the error, but the prop was accidentally left out during the refactoring of #3265 - ~~The node library migration (#8548) failed to include the 'Edit Blueprint' button, and had incorrect sizing and color on the 'Delete Blueprint' button.~~ - On request, the library button changes were spun out to a separate PR ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11133-Add-missing-dialog-tests-33e6d73d3650812cb142d610461adcd4) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com>
69 lines
2.5 KiB
TypeScript
69 lines
2.5 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()
|
|
}
|
|
|
|
async openWithResult(): Promise<{ result: Promise<boolean> }> {
|
|
const result = this.page.evaluate(() =>
|
|
window.app!.extensionManager.dialog.showSignInDialog()
|
|
)
|
|
await this.waitForVisible()
|
|
return { result }
|
|
}
|
|
}
|