mirror of
https://github.com/luxfi/wallet.git
synced 2026-07-27 03:37:41 +00:00
Copies apps/extension, apps/mobile and 10 pkgs (wallet, ui, config, utilities, sessions, gating, notifications, analytics, eslint-config, prices) into a standalone pnpm workspace. Resolves merge conflict markers in extension and mobile package.json files, strips build artifacts (.wxt, .output, Pods).
51 lines
1.8 KiB
TypeScript
51 lines
1.8 KiB
TypeScript
/* oxlint-disable no-console -- fixture file */
|
|
/* oxlint-disable react-hooks/rules-of-hooks -- Playwright fixtures use `use()` which is not a React hook */
|
|
import { type BrowserContext, test as base } from '@playwright/test'
|
|
import { createExtensionContext } from 'e2e/fixtures/extension-context'
|
|
import { completeOnboarding } from 'e2e/utils/onboarding-helpers'
|
|
import { waitForExtensionLoad } from 'e2e/utils/wait-for-extension'
|
|
import { ONE_SECOND_MS } from 'utilities/src/time/time'
|
|
|
|
interface OnboardedExtensionFixtures {
|
|
context: BrowserContext
|
|
extensionId: string
|
|
}
|
|
|
|
// Extension test fixture that programmatically completes onboarding
|
|
export const onboardedExtensionTest = base.extend<OnboardedExtensionFixtures>({
|
|
// oxlint-disable-next-line no-empty-pattern -- fixture file
|
|
context: async ({}, use) => {
|
|
const context = await createExtensionContext({
|
|
userDataDirPrefix: 'playwright-extension-onboarded',
|
|
})
|
|
|
|
try {
|
|
// Wait for extension to load and onboarding to appear
|
|
const { onboardingPage } = await waitForExtensionLoad(context, {
|
|
timeout: ONE_SECOND_MS * 10,
|
|
waitForOnboarding: true,
|
|
})
|
|
|
|
// Complete onboarding programmatically
|
|
if (onboardingPage) {
|
|
await completeOnboarding(context, onboardingPage)
|
|
} else {
|
|
// Try to complete onboarding anyway - it might open later
|
|
await completeOnboarding(context)
|
|
}
|
|
} catch (error) {
|
|
console.error('Failed to complete onboarding:', error)
|
|
await context.close()
|
|
throw error
|
|
}
|
|
|
|
await use(context)
|
|
await context.close()
|
|
},
|
|
|
|
extensionId: async ({ context }, use) => {
|
|
const { extensionId } = await waitForExtensionLoad(context, { timeout: ONE_SECOND_MS * 10 })
|
|
await use(extensionId)
|
|
},
|
|
})
|