mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
## Summary Makes the save/save as buttons in the builder footer toolbar all a fixed size so when switching states the elements dont jump ## Changes - **What**: - Apply widths from design to the buttons - Add tests that measure the sizes of the buttons ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10681-fix-Ensure-all-save-save-as-buttons-are-the-same-width-3316d73d36508187bb74c5a977ea876f) by [Unito](https://www.unito.io)
74 lines
1.6 KiB
TypeScript
74 lines
1.6 KiB
TypeScript
import type { Locator, Page } from '@playwright/test'
|
|
|
|
import type { ComfyPage } from '../ComfyPage'
|
|
import { TestIds } from '../selectors'
|
|
|
|
export class BuilderFooterHelper {
|
|
constructor(private readonly comfyPage: ComfyPage) {}
|
|
|
|
private get page(): Page {
|
|
return this.comfyPage.page
|
|
}
|
|
|
|
get nav(): Locator {
|
|
return this.page.getByTestId(TestIds.builder.footerNav)
|
|
}
|
|
|
|
get exitButton(): Locator {
|
|
return this.buttonByName('Exit app builder')
|
|
}
|
|
|
|
get nextButton(): Locator {
|
|
return this.buttonByName('Next')
|
|
}
|
|
|
|
get backButton(): Locator {
|
|
return this.buttonByName('Back')
|
|
}
|
|
|
|
get saveButton(): Locator {
|
|
return this.page.getByTestId(TestIds.builder.saveButton)
|
|
}
|
|
|
|
get saveGroup(): Locator {
|
|
return this.page.getByTestId(TestIds.builder.saveGroup)
|
|
}
|
|
|
|
get saveAsButton(): Locator {
|
|
return this.page.getByTestId(TestIds.builder.saveAsButton)
|
|
}
|
|
|
|
get saveAsChevron(): Locator {
|
|
return this.page.getByTestId(TestIds.builder.saveAsChevron)
|
|
}
|
|
|
|
get opensAsPopover(): Locator {
|
|
return this.page.getByTestId(TestIds.builder.opensAs)
|
|
}
|
|
|
|
private buttonByName(name: string): Locator {
|
|
return this.nav.getByRole('button', { name })
|
|
}
|
|
|
|
async next() {
|
|
await this.nextButton.click()
|
|
await this.comfyPage.nextFrame()
|
|
}
|
|
|
|
async back() {
|
|
await this.backButton.click()
|
|
await this.comfyPage.nextFrame()
|
|
}
|
|
|
|
async exitBuilder() {
|
|
await this.exitButton.click()
|
|
await this.comfyPage.nextFrame()
|
|
}
|
|
|
|
async openSaveAsFromChevron() {
|
|
await this.saveAsChevron.click()
|
|
await this.page.getByRole('menuitem', { name: 'Save as' }).click()
|
|
await this.comfyPage.nextFrame()
|
|
}
|
|
}
|