Files
extension/packages/browser/e2e/cross-platform.config.ts
zeekayandHanzo Dev eaf931267f fix(dist): six consumers were still reading the output root the build abandoned
src/build.js writes to the extension repo root's dist/<engine>/. Everything that
reads a build was still pointing under packages/browser, and not one of them said
so:

  e2e/playwright.config.ts   loaded a stale extension into every Playwright run
  e2e/fixtures.ts            same
  e2e/cross-platform.config.ts  same
  .hanzo/workflows/publish.yml  web-ext packaged the Chrome and Firefox stores,
                             and signed AMO, from a directory a clean checkout
                             does not have — the store lane could not have worked
  tests/webextension-polyfill.test.ts  `if (!existsSync) return` — "build pipeline
                             ships the polyfill" has been asserting nothing
  install-extension.sh / launch-brave-hanzo.sh  printed a path that isn't there

All repointed. The two polyfill tests build on demand instead of returning early:
an assertion about the bundle has to have a bundle.

tests/output-root.test.ts is the guard — it fails on any tracked file naming the
abandoned root, and would have caught all six at once. It assembles the needle
from parts rather than spelling it, so it is not its own violation.

publish.sh is deleted rather than repointed. It was a second full publish lane to
the same two stores, and it took Chrome and AMO credentials from plaintext
environment variables while .hanzo/workflows/publish.yml — which its own header
calls the system of record — pulls every one of them from KMS. One way to publish.

265/265 green.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-28 21:09:49 -07:00

81 lines
2.3 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test'
import path from 'path'
const chromeExtPath = path.resolve(__dirname, '../../../dist/chrome')
/**
* Cross-platform E2E test config.
*
* Tests core browser tool functionality (DOM interaction, navigation,
* screenshots, evaluate, fill, click) across Chrome, Firefox, and WebKit
* to ensure 100% parity.
*
* The parity tests validate raw browser capabilities that the extension
* must replicate — they run on plain browsers, NOT with extensions loaded.
* Extension-specific tests (popup, sidebar, CDP bridge) live in the
* default playwright.config.ts and only run on Chrome (Playwright
* limitation: can't load extensions in Firefox/WebKit).
*
* Run all: npx playwright test --config=e2e/cross-platform.config.ts
* Run one: npx playwright test --config=e2e/cross-platform.config.ts --project=firefox
*/
export default defineConfig({
testDir: '.',
testMatch: ['browser-tool-parity.spec.ts', 'cross-platform-*.spec.ts'],
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 2 : 4,
reporter: process.env.CI
? [['html', { open: 'never' }], ['github'], ['json', { outputFile: 'cross-platform-results.json' }]]
: 'html',
timeout: 60_000,
expect: {
timeout: 10_000,
},
use: {
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'on-first-retry',
},
projects: [
// ── Desktop browsers ──
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
// ── Chrome with extension loaded (extension-specific tests) ──
{
name: 'chrome-extension',
testMatch: ['popup.spec.ts', 'sidebar.spec.ts', 'auth-chat.spec.ts'],
use: {
launchOptions: {
args: [
`--disable-extensions-except=${chromeExtPath}`,
`--load-extension=${chromeExtPath}`,
'--no-first-run',
'--disable-default-apps',
],
},
},
},
// ── Mobile ──
{
name: 'mobile-chrome',
use: { ...devices['Pixel 7'] },
},
{
name: 'mobile-safari',
use: { ...devices['iPhone 14'] },
},
],
})