Skip to content

Commit

Permalink
optional tagging setuo
Browse files Browse the repository at this point in the history
  • Loading branch information
Seroxdesign committed Jun 25, 2024
1 parent 23f5c7a commit a2356f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/cache/src/defineWalletSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getWalletSetupFuncHash } from './utils/getWalletSetupFuncHash'
// TODO: Should we export this type in the `release` package?
export type WalletSetupFunction = (context: BrowserContext, walletPage: Page) => Promise<void>

// TODO: This runs at least twice. Should we cache it somehow?
// TODO: Is this still true? -> This runs at least twice. Should we cache it somehow?
/**
* This function is used to define how a wallet should be set up.
* Based on the contents of this function, a browser with the wallet extension is set up and cached so that it can be used by the tests later.
Expand Down
7 changes: 5 additions & 2 deletions packages/core/src/testWithSynpress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import type { Fixtures, TestType } from '@playwright/test'
import { mergeTests, test as base } from '@playwright/test'

export default function testWithSynpress<CustomFixtures extends Fixtures>(
customFixtures: TestType<CustomFixtures, object>
customFixtures: TestType<CustomFixtures, object>,
useCache?: boolean
) {
return mergeTests(base, customFixtures)
return mergeTests(base, customFixtures, {
useCache: useCache ?? true,
})
}
1 change: 1 addition & 0 deletions wallets/metamask/src/fixtures/metaMaskFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ let _metamaskPage: Page
export const metaMaskFixtures = (walletSetup: ReturnType<typeof defineWalletSetup>, slowMo = 0) => {
return base.extend<MetaMaskFixtures>({
_contextPath: async ({ browserName }, use, testInfo) => {

const contextPath = await createTempContextDir(browserName, testInfo.testId)

await use(contextPath)
Expand Down

0 comments on commit a2356f3

Please sign in to comment.