Skip to content

Commit

Permalink
chore: more canary logs (#2086)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 authored Apr 1, 2024
1 parent 3ac38c4 commit 94b35bc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/laboratory/tests/shared/fixtures/w3m-fixture.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint no-console: 0 */

import { test as base } from '@playwright/test'
import { ModalPage } from '../pages/ModalPage'
import { ModalValidator } from '../validators/ModalValidator'
Expand All @@ -13,12 +15,18 @@ export interface ModalFixture {
export const testM = base.extend<ModalFixture>({
library: ['wagmi', { option: true }],
modalPage: async ({ page, library }, use) => {
console.time('new ModalPage')
const modalPage = new ModalPage(page, library, 'default')
console.timeEnd('new ModalPage')
console.time('modalPage.load')
await modalPage.load()
console.timeEnd('modalPage.load')
await use(modalPage)
},
modalValidator: async ({ modalPage }, use) => {
console.time('new ModalValidator')
const modalValidator = new ModalValidator(modalPage.page)
console.timeEnd('new ModalValidator')
await use(modalValidator)
}
})
Expand Down
24 changes: 24 additions & 0 deletions apps/laboratory/tests/shared/fixtures/w3m-wallet-fixture.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint no-console: 0 */

import { testM as base, testMSiwe as siwe } from './w3m-fixture'
import { WalletPage } from '../pages/WalletPage'
import { WalletValidator } from '../validators/WalletValidator'
Expand All @@ -16,23 +18,45 @@ export const testConnectedMW = base.extend<ModalWalletFixture>({
walletPage: async ({ context, modalPage }, use) => {
if (modalPage.library === 'solana') {
// Because solana doesn't support react-wallet-v2
console.time('new WalletPage')
const walletPage = new WalletPage(await context.newPage())
console.timeEnd('new WalletPage')
console.time('walletPage.load')
await walletPage.load()
console.timeEnd('walletPage.load')
console.time('walletPage.connectWithUri')
const walletValidator = new WalletValidator(walletPage.page)
console.timeEnd('walletPage.connectWithUri')
console.time('modalPage.getConnectUri')
const uri = await modalPage.getConnectUri()
console.timeEnd('modalPage.getConnectUri')
console.time('walletPage.connectWithUri')
await walletPage.connectWithUri(uri)
console.timeEnd('walletPage.connectWithUri')
console.time('walletPage.handleSessionProposal')
await walletPage.handleSessionProposal(DEFAULT_SESSION_PARAMS)
console.timeEnd('walletPage.handleSessionProposal')
console.time('walletValidator.expectConnected')
await walletValidator.expectConnected()
console.timeEnd('walletValidator.expectConnected')
await use(walletPage)
} else {
console.time('doActionAndWaitForNewPage')
const page = await doActionAndWaitForNewPage(modalPage.clickWalletDeeplink(), context)
console.timeEnd('doActionAndWaitForNewPage')
console.time('new WalletPage')
const walletPage = new WalletPage(page)
console.timeEnd('new WalletPage')
console.time('walletPage.handleSessionProposal')
await walletPage.handleSessionProposal(DEFAULT_SESSION_PARAMS)
console.timeEnd('walletPage.handleSessionProposal')
await use(walletPage)
}
},
walletValidator: async ({ walletPage }, use) => {
console.time('new WalletValidator')
const walletValidator = new WalletValidator(walletPage.page)
console.timeEnd('new WalletValidator')
await use(walletValidator)
}
})
Expand Down

0 comments on commit 94b35bc

Please sign in to comment.