Skip to content

Conversation

@charlespwd
Copy link
Contributor

@charlespwd charlespwd commented Jan 28, 2026

Summary

Adds browser integration test infrastructure for the vscode-extension package, enabling end-to-end validation of the extension's functionality in a real browser environment.

Key Features

Browser Test Infrastructure (3a943b9)

  • Webpack test config with browser polyfills for running tests in web environment
  • Mocha test entry point for organizing and running browser-based tests
  • Debug delay support (DEBUG_DELAY env var) to pause test execution for inspection
  • Activation smoke test verifying the extension loads correctly in browser

Watch Mode for Development (9cb3b43)

  • build:test:watch script for auto-rebuild on file changes
  • WATCH_MODE env var to keep browser open after tests complete (no auto-close)
  • E2e autocomplete test that opens layout/theme.liquid, types {{ prod, and asserts "product" appears in autocomplete suggestions

Scripts Added

Script Purpose
test:web Run browser tests (CI mode, auto-closes)
test:web:debug Run browser tests with debug delay
build:test:watch Watch mode for test file changes

Developer Workflow

Running Tests

# Run tests once (CI mode)
yarn workspace theme-check-vscode test:web

# Run tests with debug delay for inspection
yarn workspace theme-check-vscode test:web:debug

Watch Mode Development

# Terminal 1: Watch and rebuild on changes
yarn workspace theme-check-vscode build:test:watch

# Terminal 2: Run tests with browser kept open
WATCH_MODE=1 yarn workspace theme-check-vscode test:web:debug

Edit test files, save, refresh browser to see results immediately.

Test Plan

  • yarn test passes
  • yarn workspace theme-check-vscode test:web passes in CI mode
  • Watch mode rebuilds on file changes
  • WATCH_MODE=1 keeps browser open after tests
  • Autocomplete e2e test validates "product" suggestion appears

🤖 Generated with Claude Code

@charlespwd charlespwd force-pushed the browser-test-baseline branch 2 times, most recently from a678a28 to ada7b80 Compare January 29, 2026 16:53
charlespwd and others added 2 commits January 30, 2026 09:26
Add foundational infrastructure for running browser-based e2e tests
for the VS Code extension using @anthropic/vscode-test-web.

Includes:
- Test dependencies (mocha, chai, vscode-test-web)
- Webpack configuration for test bundling
- TypeScript and ESLint configuration for test files
- Activation smoke test to verify extension loads in browser
- Debug delay support for test development

Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Add watch mode for browser test development

Introduces infrastructure for developing browser tests with live reload:
- Add test:web:debug script that builds once and launches browser
- Configure webpack to output debug bundle to separate file
- Add dynamic test discovery to support single-file test runs

This enables a faster development loop: edit tests, refresh browser,
see results immediately without rebuilding.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* Add browser e2e test for Liquid object autocomplete

Tests that Liquid object completions (e.g., 'product') appear when
triggered inside {{ }} delimiters. This validates the end-to-end
autocomplete flow in the browser test environment.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

---------

Co-authored-by: Claude Opus 4.5 <[email protected]>
@charlespwd charlespwd force-pushed the browser-test-baseline branch from e9aaf0a to 9cb3b43 Compare January 30, 2026 14:26
@charlespwd charlespwd marked this pull request as ready for review January 30, 2026 16:19
@charlespwd charlespwd requested a review from a team as a code owner January 30, 2026 16:19
Copy link
Contributor Author

@charlespwd charlespwd left a comment

Choose a reason for hiding this comment

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

Even though I actually didn't sit down to write any of this, I have iterated on the results I got back multiple times and can confirm that we can now dev e2e tests in chromium w/ our extension loaded in it on a clone of Shopify/dawn.

It's pretty cool stuff!

The E2E test makes sure completion works in layout/theme.liquid and I can confirm that changing the assert to something like "completes 'program'" is failing as expected.

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.

1 participant