Skip to content
Prev Previous commit
[refactor] use fixture canvas locator for screenshots
Replace inline canvas locators with comfyPage.canvas fixture property
for consistency and maintainability as suggested in review.
  • Loading branch information
christian-byrne committed Aug 23, 2025
commit 1e0eb2bb0f2bce2f5ac0ff8bd4157cd8ae5b166c
8 changes: 4 additions & 4 deletions browser_tests/tests/selectionToolbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test.describe('Selection Toolbox', () => {
// Selection toolbox should be visible with multiple nodes selected
await expect(comfyPage.selectionToolbox).toBeVisible()
// Border is now drawn on canvas, check via screenshot
await expect(comfyPage.page.locator('canvas')).toHaveScreenshot(
await expect(comfyPage.canvas).toHaveScreenshot(
'selection-toolbox-multiple-nodes-border.png'
)
})
Expand Down Expand Up @@ -70,23 +70,23 @@ test.describe('Selection Toolbox', () => {
// Selection toolbox should be visible but without border
await expect(comfyPage.selectionToolbox).toBeVisible()
// Border is now drawn on canvas, check via screenshot
await expect(comfyPage.page.locator('canvas')).toHaveScreenshot(
await expect(comfyPage.canvas).toHaveScreenshot(
'selection-toolbox-single-node-no-border.png'
)

// Select multiple nodes
await comfyPage.selectNodes(['KSampler', 'CLIP Text Encode (Prompt)'])

// Selection border should show with multiple selections (canvas-based)
await expect(comfyPage.page.locator('canvas')).toHaveScreenshot(
await expect(comfyPage.canvas).toHaveScreenshot(
'selection-toolbox-multiple-selections-border.png'
)

// Deselect to single node
await comfyPage.selectNodes(['CLIP Text Encode (Prompt)'])

// Border should be hidden again (canvas-based)
await expect(comfyPage.page.locator('canvas')).toHaveScreenshot(
await expect(comfyPage.canvas).toHaveScreenshot(
'selection-toolbox-single-selection-no-border.png'
)
})
Expand Down
Loading