File tree Expand file tree Collapse file tree 2 files changed +33
-5
lines changed
Expand file tree Collapse file tree 2 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -27,20 +27,32 @@ dotenv.config()
2727
2828type WorkspaceStore = ReturnType < typeof useWorkspaceStore >
2929
30+ class ComfyPropertiesPanel {
31+ readonly root : Locator
32+ readonly panelTitle : Locator
33+ readonly searchBox : Locator
34+
35+ constructor ( readonly page : Page ) {
36+ this . root = page . getByTestId ( 'properties-panel' )
37+ this . panelTitle = this . root . locator ( 'h3' )
38+ this . searchBox = this . root . getByPlaceholder ( 'Search...' )
39+ }
40+ }
41+
3042class ComfyMenu {
3143 private _nodeLibraryTab : NodeLibrarySidebarTab | null = null
3244 private _workflowsTab : WorkflowsSidebarTab | null = null
3345 private _topbar : Topbar | null = null
3446
3547 public readonly sideToolbar : Locator
36- public readonly propertiesPanel : Locator
48+ public readonly propertiesPanel : ComfyPropertiesPanel
3749 public readonly themeToggleButton : Locator
3850 public readonly saveButton : Locator
3951
4052 constructor ( public readonly page : Page ) {
4153 this . sideToolbar = page . locator ( '.side-tool-bar-container' )
4254 this . themeToggleButton = page . locator ( '.comfy-vue-theme-toggle' )
43- this . propertiesPanel = page . getByTestId ( 'properties-panel' )
55+ this . propertiesPanel = new ComfyPropertiesPanel ( page )
4456 this . saveButton = page
4557 . locator ( 'button[title="Save the current workflow"]' )
4658 . nth ( 0 )
Original file line number Diff line number Diff line change @@ -8,12 +8,28 @@ test.describe('Properties panel', () => {
88
99 const { propertiesPanel } = comfyPage . menu
1010
11- await expect ( propertiesPanel . getByText ( 'No node(s) selected' ) ) . toBeVisible ( )
11+ await expect ( propertiesPanel . panelTitle ) . toContainText (
12+ 'No node(s) selected'
13+ )
1214
1315 await comfyPage . selectNodes ( [ 'KSampler' , 'CLIP Text Encode (Prompt)' ] )
1416
15- await expect ( propertiesPanel . getByText ( '3 nodes selected' ) ) . toBeVisible ( )
17+ await expect ( propertiesPanel . panelTitle ) . toContainText ( '3 nodes selected' )
18+ await expect ( propertiesPanel . root . getByText ( 'KSampler' ) ) . toHaveCount ( 1 )
19+ await expect (
20+ propertiesPanel . root . getByText ( 'CLIP Text Encode (Prompt)' )
21+ ) . toHaveCount ( 2 )
1622
17- await expect ( propertiesPanel . getByText ( 'KSampler' ) ) . toHaveCount ( 1 ) // Will be 2 in Vue mode
23+ await propertiesPanel . searchBox . fill ( 'seed' )
24+ await expect ( propertiesPanel . root . getByText ( 'KSampler' ) ) . toHaveCount ( 1 )
25+ await expect (
26+ propertiesPanel . root . getByText ( 'CLIP Text Encode (Prompt)' )
27+ ) . toHaveCount ( 0 )
28+
29+ await propertiesPanel . searchBox . fill ( '' )
30+ await expect ( propertiesPanel . root . getByText ( 'KSampler' ) ) . toHaveCount ( 1 )
31+ await expect (
32+ propertiesPanel . root . getByText ( 'CLIP Text Encode (Prompt)' )
33+ ) . toHaveCount ( 2 )
1834 } )
1935} )
You can’t perform that action at this time.
0 commit comments