From 38660d05d1f5f558d1021a546cf9f114e23ebb0f Mon Sep 17 00:00:00 2001 From: Nico Krause Date: Wed, 4 Dec 2024 16:58:38 +0500 Subject: [PATCH] Basic Address Generation Test --- tests/playground.spec.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/tests/playground.spec.js b/tests/playground.spec.js index 79fe206..58c7107 100644 --- a/tests/playground.spec.js +++ b/tests/playground.spec.js @@ -107,7 +107,7 @@ test.describe('Wallet Generation Tests', () => { }); - test('Change to ElectrumX-Doi Regtest', async ({ page, browser }) => { + test('Basic Wallet Generation Test', async ({ page, browser }) => { await page.goto('/'); await page.waitForSelector('text=You are connected to an', { state: 'visible' }); @@ -120,5 +120,28 @@ test.describe('Wallet Generation Tests', () => { expect(mnemonic).not.toBe(''); }); + test('Basic Address Generation Test', async ({ page, browser }) => { + await page.goto('/'); + await page.waitForSelector('text=You are connected to an', { state: 'visible' }); + await page.getByRole('button', { name: 'Doichain-Mainnet Open menu' }).click(); + await page.getByText('Doichain-Regtest').click(); + await page.selectOption('#derivationStandardSelect', 'electrum-legacy'); + + // Set the mnemonic to the specified seed phrase + await page.fill('#mnemonicTextarea', 'test test test test test test test test test test test test'); + + // Fill in the password for decryption + await page.fill('#passwordInput', 'mnemonic'); + + // Click to decrypt + await page.getByRole('button', { name: 'Decrypt' }).click(); + + // Extract the generated address + const generatedAddress = await page.inputValue('#nextUnusedAddress'); + + // Verify the generated address + expect(generatedAddress).toBe('n3csERn5LkYxgmNQ1XH4qfRR5Ak8v3p3HU'); + }); + // ... other tests ... });