mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 14:54:37 +00:00
Extract repeated locators into BottomPanel and ShortcutsTab page objects. Refactor bottomPanelShortcuts.spec.ts and menu.spec.ts to use the new page object. Amp-Thread-ID: https://ampcode.com/threads/T-019c167b-dacb-706c-9626-4a31a1f6ab6e Co-authored-by: Amp <amp@ampcode.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import type { Locator, Page } from '@playwright/test'
|
|
|
|
class ShortcutsTab {
|
|
readonly essentialsTab: Locator
|
|
readonly viewControlsTab: Locator
|
|
readonly manageButton: Locator
|
|
readonly keyBadges: Locator
|
|
readonly subcategoryTitles: Locator
|
|
|
|
constructor(readonly page: Page) {
|
|
this.essentialsTab = page.getByRole('tab', { name: /Essential/i })
|
|
this.viewControlsTab = page.getByRole('tab', { name: /View Controls/i })
|
|
this.manageButton = page.getByRole('button', { name: /Manage Shortcuts/i })
|
|
this.keyBadges = page.locator('.key-badge')
|
|
this.subcategoryTitles = page.locator('.subcategory-title')
|
|
}
|
|
}
|
|
|
|
export class BottomPanel {
|
|
readonly root: Locator
|
|
readonly keyboardShortcutsButton: Locator
|
|
readonly toggleButton: Locator
|
|
readonly shortcuts: ShortcutsTab
|
|
|
|
constructor(readonly page: Page) {
|
|
this.root = page.locator('.bottom-panel')
|
|
this.keyboardShortcutsButton = page.getByRole('button', {
|
|
name: /Keyboard Shortcuts/i
|
|
})
|
|
this.toggleButton = page.getByRole('button', {
|
|
name: /Toggle Bottom Panel/i
|
|
})
|
|
this.shortcuts = new ShortcutsTab(page)
|
|
}
|
|
}
|