Skip to content

Commit

Permalink
chore: fix playwright test deps. add retries (#981)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBigBoss authored Jan 2, 2025
1 parent 22e5e80 commit 67eb871
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/playwright/tests/fixtures/send-accounts/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Expect, Page } from '@playwright/test'
import { assert } from 'app/utils/assert'
import { setERC20Balance } from 'app/utils/useSetErc20Balance'
import debug from 'debug'
import { parseEther, zeroAddress } from 'viem'
import { parseEther, withRetry, zeroAddress } from 'viem'
import { test as base } from '../auth'
import { testBaseClient } from '../viem/base'
import { OnboardingPage } from './page'
Expand Down Expand Up @@ -56,8 +56,16 @@ const sendAccountTest = base.extend<{
assert(!!sendAccount, 'no send account found')
assert(sendAccount.address !== zeroAddress, 'send account address is zero')

await setEthBalance({ address: sendAccount.address, value: parseEther('1') })
await setUsdcBalance({ address: sendAccount.address, value: 100n * 10n ** 6n })
await Promise.all([
withRetry(() => setEthBalance({ address: sendAccount.address, value: parseEther('1') }), {
delay: 250,
retryCount: 40,
}),
withRetry(() => setUsdcBalance({ address: sendAccount.address, value: 100n * 10n ** 6n }), {
delay: 250,
retryCount: 40,
}),
])

await onboardingPage.page.close() // close the onboarding page

Expand Down
1 change: 1 addition & 0 deletions tilt/tests.Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ local_resource(
resource_deps = [
"next:web",
"playwright:deps",
"webauthn-authenticator:build",
],
trigger_mode = CI and TRIGGER_MODE_AUTO or TRIGGER_MODE_MANUAL,
deps = files_matching(
Expand Down

0 comments on commit 67eb871

Please sign in to comment.