diff --git a/biome.json b/biome.json index c9a3b7da93..63f837aa5b 100644 --- a/biome.json +++ b/biome.json @@ -10,7 +10,7 @@ "attributePosition": "auto" }, "files": { - "include": ["src", "playwright"], + "include": ["src", "playwright", "playwright.config.ts"], "ignore": ["node_modules", ".next", "public", ".out", "package-lock.json"] }, "organizeImports": { diff --git a/playwright.config.ts b/playwright.config.ts index 135af44f0c..114742bd4f 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,6 +1,6 @@ import { defineConfig, devices } from "@playwright/test" -const baseURL = "http://localhost:3000"; +const baseURL = "http://localhost:3000" export default defineConfig({ testDir: "./playwright", @@ -10,18 +10,26 @@ export default defineConfig({ workers: process.env.CI ? 1 : undefined, reporter: process.env.CI ? "github" : "html", outputDir: "playwright/results/", - + use: { baseURL, trace: "on-first-retry", }, projects: [ - { name: "auth-setup", testMatch: /auth\.setup\.ts/ }, + { + name: "auth-setup", + testMatch: /auth\.setup\.ts/, + use: { + ...devices["Desktop Chrome"], + userAgent: `${devices["Desktop Chrome"].userAgent} GUILD_E2E`, + }, + }, { name: "chromium", use: { ...devices["Desktop Chrome"], + userAgent: `${devices["Desktop Chrome"].userAgent} GUILD_E2E`, }, dependencies: ["auth-setup"], }, @@ -56,7 +64,7 @@ export default defineConfig({ ], webServer: { - command: 'npm run start', + command: "npm run start", url: baseURL, reuseExistingServer: !process.env.CI, }, diff --git a/src/wagmiConfig/index.ts b/src/wagmiConfig/index.ts index b0421512f8..8f5f802666 100644 --- a/src/wagmiConfig/index.ts +++ b/src/wagmiConfig/index.ts @@ -179,7 +179,11 @@ export const wagmiConfig = createConfig({ [blast.id]: http(), [blastSepolia.id]: http(), [oasisSapphire.id]: http(), - [sepolia.id]: http("https://ethereum-sepolia-rpc.publicnode.com"), + [sepolia.id]: http( + env.NEXT_PUBLIC_E2E_WALLET_MNEMONIC + ? "http://localhost:8545" + : "https://ethereum-sepolia-rpc.publicnode.com" + ), [astarZkEVM.id]: http(), [coreDao.id]: http(), [liskSepolia.id]: http(), @@ -191,43 +195,44 @@ export const wagmiConfig = createConfig({ [mint.id]: http(), }, ssr: true, - connectors: process.env.NEXT_PUBLIC_E2E_WALLET_MNEMONIC - ? [ - mock({ - accounts: [mnemonicToAccount(process.env.NEXT_PUBLIC_E2E_WALLET_MNEMONIC)], - features: { - reconnect: true, - }, - }), - ] - : [ - injected(), - coinbaseWallet({ - appName: "Guild.xyz", - appLogoUrl: "https://guild.xyz/guild-icon.png", - version: "4", - }), - walletConnect({ - projectId: env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID, - showQrModal: true, - qrModalOptions: { - explorerRecommendedWalletIds: [ - "971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709", // OKX - "107bb20463699c4e614d3a2fb7b961e66f48774cb8f6d6c1aee789853280972c", // Bitcoin.com - "541d5dcd4ede02f3afaf75bf8e3e4c4f1fb09edb5fa6c4377ebf31c2785d9adf", // Ronin - "4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0", // Trust - ], - themeVariables: { - "--wcm-z-index": "10001", - "--w3m-z-index": "10001", - } as any, // casting it, so `--wcm-z-index` is accepted - }, - }), - safe({ - allowedDomains: [/gnosis-safe\.io$/, /app\.safe\.global$/], - debug: false, - }), - ], + connectors: + typeof navigator !== "undefined" && navigator.userAgent.includes("GUILD_E2E") + ? [ + mock({ + accounts: [mnemonicToAccount(env.NEXT_PUBLIC_E2E_WALLET_MNEMONIC)], + features: { + reconnect: true, + }, + }), + ] + : [ + injected(), + coinbaseWallet({ + appName: "Guild.xyz", + appLogoUrl: "https://guild.xyz/guild-icon.png", + version: "4", + }), + walletConnect({ + projectId: env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID, + showQrModal: true, + qrModalOptions: { + explorerRecommendedWalletIds: [ + "971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709", // OKX + "107bb20463699c4e614d3a2fb7b961e66f48774cb8f6d6c1aee789853280972c", // Bitcoin.com + "541d5dcd4ede02f3afaf75bf8e3e4c4f1fb09edb5fa6c4377ebf31c2785d9adf", // Ronin + "4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0", // Trust + ], + themeVariables: { + "--wcm-z-index": "10001", + "--w3m-z-index": "10001", + } as any, // casting it, so `--wcm-z-index` is accepted + }, + }), + safe({ + allowedDomains: [/gnosis-safe\.io$/, /app\.safe\.global$/], + debug: false, + }), + ], }) export const COINBASE_INJECTED_WALLET_ID = "com.coinbase.wallet"