Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/config/rainbow-kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import {
zerionWallet,
} from "@rainbow-me/rainbowkit/wallets"

import { IS_CI, IS_DEV } from "@/lib/utils/env"

import { mockWallet } from "../../tests/e2e/fixtures/mockWallet"

const CHAIN_MAP = {
hardhat,
sepolia,
Expand Down Expand Up @@ -78,13 +74,6 @@ const walletGroups = [
},
]

if (IS_DEV || IS_CI) {
walletGroups.push({
groupName: "Test",
wallets: [mockWallet],
})
}

export const rainbowkitConfig = getDefaultConfig({
appName: "ethereum.org",
projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID!,
Expand Down
35 changes: 0 additions & 35 deletions tests/e2e/fixtures/mockWallet.ts

This file was deleted.

22 changes: 5 additions & 17 deletions tests/e2e/pages/StartPage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, Page } from "@playwright/test"
import { Page } from "@playwright/test"

import { testData } from "../fixtures/testData"

Expand Down Expand Up @@ -28,7 +28,10 @@ export class StartPage extends BasePage {
await this.assertTitleContains(testData.content.headings.startPage)
}

async connectWithExistingWallet() {
/**
* Navigate through the start flow and open the wallet connection modal.
*/
async openWalletConnectionModal() {
await this.page
.getByRole("paragraph")
.filter({ hasText: "I have a wallet." })
Expand All @@ -37,20 +40,5 @@ export class StartPage extends BasePage {
await this.page
.getByRole("button", { name: "Sign in with Ethereum" })
.click()
// Choose mock wallet option in RainbowKit modal
await this.page.getByTestId("rk-wallet-option-mock").click()
// Verify wallet connected
await expect(
this.page
.getByRole("paragraph")
.filter({ hasText: "This is your account" })
).toBeVisible()
}

async continueToUseAppsStep() {
await this.page.getByRole("button", { name: "Let's continue" }).click()
await expect(
this.page.getByRole("heading", { name: "Let's use some apps" })
).toBeVisible()
}
}
18 changes: 14 additions & 4 deletions tests/e2e/start.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import { test } from "@playwright/test"
import { expect, test } from "@playwright/test"

import { StartPage } from "./pages"

test.describe("Start Page", () => {
test("Connect wallet", async ({ page }) => {
test("loads successfully", async ({ page }) => {
const startPage = new StartPage(page)
await startPage.goto()
await startPage.verifyPageLoaded()
})

test("wallet modal opens with wallet options", async ({ page }) => {
const startPage = new StartPage(page)
await startPage.goto()
await startPage.verifyPageLoaded()

await startPage.connectWithExistingWallet()
await startPage.openWalletConnectionModal()

await startPage.continueToUseAppsStep()
const walletModal = page.getByRole("dialog")
await expect(walletModal.getByText("Connect a Wallet")).toBeVisible()
await expect(walletModal.getByText("MetaMask")).toBeVisible()
await expect(walletModal.getByText("Coinbase Wallet")).toBeVisible()
await expect(walletModal.getByText("Rainbow")).toBeVisible()
})
})
Loading