Skip to content

Stabilize install app integration test assertion#1459

Merged
benceruleanlu merged 3 commits intomainfrom
chore/install-test-templates-assert
Dec 4, 2025
Merged

Stabilize install app integration test assertion#1459
benceruleanlu merged 3 commits intomainfrom
chore/install-test-templates-assert

Conversation

@benceruleanlu
Copy link
Member

@benceruleanlu benceruleanlu commented Dec 4, 2025

Summary

  • replace brittle install screenshot assertion with a visibility check on the first-run template dialog
  • keep canvas readiness check via existing helper to confirm the app finished loading

Testing

  • git commit (pre-commit hook ran prettier, eslint --fix, tsc --noEmit)

┆Issue is synchronized with this Notion page by Unito

Copilot AI review requested due to automatic review settings December 4, 2025 03:13
@benceruleanlu benceruleanlu requested a review from a team as a code owner December 4, 2025 03:13
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 4, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 4, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (9)
  • tests/integration/install/installWizard.spec.ts-snapshots/choose-installation-location-install-win32.png is excluded by !**/*.png
  • tests/integration/install/installWizard.spec.ts-snapshots/cpu-clicked-install-win32.png is excluded by !**/*.png
  • tests/integration/install/installWizard.spec.ts-snapshots/desktop-app-settings-install-win32.png is excluded by !**/*.png
  • tests/integration/install/installWizard.spec.ts-snapshots/get-started-install-win32.png is excluded by !**/*.png
  • tests/integration/install/installWizard.spec.ts-snapshots/select-gpu-install-win32.png is excluded by !**/*.png
  • tests/integration/post-install/troubleshooting.spec.ts-snapshots/troubleshooting-post-install-win32.png is excluded by !**/*.png
  • tests/integration/post-install/troubleshootingServerStart.spec.ts-snapshots/cannot-start-server-troubleshoot-cards-post-install-win32.png is excluded by !**/*.png
  • tests/integration/post-install/troubleshootingServerStart.spec.ts-snapshots/cannot-start-server-troubleshoot-post-install-win32.png is excluded by !**/*.png
  • tests/integration/post-install/troubleshootingVenv.spec.ts-snapshots/troubleshooting-venv-post-install-win32.png is excluded by !**/*.png

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Removed the test callback's window parameter, added a new public templatesGrid member to TestInstalledApp, and replaced a masked screenshot assertion with a direct visibility assertion on installedApp.templatesGrid (30s timeout).

Changes

Cohort / File(s) Change Summary
Test assertion refactoring
tests/integration/install/installApp.spec.ts
Removed window parameter from test callback; replaced UI-driven masked screenshot assertion using window.getByTestId('template-workflows-content') with a direct visibility assertion on installedApp.templatesGrid with a 30s timeout.
Test helper augmentation
tests/integration/testInstalledApp.ts
Added readonly templatesGrid property to TestInstalledApp and initialized it in the constructor via this.window.getByTestId('template-workflows-content').
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/install-test-templates-assert

Comment @coderabbitai help to get the list of available commands and usage tips.

@dosubot dosubot bot added the bug Something isn't working label Dec 4, 2025
@benceruleanlu benceruleanlu added the New Browser Test Expectations Commits new screenshots for any e2e tests that have changed label Dec 4, 2025
@benceruleanlu
Copy link
Member Author

generating new test expectations, because one of them is an expected failure, actually on second thought I should also move that off of being a snapshot expectation

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes the install app integration test by replacing a brittle screenshot assertion with a more reliable visibility check. The screenshot comparison was prone to false failures due to minor visual variations, while the new approach verifies the essential behavior: that the templates grid is visible after installation.

  • Removed screenshot assertion that was causing test flakiness
  • Added visibility check for the templates grid with a 30-second timeout
  • Maintained existing canvas readiness validation through the waitUntilLoaded() helper

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3743b4b and 2f9348b.

📒 Files selected for processing (1)
  • tests/integration/install/installApp.spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Use TypeScript as the primary language and maintain exceptionally high type standards - the any type must not be used. unknown can be used when the type is unknown.
Use JSDoc format to write documentation for methods, including common tags such as @param and @return (do not use @return for void return types), and use {@link } to reference symbols.
Follow existing TypeScript patterns in the codebase and maintain clean separation between main process, renderer, and preload scripts.
Follow Electron security best practices in TypeScript code.
Run yarn typescript to perform TypeScript type checking after making changes.

Files:

  • tests/integration/install/installApp.spec.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use ESLint and Prettier for code formatting and linting - run yarn lint and yarn format to ensure consistent code style.

Files:

  • tests/integration/install/installApp.spec.ts
tests/integration/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Test changes with E2E tests (Playwright) for UI changes.

Files:

  • tests/integration/install/installApp.spec.ts
tests/integration/**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/integration-testing.mdc)

tests/integration/**/*.spec.ts: Use Playwright + TypeScript for Electron testing in integration tests
Import fixtures from testExtensions.ts, not raw Playwright
Use fixture classes (TestApp, TestInstallWizard, TestInstalledApp, TestServerStart, TestTroubleshooting, TestGraphCanvas) instead of raw locators
Leverage TestEnvironment for state manipulation and error simulation instead of manual setup
Mark slow tests with test.slow() in integration tests
Add screenshots for visual regression testing in integration tests
Mock native dialogs when needed using app.app.evaluate() with electron.dialog overrides
Trust auto-cleanup via Symbol.asyncDispose rather than manual cleanup in test fixtures
Check CI behavior with process.env.CI in integration tests

