diff --git a/wallets/phantom/src/pages/LockPage/actions/createAccount.ts b/wallets/phantom/src/pages/LockPage/actions/createAccount.ts index fbf801cd2..c705b352e 100644 --- a/wallets/phantom/src/pages/LockPage/actions/createAccount.ts +++ b/wallets/phantom/src/pages/LockPage/actions/createAccount.ts @@ -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) } diff --git a/wallets/phantom/src/pages/LockPage/actions/importAccount.ts b/wallets/phantom/src/pages/LockPage/actions/importAccount.ts index b40b6c453..5065eaa88 100644 --- a/wallets/phantom/src/pages/LockPage/actions/importAccount.ts +++ b/wallets/phantom/src/pages/LockPage/actions/importAccount.ts @@ -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 } diff --git a/wallets/phantom/src/pages/LockPage/selectors/index.ts b/wallets/phantom/src/pages/LockPage/selectors/index.ts index 065f803d0..6730fae15 100644 --- a/wallets/phantom/src/pages/LockPage/selectors/index.ts +++ b/wallets/phantom/src/pages/LockPage/selectors/index.ts @@ -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' @@ -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` @@ -46,6 +49,7 @@ const firstTimeFlowImportPageElements = { confirmPasswordInput, termsCheckbox, importButton, + savedWordsCheckbox, confirmWordsButton, continueAfterPasswordButton, getStartedButton diff --git a/wallets/phantom/test/synpress.ts b/wallets/phantom/test/synpress.ts index 54693c56f..f7ad8643e 100644 --- a/wallets/phantom/test/synpress.ts +++ b/wallets/phantom/test/synpress.ts @@ -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))