-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8e835d
commit 991eb66
Showing
5 changed files
with
141 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
examples/passport/wallets-connect-with-nextjs/playwright.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { defineConfig, devices } from '@playwright/test'; | ||
|
||
export default defineConfig({ | ||
testDir: './tests', | ||
fullyParallel: true, | ||
forbidOnly: !!process.env.CI, | ||
retries: process.env.CI ? 2 : 0, | ||
workers: process.env.CI ? 1 : undefined, | ||
outputDir: 'test-results/', | ||
|
||
use: { | ||
baseURL: 'http://localhost:3000', | ||
trace: 'on-first-retry', | ||
}, | ||
|
||
projects: [ | ||
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }, | ||
], | ||
|
||
webServer: { | ||
command: 'yarn dev', | ||
url: 'http://localhost:3000', | ||
reuseExistingServer: !process.env.CI, | ||
}, | ||
}); |
52 changes: 52 additions & 0 deletions
52
examples/passport/wallets-connect-with-nextjs/tests/base.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/'); | ||
}); | ||
|
||
test.describe('home page', () => { | ||
test('has title, heading and link', async ({ page }) => { | ||
await expect(page).toHaveTitle('Passport Wallets Connect'); | ||
|
||
await expect(page.getByRole('heading', { name: 'Passport Wallets Connect Examples' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Connect Wallet with EtherJS' })).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Connect Wallet with EIP1193' })).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Connect Wallet with Wagmi' })).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test.describe('connect wallet with etherjs', () => { | ||
test('has heading, login button and initial account status set correctly', async ({ page }) => { | ||
await page.click('text=Connect Wallet with EtherJS'); | ||
|
||
await expect(page.getByRole('heading', { name: 'Passport Wallet - Connect with EtherJS' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('button', { name: 'Passport Login' })).toBeVisible(); | ||
await expect(page.getByText('Connected Account:')).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Return to Examples' })).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test.describe('connect wallet with eip1193', () => { | ||
test('has heading, login button and initial account status set correctly', async ({ page }) => { | ||
await page.click('text=Connect Wallet with EIP1193'); | ||
|
||
await expect(page.getByRole('heading', { name: 'Passport Wallet - Connect with EIP-1193' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('button', { name: 'Passport Login' })).toBeVisible(); | ||
await expect(page.getByText('Connected Account:')).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Return to Examples' })).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test.describe('connect wallet with wagmi', () => { | ||
test('has heading and login button set correctly', async ({ page }) => { | ||
await page.click('text=Connect Wallet with Wagmi'); | ||
|
||
await expect(page.getByRole('heading', { name: 'Passport Wallet - Connect with Wagmi' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('button', { name: 'Immutable Passport' })).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Return to Examples' })).toBeVisible(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters