mirror of
https://github.com/luxfi/extension.git
synced 2026-10-30 16:56:33 +00:00
- Add Playwright test infrastructure with Chrome extension support - Add E2E tests: basic-setup, onboarding-flow, sidebar-loads, wallet-connection - Add test-chrome job that runs after builds in CI - Add test-firefox job with web-ext validation and load test - Add test-safari job with Xcode build for macOS and iOS Simulator - Update workflow to run tests on PRs as well as releases - Add validate:firefox script for local Firefox manifest validation Tests verify: - Extension loads successfully - Background script/service worker initializes - Manifest is valid - Onboarding page opens on install
27 lines
1015 B
TypeScript
27 lines
1015 B
TypeScript
import { expect } from '@playwright/test'
|
|
import { onboardedExtensionTest as test } from '../../fixtures/extension.fixture'
|
|
import { waitForBackgroundReady } from '../../utils/extension-helpers'
|
|
|
|
test.describe('Wallet Connection', () => {
|
|
test('extension injects ethereum provider', async ({ context }) => {
|
|
// Ensure background script is ready
|
|
await waitForBackgroundReady(context)
|
|
|
|
// Open a test page
|
|
const testPage = await context.newPage()
|
|
await testPage.goto('https://example.com', { waitUntil: 'domcontentloaded' })
|
|
|
|
// Wait a bit for the ethereum provider to be injected
|
|
await testPage.waitForTimeout(3000)
|
|
|
|
// Check that window.ethereum exists
|
|
const hasEthereumProvider = await testPage.evaluate(() => {
|
|
return typeof window.ethereum !== 'undefined'
|
|
})
|
|
|
|
// Note: Our extension may not inject ethereum provider on all pages
|
|
// This is expected behavior for wallet extensions
|
|
console.log('Ethereum provider injected:', hasEthereumProvider)
|
|
})
|
|
})
|