mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 16:40:05 +00:00
feat: add centralized test selectors constants file
Amp-Thread-ID: https://ampcode.com/threads/T-019c1359-48cc-7676-abc8-2de8c57b52cf Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
42
browser_tests/fixtures/selectors.ts
Normal file
42
browser_tests/fixtures/selectors.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* Centralized test selectors for browser tests.
|
||||
* Use data-testid attributes for stable selectors.
|
||||
*/
|
||||
|
||||
export const TestIds = {
|
||||
sidebar: {
|
||||
toolbar: 'side-toolbar',
|
||||
nodeLibrary: 'node-library-tree',
|
||||
nodeLibrarySearch: 'node-library-search',
|
||||
workflows: 'workflows-sidebar',
|
||||
themeToggle: 'theme-toggle'
|
||||
},
|
||||
tree: {
|
||||
folder: 'tree-folder',
|
||||
leaf: 'tree-leaf',
|
||||
node: 'tree-node'
|
||||
},
|
||||
canvas: {
|
||||
main: 'graph-canvas',
|
||||
contextMenu: 'canvas-context-menu'
|
||||
},
|
||||
dialogs: {
|
||||
settings: 'settings-dialog',
|
||||
settingsContainer: 'settings-container',
|
||||
confirm: 'confirm-dialog',
|
||||
about: 'about-panel'
|
||||
},
|
||||
topbar: {
|
||||
queueButton: 'queue-button'
|
||||
}
|
||||
} as const
|
||||
|
||||
/**
|
||||
* Helper type for accessing nested TestIds
|
||||
*/
|
||||
export type TestIdValue =
|
||||
| (typeof TestIds.sidebar)[keyof typeof TestIds.sidebar]
|
||||
| (typeof TestIds.tree)[keyof typeof TestIds.tree]
|
||||
| (typeof TestIds.canvas)[keyof typeof TestIds.canvas]
|
||||
| (typeof TestIds.dialogs)[keyof typeof TestIds.dialogs]
|
||||
| (typeof TestIds.topbar)[keyof typeof TestIds.topbar]
|
||||
Reference in New Issue
Block a user