Skip to content

feat: add E2E NUT tests for webapp dev command @W-21111429@#32

Merged
deepu-mungamuri94 merged 7 commits intomainfrom
feat/e2e-testing
Mar 17, 2026
Merged

feat: add E2E NUT tests for webapp dev command @W-21111429@#32
deepu-mungamuri94 merged 7 commits intomainfrom
feat/e2e-testing

Conversation

@deepu-mungamuri94
Copy link
Copy Markdown
Collaborator

@deepu-mungamuri94 deepu-mungamuri94 commented Mar 11, 2026

Add comprehensive end-to-end NUT (non-unit test) coverage for the sf webapp dev command across three tiers:

  • Tier 1 (no auth): CLI flag validation (--target-org required)
  • Tier 2 CLI validation: webapp discovery errors, --name conflicts, --url unreachable, dev.url without dev.command
  • Tier 2 port handling: PortInUseError on explicit/manifest port, auto-increment when default port occupied, custom --port
  • Tier 2 full flow: proxy startup via dev.command, proxied content serving, JSON URL output on stderr

Test infrastructure:

  • Add test helpers (webappProjectUtils, devServerUtils) for project scaffolding, org auth, and async dev server management
  • Use process groups (detached spawn) for reliable cleanup with SIGTERM→SIGKILL escalation
  • Add .env.template for local credential setup (TESTKIT_AUTH_URL)
  • Add dotenv for loading .env in local test runs

Bug fix (source):

  • Fix proxy port auto-increment: ProxyServer wraps EADDRINUSE as SfError('PortInUseError') but the retry logic only checked err.code === 'EADDRINUSE', missing the wrapped error

What does this PR do?

E2E Testing enabled.

What issues does this PR fix or reference?

@W-21111429@

Screenshot 2026-03-12 at 6 56 18 PM

@deepu-mungamuri94 deepu-mungamuri94 requested a review from a team as a code owner March 11, 2026 07:25
- Add Tier 1 (no auth) and Tier 2 (CLI validation) tests for dev.nut.ts
- Add devPort.nut.ts for --port and --proxy-port flag tests
- Add devWithUrl.nut.ts for --url, proxy detection, and Vite integration tests
- Add shared helpers: devServerUtils (spawn, port reservation) and webappProjectUtils
- Add _cleanup.nut.ts for test session cleanup
- Add .env.template for NUT credentials (TESTKIT_AUTH_URL, etc.)
- Update GitHub Actions to run NUTs on ubuntu-latest and windows-latest
- Fix Windows CI: use spawnWebappDev, taskkill, --sfdx-url-file auth
- Extend dev.ts to support OPEN_BROWSER=false for headless test runs

Made-with: Cursor
@deepu-mungamuri94 deepu-mungamuri94 merged commit e24fb2b into main Mar 17, 2026
15 checks passed
@deepu-mungamuri94 deepu-mungamuri94 deleted the feat/e2e-testing branch March 17, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants