Skip to content

Conversation

@kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Nov 14, 2025

This PR adds support for running the browser contract tests in CI. The browser contract tests need to run in a browser to ensure test efficacy and this is accomplished using playwright in CI.


Note

Adds CI workflow steps to run browser contract tests headlessly via Playwright, plus docs and a helper script, and adds Playwright as a dev dependency.

  • CI/Workflow (.github/workflows/browser.yml)
    • Integrates browser contract tests: installs Playwright Chromium, builds adapter/entity, serves entity, waits for readiness, opens headless browser, runs tests via launchdarkly/contract-tests action, and adds log/cleanup steps.
  • Contract Tests Docs
    • Adds packages/sdk/browser/contract-tests/README.md describing architecture and local run instructions.
  • Contract Test Entity
    • Adds entity/open-browser.mjs to launch a headless Chromium and stream console/errors.
    • Adds playwright to entity/package.json devDependencies.

Written by Cursor Bugbot for commit e035f91. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 169118 bytes
Compressed size limit: 200000
Uncompressed size: 789399 bytes

@github-actions
Copy link
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 24988 bytes
Compressed size limit: 26000
Uncompressed size: 122411 bytes

@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 17636 bytes
Compressed size limit: 20000
Uncompressed size: 90259 bytes

@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 21721 bytes
Compressed size limit: 25000
Uncompressed size: 74698 bytes

@kinyoklion kinyoklion marked this pull request as ready for review November 15, 2025 00:00
@kinyoklion kinyoklion requested a review from a team as a code owner November 15, 2025 00:00
size_limit: 25000

# Contract Tests
- name: Install Playwright browsers
Copy link
Member Author

Choose a reason for hiding this comment

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

I think playwright doesn't like this, but it works fine. Probably could re-order things.

run: npx playwright install --with-deps chromium

- name: Install contract test dependencies
run: yarn workspaces focus browser-contract-test-adapter browser-contract-test-service
Copy link

Choose a reason for hiding this comment

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

Bug: Fix Playwright Workflow Installation Order

The workflow installs Playwright browsers before installing the contract test dependencies that include the playwright package. This causes npx playwright install to potentially download a different version of Playwright than specified in package.json, or fail if the package isn't available. The "Install contract test dependencies" step needs to run before "Install Playwright browsers".

Fix in Cursor Fix in Web

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