tests/integration/**/*.spec.ts: Tests should be stored in subdirectories of tests/integration/
Prefer adding properties to test classes over using locator selectors directly in tests
Use convenience methods and properties defined in helper classes instead of direct locator selectors
Prefer imports from testExtensions.ts over Playwright defaults in spec files

Files:

  • tests/integration/install/installApp.spec.ts
tests/integration/**/*.{ts,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

Use path.join() and path.sep to ensure file path handling works consistently across Windows, macOS, and Linux platforms

Files:

  • tests/integration/install/installApp.spec.ts
**/*.{ts,mts,cts}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,mts,cts}: Use features available in TypeScript 5.x
Use ESM only (type: module). Avoid CommonJS (require, module.exports)
Target ESNext runtime APIs and syntax. Prefer top-level await only when it improves clarity
Code must compile with strict mode and noImplicitAny enabled, with zero implicit any
Use unknown instead of any. Narrow with type guards. any is allowed only when interfacing with untyped code and must be localized and justified
Use interface for public object shapes intended for extension/implementation
Use type for unions, mapped/conditional types, function types, and when composition is needed
Model domain variants with a discriminant field (e.g., kind: 'X' | 'Y'). Use exhaustive switch statements
Prefer as const objects and string/number literal unions over enum
Prefer readonly properties and ReadonlyArray<T> where appropriate. Do not mutate function parameters
Prefer T[] over Array<T> for readability
Prefer Record<Key, T> for simple maps; use Map/Set when iteration semantics or key types require it
Avoid non-null assertions (!). Use optional chaining, nullish coalescing, and explicit guards
Use satisfies to enforce object literal conformance without widening values
Prefer named exports. Default exports are allowed only when a module clearly has a single primary export
Use import type { X } from '…' for type-only imports. Keep value and type imports separated when helpful for clarity and bundling
Exported functions, classes, and public APIs must have explicit parameter and return types. Internal locals can rely on inference
Prefer arrow functions for local functions and callbacks. Use function declarations when hoisting or this binding is required
Modules should be pure. Avoid executing logic at import time unless necessary (e.g., polyfills)
Prefer async/await over raw then/catch chains. Keep linear flow and use try/catch for failures
Either await promises or deliberately mark them...

Files:

  • tests/integration/install/installApp.spec.ts
tests/**/*.{ts,mts,cts}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

Test code may relax some strictness to maximize ergonomics. Keep type escapes localized

Files:

  • tests/integration/install/installApp.spec.ts
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T20:49:28.076Z
Learning: Consider running `yarn test:e2e` for UI changes before committing.
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: .cursor/rules/integration-testing.mdc:0-0
Timestamp: 2025-11-25T20:49:40.925Z
Learning: Applies to tests/integration/**/*.spec.ts : Add screenshots for visual regression testing in integration tests
📚 Learning: 2025-11-25T20:49:40.925Z
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: .cursor/rules/integration-testing.mdc:0-0
Timestamp: 2025-11-25T20:49:40.925Z
Learning: Applies to tests/integration/**/*.spec.ts : Add screenshots for visual regression testing in integration tests

Applied to files:

  • tests/integration/install/installApp.spec.ts
📚 Learning: 2025-11-25T20:49:40.925Z
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: .cursor/rules/integration-testing.mdc:0-0
Timestamp: 2025-11-25T20:49:40.925Z
Learning: Applies to tests/integration/**/*.spec.ts : Use fixture classes (TestApp, TestInstallWizard, TestInstalledApp, TestServerStart, TestTroubleshooting, TestGraphCanvas) instead of raw locators

Applied to files:

  • tests/integration/install/installApp.spec.ts
📚 Learning: 2025-11-25T20:49:28.076Z
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T20:49:28.076Z
Learning: Applies to tests/integration/**/*.{ts,tsx} : Test changes with E2E tests (Playwright) for UI changes.

Applied to files:

  • tests/integration/install/installApp.spec.ts
📚 Learning: 2025-11-25T20:49:50.649Z
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-25T20:49:50.649Z
Learning: Applies to tests/integration/**/*.spec.ts : Use convenience methods and properties defined in helper classes instead of direct locator selectors

Applied to files:

  • tests/integration/install/installApp.spec.ts
📚 Learning: 2025-11-25T20:49:40.925Z
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: .cursor/rules/integration-testing.mdc:0-0
Timestamp: 2025-11-25T20:49:40.925Z
Learning: Applies to tests/integration/**/*.spec.ts : Import fixtures from testExtensions.ts, not raw Playwright

Applied to files:

  • tests/integration/install/installApp.spec.ts
📚 Learning: 2025-11-25T20:49:40.925Z
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: .cursor/rules/integration-testing.mdc:0-0
Timestamp: 2025-11-25T20:49:40.925Z
Learning: Applies to tests/integration/**/*.spec.ts : Mark slow tests with test.slow() in integration tests

Applied to files:

  • tests/integration/install/installApp.spec.ts
📚 Learning: 2025-11-25T20:49:50.649Z
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-25T20:49:50.649Z
Learning: Applies to tests/integration/**/*.spec.ts : Prefer imports from `testExtensions.ts` over Playwright defaults in spec files

Applied to files:

  • tests/integration/install/installApp.spec.ts
📚 Learning: 2025-11-25T20:49:50.649Z
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-25T20:49:50.649Z
Learning: Applies to tests/integration/**/*.spec.ts : Prefer adding properties to test classes over using locator selectors directly in tests

Applied to files:

  • tests/integration/install/installApp.spec.ts
📚 Learning: 2025-11-25T20:49:40.925Z
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: .cursor/rules/integration-testing.mdc:0-0
Timestamp: 2025-11-25T20:49:40.925Z
Learning: Applies to tests/integration/**/*.spec.ts : Trust auto-cleanup via Symbol.asyncDispose rather than manual cleanup in test fixtures

Applied to files:

  • tests/integration/install/installApp.spec.ts
📚 Learning: 2025-11-25T20:49:40.925Z
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: .cursor/rules/integration-testing.mdc:0-0
Timestamp: 2025-11-25T20:49:40.925Z
Learning: Applies to tests/integration/**/*.spec.ts : Mock native dialogs when needed using app.app.evaluate() with electron.dialog overrides

Applied to files:

  • tests/integration/install/installApp.spec.ts
📚 Learning: 2025-11-25T20:49:40.925Z
Learnt from: CR
Repo: Comfy-Org/desktop PR: 0
File: .cursor/rules/integration-testing.mdc:0-0
Timestamp: 2025-11-25T20:49:40.925Z
Learning: Organize integration tests using Playwright test projects: install, post-install-setup, post-install, and post-install-teardown

Applied to files:

  • tests/integration/install/installApp.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: test
  • GitHub Check: lint-and-format (macos-latest)
  • GitHub Check: lint-and-format (windows-latest)
  • GitHub Check: build-and-test-e2e-windows / integration-windows-test
  • GitHub Check: build-apple-debug-all / build-macos-debug
🔇 Additional comments (1)
tests/integration/install/installApp.spec.ts (1)

35-37: Verify if both visibility checks are necessary.

Both firstTimeTemplateWorkflowText (line 35) and templatesGrid (line 37) are checked for visibility with the same 30-second timeout. If these elements always appear together as part of the same first-run template dialog, one check might suffice.

Please confirm whether both assertions serve distinct purposes (e.g., the grid could fail to populate even when the text is visible) or if one check is redundant.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@benceruleanlu
Copy link
Member Author

triple ai review

@benceruleanlu benceruleanlu merged commit 45adf31 into main Dec 4, 2025
3 checks passed
@benceruleanlu benceruleanlu deleted the chore/install-test-templates-assert branch December 4, 2025 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working New Browser Test Expectations Commits new screenshots for any e2e tests that have changed size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants