Skip to content

Commit

Permalink
wallet setup and complete all ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Seroxdesign committed Jul 9, 2024
1 parent 38e2cc4 commit 5a1092d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
33 changes: 12 additions & 21 deletions wallets/phantom/src/pages/LockPage/actions/createAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,23 @@ import type { Page } from '@playwright/test'
import { lockPageElements } from '../selectors'

export const createAccount = async (page: Page, password: string) => {
console.log(lockPageElements, page, password)
// await page.click(lockPageElements.firstTimeFlowPageElements.importWalletButton)
// await page.click(lockPageElements.firstTimeFlowPageElements.importRecoveryPhraseButton)
await page.waitForLoadState('domcontentloaded')
await page.click(lockPageElements.firstTimeFlowPageElements.createWalletButton)

// 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)
const walletInput = await page.locator(lockPageElements.firstTimeFlowImportPageElements.passwordInput)
await walletInput.fill(password)

// await page.waitForLoadState('domcontentloaded')
const confirmWalletInput = await page.locator(lockPageElements.firstTimeFlowImportPageElements.confirmPasswordInput)
await confirmWalletInput.fill(password)

// await page.click(lockPageElements.firstTimeFlowImportPageElements.confirmWordsButton)
const checkbox = await page.locator(lockPageElements.firstTimeFlowImportPageElements.termsCheckbox)
await checkbox.click()

// const walletInput = await page.locator(lockPageElements.firstTimeFlowImportPageElements.passwordInput)
// await walletInput.fill(password)
await page.click(lockPageElements.firstTimeFlowImportPageElements.confirmWordsButton)

// const confirmWalletInput = await page.locator(lockPageElements.firstTimeFlowImportPageElements.confirmPasswordInput)
// await confirmWalletInput.fill(password)
await page.click(lockPageElements.firstTimeFlowImportPageElements.savedWordsCheckbox)

// const checkbox = await page.locator(lockPageElements.firstTimeFlowImportPageElements.termsCheckbox)
// await checkbox.click()
await page.click(lockPageElements.firstTimeFlowImportPageElements.confirmWordsButton)

// await page.click(lockPageElements.firstTimeFlowImportPageElements.continueAfterPasswordButton)

// await page.click(lockPageElements.firstTimeFlowImportPageElements.getStartedButton);

// return true;
await page.click(lockPageElements.firstTimeFlowImportPageElements.confirmWordsButton)
}
2 changes: 2 additions & 0 deletions wallets/phantom/src/pages/LockPage/actions/importAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ export const importWallet = async (page: Page, secretWords: string, password: st

await page.click(lockPageElements.firstTimeFlowImportPageElements.getStartedButton)

await page.click(lockPageElements.firstTimeFlowImportPageElements.confirmWordsButton)

return true
}
10 changes: 7 additions & 3 deletions wallets/phantom/src/pages/LockPage/selectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ const metametricsPageElements = {
}

const firstTimeFlowPage = '.first-time-flow'
const importWalletButton = `[data-testid="import-wallet-button"]`
const importWalletButton = '[data-testid="import-wallet-button"]'
const importRecoveryPhraseButton = `[data-testid="import-seed-phrase-button"]`
const createWalletButton = `${firstTimeFlowPage} [data-testid="create-wallet-button"]`
const createWalletButton = `[data-testid="create-wallet-button"]`
const hiddenXPath = 'xpath=//*[@id="root"]/main/div[2]/form/div[1]/div[2]/div'

const firstTimeFlowPageElements = {
firstTimeFlowPage,
importWalletButton,
importRecoveryPhraseButton,
createWalletButton
createWalletButton,
hiddenXPath
}

const firstTimeFlowImportPage = '.first-time-flow__import'
Expand All @@ -34,6 +36,7 @@ const confirmWordsButton = `[data-testid="onboarding-form-submit-button"]`
const passwordInput = `[data-testid="onboarding-form-password-input"]`
const confirmPasswordInput = `[data-testid="onboarding-form-confirm-password-input"]`
const termsCheckbox = `[data-testid="onboarding-form-terms-of-service-checkbox"]`
const savedWordsCheckbox = '[data-testid="onboarding-form-saved-secret-recovery-phrase-checkbox"]'
const continueAfterPasswordButton = '[data-testid="onboarding-form-submit-button"]'
const getStartedButton = '[data-testid="onboarding-form-submit-button"]'
const importButton = `${newVaultForm} .create-new-vault__submit-button`
Expand All @@ -46,6 +49,7 @@ const firstTimeFlowImportPageElements = {
confirmPasswordInput,
termsCheckbox,
importButton,
savedWordsCheckbox,
confirmWordsButton,
continueAfterPasswordButton,
getStartedButton
Expand Down
4 changes: 2 additions & 2 deletions wallets/phantom/test/synpress.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { testWithSynpress } from '@synthetixio/synpress-core'
import { phantomFixtures } from '../src'
import importPhantom from './wallet-setup/import.setup'
import createPhantom from './wallet-setup/create.setup'

export default testWithSynpress(phantomFixtures(importPhantom))
export default testWithSynpress(phantomFixtures(createPhantom))

0 comments on commit 5a1092d

Please sign in to comment.