diff --git a/.github/workflows/test-browser-exp.yaml b/.github/workflows/test-browser-exp.yaml index 4e5481b92..dc10d8b9e 100644 --- a/.github/workflows/test-browser-exp.yaml +++ b/.github/workflows/test-browser-exp.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest if: github.event.label.name == 'New Browser Test Expectations' steps: - - uses: Comfy-Org/ComfyUI_frontend_setup_action@v1 + - uses: Comfy-Org/ComfyUI_frontend_setup_action@v2.1 - name: Install Playwright Browsers run: npx playwright install chromium --with-deps working-directory: ComfyUI_frontend diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index c2fe56a09..222865f92 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -650,10 +650,14 @@ export class ComfyPage { x: nodePos.x + nodeSize.width * ratioX, y: nodePos.y + nodeSize.height * ratioY } - await this.dragAndDrop(bottomRight, target) + // -1 to be inside the node. -2 because nodes currently get an arbitrary +1 to width. + await this.dragAndDrop( + { x: bottomRight.x - 2, y: bottomRight.y - 1 }, + target + ) await this.nextFrame() if (revertAfter) { - await this.dragAndDrop(target, bottomRight) + await this.dragAndDrop({ x: target.x - 2, y: target.y - 1 }, bottomRight) await this.nextFrame() } } @@ -664,14 +668,20 @@ export class ComfyPage { revertAfter: boolean = false ) { const ksamplerPos = { - x: 864, - y: 157 + x: 863, + y: 156 } const ksamplerSize = { width: 315, height: 292 } - this.resizeNode(ksamplerPos, ksamplerSize, percentX, percentY, revertAfter) + return this.resizeNode( + ksamplerPos, + ksamplerSize, + percentX, + percentY, + revertAfter + ) } async resizeLoadCheckpointNode( @@ -680,14 +690,14 @@ export class ComfyPage { revertAfter: boolean = false ) { const loadCheckpointPos = { - x: 25, - y: 440 + x: 26, + y: 444 } const loadCheckpointSize = { - width: 320, - height: 120 + width: 315, + height: 127 } - this.resizeNode( + return this.resizeNode( loadCheckpointPos, loadCheckpointSize, percentX, @@ -702,14 +712,14 @@ export class ComfyPage { revertAfter: boolean = false ) { const emptyLatentPos = { - x: 475, - y: 580 + x: 473, + y: 579 } const emptyLatentSize = { - width: 303, - height: 132 + width: 315, + height: 136 } - this.resizeNode( + return this.resizeNode( emptyLatentPos, emptyLatentSize, percentX, diff --git a/browser_tests/groupNode.spec.ts b/browser_tests/groupNode.spec.ts index 7fb7fc592..92c8e6c05 100644 --- a/browser_tests/groupNode.spec.ts +++ b/browser_tests/groupNode.spec.ts @@ -139,7 +139,9 @@ test.describe('Group Node', () => { }) => { await comfyPage.loadWorkflow('legacy_group_node') expect(await comfyPage.getGraphNodesCount()).toBe(1) - expect(comfyPage.page.locator('.comfy-missing-nodes')).not.toBeVisible() + await expect( + comfyPage.page.locator('.comfy-missing-nodes') + ).not.toBeVisible() }) test.describe('Copy and paste', () => { diff --git a/browser_tests/nodeDisplay.spec.ts b/browser_tests/nodeDisplay.spec.ts index d641322b0..5788e6ab3 100644 --- a/browser_tests/nodeDisplay.spec.ts +++ b/browser_tests/nodeDisplay.spec.ts @@ -27,10 +27,14 @@ test.describe('Optional input', () => { test('Only optional inputs', async ({ comfyPage }) => { await comfyPage.loadWorkflow('only_optional_inputs') expect(await comfyPage.getGraphNodesCount()).toBe(1) - expect(comfyPage.page.locator('.comfy-missing-nodes')).not.toBeVisible() + await expect( + comfyPage.page.locator('.comfy-missing-nodes') + ).not.toBeVisible() // If the node's multiline text widget is visible, then it was loaded successfully - expect(comfyPage.page.locator('.comfy-multiline-input')).toHaveCount(1) + await expect(comfyPage.page.locator('.comfy-multiline-input')).toHaveCount( + 1 + ) }) test('Old workflow with converted input', async ({ comfyPage }) => { await comfyPage.loadWorkflow('old_workflow_converted_input') diff --git a/browser_tests/nodeSearchBox.spec.ts b/browser_tests/nodeSearchBox.spec.ts index 35d514b57..b3bc56265 100644 --- a/browser_tests/nodeSearchBox.spec.ts +++ b/browser_tests/nodeSearchBox.spec.ts @@ -138,6 +138,8 @@ test.describe('Release context menu', () => { test('Can trigger on link release', async ({ comfyPage }) => { await comfyPage.disconnectEdge() + await comfyPage.page.mouse.move(10, 10) + await comfyPage.nextFrame() await expect(comfyPage.canvas).toHaveScreenshot( 'link-release-context-menu.png' ) diff --git a/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-2x-linux.png b/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-2x-linux.png index c6b8445f7..1f1702999 100644 Binary files a/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-2x-linux.png and b/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-2x-linux.png differ diff --git a/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-linux.png b/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-linux.png index 322f6bf0a..eee7b98e7 100644 Binary files a/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-linux.png and b/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-linux.png differ diff --git a/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-2x-linux.png b/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-2x-linux.png index 0136abcfc..242929e52 100644 Binary files a/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-2x-linux.png and b/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-2x-linux.png differ diff --git a/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-linux.png b/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-linux.png index 417b83b90..f6d7b3540 100644 Binary files a/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-linux.png and b/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-linux.png differ