Skip to content

feat: add manual browser testing for the built bundle - #954

Merged
kdaviduik merged 1 commit into
mainfrom
add-manual-browser-testing
Aug 14, 2026
Merged

feat: add manual browser testing for the built bundle#954
kdaviduik merged 1 commit into
mainfrom
add-manual-browser-testing

Conversation

@kdaviduik

@kdaviduik kdaviduik commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

What

Adds test-manual/index.html that loads the locally built bundle (lib/buybutton.umd.js) instead of the CDN script and renders real buy buttons from live stores.

Example
image

Why

The unit test suite (794 tests) verifies component logic, but doesn't render actual buy buttons in a browser. This enables reviewers to:

  • Verify the built bundle loads correctly
  • See real buy buttons render with products from live stores
  • Test cart interactions, modals, and checkout flows
  • Confirm changes don't break visual rendering or API communication

This is especially important given the scale of changes we will be making to this package.

Interim Solution

This manual testing approach is an interim solution in the complete absence of automated browser testing. The codebase currently uses Testem/Mocha for unit tests only — no e2e or browser rendering tests exist.

Adding Playwright or Vitest now would complicate the ongoing modernization work (TypeScript migration, ESLint 9, browser targets). Once this stack lands and the foundation stabilizes, automated browser testing can be added as a follow-up:

  1. Vitest — to replace Testem/Mocha for unit tests (better TS support, faster)
  2. Playwright — to automate the manual test page for CI-enforced browser verification

This manual test page provides a foundation for future Playwright tests.

How to Use

pnpm install
pnpm build
pnpm serve
open http://localhost:8080/test-manual/
Screen.Recording.2026-08-10.at.10.54.58.AM.mov

Tests Included

Test Type Store Purpose
1 Product kara-daviduik Basic product with default styling
2 Collection kara-daviduik Collection grid rendering
3 Product hydrogen-migration Cross-store verification

@kdaviduik
kdaviduik force-pushed the add-manual-browser-testing branch from b4ca0ef to 184ea3f Compare April 22, 2026 20:21
@kdaviduik
kdaviduik marked this pull request as ready for review April 22, 2026 20:35
@kdaviduik
kdaviduik requested a review from a team as a code owner April 22, 2026 20:35

@graygilmore graygilmore left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎩 went well couple of questions both here and in Slack

Comment thread test-manual/README.md
Comment thread test-manual/README.md

```bash
# 1. Install dependencies (if not already done)
pnpm install

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we leverage dev instead? Or since it's a public repo we want to stay generic?

Suggested change
pnpm install
dev up

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree leveraging dev would be helpful, I'll add dev support in the future as a separate PR

@kdaviduik
kdaviduik force-pushed the add-manual-browser-testing branch from 184ea3f to 0a28643 Compare April 23, 2026 15:30
@kdaviduik
kdaviduik marked this pull request as draft April 23, 2026 23:31
Base automatically changed from enable-auto-changelog to main August 6, 2026 21:17
@kdaviduik
kdaviduik force-pushed the add-manual-browser-testing branch from 0a28643 to 2fea265 Compare August 10, 2026 14:53
@kdaviduik
kdaviduik marked this pull request as ready for review August 10, 2026 14:57
@kdaviduik
kdaviduik requested a review from graygilmore August 10, 2026 14:58

@EvilGenius13 EvilGenius13 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks @kdaviduik, this seems like a helpful addition!

Quick note that I tophatted myself and due to port conflicts the server automatically adjusted to 8082 for me. Not sure if we want to be more loose on the info surrounding the ports or just say to use the server info that the terminal spits out on start up. (maybe dev up could solve this by outputting the final address to click aswell).

Image

@kdaviduik
kdaviduik force-pushed the add-manual-browser-testing branch from 2fea265 to 78fc869 Compare August 14, 2026 21:02
Adds test-manual/index.html that loads the locally built bundle (lib/buybutton.umd.js)
and renders real buy buttons from live stores. This enables reviewers to verify changes
don't break real-world rendering before merging.

Key details:
- Uses ShopifyBuy.UI.init() API (not onReady - that's buy-button-storefront wrapper)
- Tests 3 components: product, collection, product from different store
- Includes .catch() error handlers for visible failure feedback
- Excluded from npm publish via .npmignore
- Documents the difference between buy-button-js and buy-button-storefront APIs

This is an interim solution until automated browser testing (Playwright/Vitest) is added.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: AI (Pi/GLM 5.2 Fast (Fireworks) [1m]) <noreply@pi.dev>
@kdaviduik
kdaviduik force-pushed the add-manual-browser-testing branch from 78fc869 to 4e65a9b Compare August 14, 2026 21:02
@kdaviduik

Copy link
Copy Markdown
Contributor Author

Thanks @EvilGenius13, good callout! Updated the places that mentioned a specific port in this PR. There is more work to do on that front as a separate PR (like updating the port in dev.yml for the open command) but that's out of scope for this PR and will be a follow up

@kdaviduik
kdaviduik merged commit 7ff6d3b into main Aug 14, 2026
4 of 5 checks passed
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.

3 participants