-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
802a7ee
commit b6330f6
Showing
5 changed files
with
43 additions
and
5 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
32 changes: 32 additions & 0 deletions
32
wallets/phantom/src/pages/LockPage/actions/createAccount.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,32 @@ | ||
import type { Page } from '@playwright/test' | ||
import { lockPageElements } from "../selectors"; | ||
|
||
export const importWallet = async (page: Page, secretWords: string, password: string) => { | ||
await page.click(lockPageElements.firstTimeFlowPageElements.importWalletButton) | ||
await page.click(lockPageElements.firstTimeFlowPageElements.importRecoveryPhraseButton) | ||
|
||
for (const [index, word] of secretWords.split(' ').entries()) { | ||
const inputField = await page.locator(lockPageElements.firstTimeFlowImportPageElements.secretWordsInput(index)) | ||
await inputField.fill(word) | ||
} | ||
await page.click(lockPageElements.firstTimeFlowImportPageElements.confirmWordsButton) | ||
|
||
await page.waitForLoadState('domcontentloaded') | ||
|
||
await page.click(lockPageElements.firstTimeFlowImportPageElements.confirmWordsButton) | ||
|
||
const walletInput = await page.locator(lockPageElements.firstTimeFlowImportPageElements.passwordInput) | ||
await walletInput.fill(password) | ||
|
||
const confirmWalletInput = await page.locator(lockPageElements.firstTimeFlowImportPageElements.confirmPasswordInput) | ||
await confirmWalletInput.fill(password) | ||
|
||
const checkbox = await page.locator(lockPageElements.firstTimeFlowImportPageElements.termsCheckbox) | ||
await checkbox.click() | ||
|
||
await page.click(lockPageElements.firstTimeFlowImportPageElements.continueAfterPasswordButton) | ||
|
||
await page.click(lockPageElements.firstTimeFlowImportPageElements.getStartedButton); | ||
|
||
return true; | ||
} |
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 +1,2 @@ | ||
export * from './importAccount' | ||
export * from './importAccount' | ||
export * from './createAccount' |
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