Skip to content

[Browser Run] Document Vitest Browser Mode provider#31883

Draft
irvinebroque wants to merge 6 commits into
productionfrom
docs/vitest-browser-run
Draft

[Browser Run] Document Vitest Browser Mode provider#31883
irvinebroque wants to merge 6 commits into
productionfrom
docs/vitest-browser-run

Conversation

@irvinebroque

Copy link
Copy Markdown
Contributor

Summary

Adds a Browser Run CDP how-to for running Vitest Browser Mode tests on Browser Run hosted Chromium with @cloudflare/vitest-browser-run-provider.

Also adds cross-links from Browser Run CDP/examples/integration methods, Workers testing and Vitest integration docs, and the Cloudflare Vite plugin tunnel reference. Adds both a global changelog post and a Browser Run release note entry.

Screenshots (optional)

Documentation checklist

  • Is there a changelog entry (guidelines)? If you don't add one for something awesome and new (however small) — how will our customers find out? Changelogs are automatically posted to RSS feeds, the Discord, and X.
  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/changelog/ @cloudflare/pm-changelogs, @cloudflare/product-owners
/src/content/docs/browser-run/ @mchenco, @cloudflare/product-owners, @celso, @kathayl, @dcpena, @meddulla, @simonabadoiu, @jonnyparris, @ruifigueira, @Refaerds, @omarmosid
/src/content/docs/workers/ @cloudflare/workers-docs, @GregBrimble, @irvinebroque, @mikenomitch, @korinne, @WalshyDev, @cloudflare/deploy-config, @cloudflare/product-owners, @cloudflare/wrangler, @MattieTK, @cloudflare/dev-plat-leads, @vy-ton
/src/content/partials/browser-run/ @mchenco, @cloudflare/product-owners, @celso, @kathayl, @dcpena, @meddulla, @simonabadoiu, @jonnyparris, @ruifigueira, @Refaerds, @omarmosid
/src/content/release-notes/browser-run.yaml @mchenco, @cloudflare/product-owners, @celso, @kathayl, @dcpena, @meddulla, @simonabadoiu, @jonnyparris, @ruifigueira, @Refaerds, @omarmosid

@ask-bonk

ask-bonk Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

UnknownError: The operation timed out.

github run

@ask-bonk ask-bonk Bot added documentation Documentation edits content:new Request for new/missing content labels Jul 4, 2026

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean addition. Two items to address before merge.

@@ -0,0 +1,257 @@
---
pcx_content_type: how-to
title: Using with Vitest Browser Mode (CDP)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Page titles must use imperative mood, not gerund phrases (style guide: 'Install Wrangler' not 'Installing Wrangler').


One of the most common use cases for using Playwright is software testing. Playwright includes test assertion features in its APIs; refer to [Assertions](https://playwright.dev/docs/test-assertions) in the Playwright documentation for details. Here's an example of a Worker doing `expect()` test assertions of the [todomvc](https://demo.playwright.dev/todomvc) demo page:

To run Vitest Browser Mode tests against Browser Run hosted Chromium, refer to [Using with Vitest Browser Mode (CDP)](/browser-run/cdp/vitest-browser-mode/).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This cross-link breaks the flow of the Assertions example. Move it to the end of the section, after the code block and before the heading.

@ask-bonk

ask-bonk Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Posted 2 suggestions and applied labels (documentation, content:new) on PR #31883.

Summary of changes

  • Adds a new how-to page (/browser-run/cdp/vitest-browser-mode/) for running Vitest Browser Mode tests on Browser Run hosted Chromium via CDP.
  • Adds a global changelog entry and a Browser Run release note for the @cloudflare/vitest-browser-run-provider launch.
  • Cross-links the new page from Browser Run CDP, examples, and integration-method pages; from Workers testing docs; and from the Vite plugin tunnel reference.

Issues that need attention

  • MEDIUMsrc/content/docs/browser-run/cdp/vitest-browser-mode.mdx line 3: Page title uses a gerund phrase (Using with Vitest Browser Mode (CDP)). The style guide requires imperative mood for page titles (e.g., Use Vitest Browser Mode (CDP)). Posted an inline suggestion.

  • MEDIUMsrc/content/docs/browser-run/playwright/index.mdx line 159: The Vitest Browser Mode cross-link is inserted between the Assertions intro paragraph and its code example, breaking the flow. Move it to the end of the section, after the code block and before the ### Storage state heading.

github run

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Preview URL: https://0fa63d67.preview.developers.cloudflare.com
Preview Branch URL: https://docs-vitest-browser-run.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/browser-run/cdp/vitest-browser-mode/ https://docs-vitest-browser-run.preview.developers.cloudflare.com/browser-run/cdp/vitest-browser-mode/
https://developers.cloudflare.com/changelog/post/2026-07-03-vitest-browser-mode-provider/ https://docs-vitest-browser-run.preview.developers.cloudflare.com/changelog/post/2026-07-03-vitest-browser-mode-provider/
https://developers.cloudflare.com/browser-run/cdp/ https://docs-vitest-browser-run.preview.developers.cloudflare.com/browser-run/cdp/
https://developers.cloudflare.com/browser-run/examples/ https://docs-vitest-browser-run.preview.developers.cloudflare.com/browser-run/examples/
https://developers.cloudflare.com/browser-run/playwright/ https://docs-vitest-browser-run.preview.developers.cloudflare.com/browser-run/playwright/
https://developers.cloudflare.com/workers/testing/ https://docs-vitest-browser-run.preview.developers.cloudflare.com/workers/testing/
https://developers.cloudflare.com/workers/testing/vitest-integration/ https://docs-vitest-browser-run.preview.developers.cloudflare.com/workers/testing/vitest-integration/
https://developers.cloudflare.com/workers/vite-plugin/reference/api/ https://docs-vitest-browser-run.preview.developers.cloudflare.com/workers/vite-plugin/reference/api/
https://developers.cloudflare.com/workers/testing/vitest-integration/write-your-first-test/ https://docs-vitest-browser-run.preview.developers.cloudflare.com/workers/testing/vitest-integration/write-your-first-test/

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

CI run failed: build logs

@irvinebroque

Copy link
Copy Markdown
Contributor Author

/bonk address all feedback

Co-authored-by: irvinebroque <irvinebroque@users.noreply.github.com>
@ask-bonk

ask-bonk Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Done. Addressed both review items on PR #31883:

  1. Page title (vitest-browser-mode.mdx): Changed from the gerund phrase Using with Vitest Browser Mode (CDP) to the imperative Use Vitest Browser Mode (CDP).

  2. Cross-link placement (playwright/index.mdx): Moved the Vitest Browser Mode cross-link from between the Assertions intro paragraph and its code example to the end of the section, after the code block and before the ### Storage state heading. Also updated the link text to match the new imperative title.

github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content:new Request for new/missing content documentation Documentation edits product:browser-run product:changelog product:workers Related to Workers product size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.