-
Notifications
You must be signed in to change notification settings - Fork 0
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
b3c915a
commit 44b595b
Showing
8 changed files
with
11,186 additions
and
72 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,37 +1,57 @@ | ||
import { expect, test } from '@playwright/test'; | ||
|
||
test.describe('Wallet Generation Tests', () => { | ||
test('should generate a new mnemonic and test all wallet types', async ({ page }) => { | ||
// Navigate to the page | ||
await page.goto('https://doichain-playground-svelte.vercel.app/'); | ||
|
||
// Generate a new mnemonic | ||
await page.click('button:has-text("Generate Mnemonic")'); | ||
const mnemonic = await page.inputValue('textarea[labelText="Mnemonic"]'); | ||
test('test', async ({ page }) => { | ||
await page.goto('http://localhost:5173/'); | ||
await page.waitForSelector('text=You are connected to an', { state: 'visible' }); | ||
await page.getByLabel('Select Wallet').first().selectOption('electrum-legacy'); | ||
//await page.getByRole('button', { name: 'Decrypt' }).click(); | ||
await page.getByRole('button', { name: 'Generate Mnemonic' }).click(); | ||
//await expect(page.getByLabel('Mnemonic')).toBeVisible(); | ||
const mnemonic = await page.inputValue('#mnemonicTextarea'); | ||
await page.getByLabel('Mnemonic').click(); | ||
expect(mnemonic).not.toBe(''); | ||
|
||
// Test each derivation standard | ||
const derivationStandards = [ | ||
'electrum-legacy', | ||
'electrum-segwit', | ||
'bip32', | ||
'bip32-p2wpkh', | ||
'bip84' | ||
]; | ||
|
||
for (const standard of derivationStandards) { | ||
// Select the derivation standard | ||
await page.selectOption('select[labelText="Select Wallet"]', { value: standard }); | ||
|
||
// Generate addresses | ||
await page.click('button:has-text("Save")'); | ||
|
||
// Verify that addresses are generated | ||
const addresses = await page.$$eval('.datatable .address', nodes => nodes.map(n => n.textContent)); | ||
expect(addresses.length).toBeGreaterThan(0); | ||
|
||
// Optionally, verify the first address format or other properties | ||
console.log(`Addresses for ${standard}:`, addresses); | ||
} | ||
// await expect(page.getByLabel('Mnemonic')).toHaveValue('gentle model squirrel point soldier suit daring april ketchup soon lemon year'); | ||
}); | ||
// test('should generate a new mnemonic and test all wallet types', async ({ page }) => { | ||
// // Navigate to the page | ||
// await page.goto('/'); | ||
// await page.waitForSelector('text=You are connected to an', { state: 'visible' }); | ||
|
||
|
||
// // Ensure the button is visible | ||
// await page.waitForSelector('button:has-text("Generate Mnemonic")', { state: 'visible' }); | ||
|
||
// // Generate a new mnemonic | ||
// await page.click('button:has-text("Generate Mnemonic")'); | ||
// await page.waitForFunction(() => document.querySelector('#mnemonicTextarea').value !== ''); | ||
// const mnemonic = await page.inputValue('#mnemonicTextarea'); | ||
// console.log('mnemonic', mnemonic); | ||
// expect(mnemonic).not.toBe(''); | ||
|
||
// // Test each derivation standard | ||
// const derivationStandards = [ | ||
// 'electrum-legacy', | ||
// 'electrum-segwit', | ||
// 'bip32', | ||
// 'bip32-p2wpkh', | ||
// 'bip84' | ||
// ]; | ||
|
||
// for (const standard of derivationStandards) { | ||
// // Select the derivation standard | ||
// await page.selectOption('select[labelText="Select Wallet"]', { value: standard }); | ||
|
||
// // Generate addresses | ||
// await page.click('button:has-text("Save")'); | ||
|
||
// // Verify that addresses are generated | ||
// const addresses = await page.$$eval('.datatable .address', nodes => nodes.map(n => n.textContent)); | ||
// expect(addresses.length).toBeGreaterThan(0); | ||
|
||
// // Optionally, verify the first address format or other properties | ||
// console.log(`Addresses for ${standard}:`, addresses); | ||
// } | ||
// }); | ||
}); |
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
Oops, something went wrong.