diff --git a/wallets/metamask/src/pages/OnboardingPage/actions/helpers/confirmSecretRecoveryPhrase.ts b/wallets/metamask/src/pages/OnboardingPage/actions/helpers/confirmSecretRecoveryPhrase.ts index cf3162b5d..2a4936a6f 100644 --- a/wallets/metamask/src/pages/OnboardingPage/actions/helpers/confirmSecretRecoveryPhrase.ts +++ b/wallets/metamask/src/pages/OnboardingPage/actions/helpers/confirmSecretRecoveryPhrase.ts @@ -1,5 +1,5 @@ import type { Page } from '@playwright/test' -import { SecretRecoveryPhrasePageSelectors } from '../../../../selectors' +import { SecretRecoveryPhrasePageSelectors } from '../../selectors' const StepSelectors = SecretRecoveryPhrasePageSelectors.recoveryStep diff --git a/wallets/metamask/src/pages/OnboardingPage/actions/helpers/createPassword.ts b/wallets/metamask/src/pages/OnboardingPage/actions/helpers/createPassword.ts index 43c27f23a..028a1974e 100644 --- a/wallets/metamask/src/pages/OnboardingPage/actions/helpers/createPassword.ts +++ b/wallets/metamask/src/pages/OnboardingPage/actions/helpers/createPassword.ts @@ -1,5 +1,5 @@ import type { Page } from '@playwright/test' -import { SecretRecoveryPhrasePageSelectors } from '../../../../selectors' +import { SecretRecoveryPhrasePageSelectors } from '../../selectors' const StepSelectors = SecretRecoveryPhrasePageSelectors.passwordStep diff --git a/wallets/metamask/src/pages/OnboardingPage/actions/importWallet.ts b/wallets/metamask/src/pages/OnboardingPage/actions/importWallet.ts index 82dab6afe..f84a5ea62 100644 --- a/wallets/metamask/src/pages/OnboardingPage/actions/importWallet.ts +++ b/wallets/metamask/src/pages/OnboardingPage/actions/importWallet.ts @@ -4,7 +4,7 @@ import { GetStartedPageSelectors, PinExtensionPageSelectors, WalletCreationSuccessPageSelectors -} from '../../../selectors' +} from '../selectors' import { confirmSecretRecoveryPhrase, createPassword } from './helpers' export async function importWallet(page: Page, seedPhrase: string, password: string) { diff --git a/wallets/metamask/src/pages/OnboardingPage/page.ts b/wallets/metamask/src/pages/OnboardingPage/page.ts index 0384c7211..dfafe9177 100644 --- a/wallets/metamask/src/pages/OnboardingPage/page.ts +++ b/wallets/metamask/src/pages/OnboardingPage/page.ts @@ -1,8 +1,10 @@ import type { Page } from '@playwright/test' import { importWallet } from './actions' +import * as Selectors from './selectors' export class OnboardingPage { readonly page: Page + readonly selectors = Selectors constructor(page: Page) { this.page = page diff --git a/wallets/metamask/src/selectors/onboarding/analyticsPage.ts b/wallets/metamask/src/pages/OnboardingPage/selectors/analyticsPage.ts similarity index 60% rename from wallets/metamask/src/selectors/onboarding/analyticsPage.ts rename to wallets/metamask/src/pages/OnboardingPage/selectors/analyticsPage.ts index 6f807d41e..5051b9152 100644 --- a/wallets/metamask/src/selectors/onboarding/analyticsPage.ts +++ b/wallets/metamask/src/pages/OnboardingPage/selectors/analyticsPage.ts @@ -1,4 +1,4 @@ -import { createDataTestSelector } from '../../utils/selectors/createDataTestSelector' +import { createDataTestSelector } from '../../../utils/selectors/createDataTestSelector' export default { optIn: createDataTestSelector('metametrics-i-agree'), diff --git a/wallets/metamask/src/selectors/onboarding/getStartedPage.ts b/wallets/metamask/src/pages/OnboardingPage/selectors/getStartedPage.ts similarity index 63% rename from wallets/metamask/src/selectors/onboarding/getStartedPage.ts rename to wallets/metamask/src/pages/OnboardingPage/selectors/getStartedPage.ts index c7aa4d24c..37e2b735f 100644 --- a/wallets/metamask/src/selectors/onboarding/getStartedPage.ts +++ b/wallets/metamask/src/pages/OnboardingPage/selectors/getStartedPage.ts @@ -1,4 +1,4 @@ -import { createDataTestSelector } from '../../utils/selectors/createDataTestSelector' +import { createDataTestSelector } from '../../../utils/selectors/createDataTestSelector' export default { createNewWallet: createDataTestSelector('onboarding-create-wallet'), diff --git a/wallets/metamask/src/selectors/onboarding/index.ts b/wallets/metamask/src/pages/OnboardingPage/selectors/index.ts similarity index 100% rename from wallets/metamask/src/selectors/onboarding/index.ts rename to wallets/metamask/src/pages/OnboardingPage/selectors/index.ts diff --git a/wallets/metamask/src/selectors/onboarding/pinExtensionPage.ts b/wallets/metamask/src/pages/OnboardingPage/selectors/pinExtensionPage.ts similarity index 61% rename from wallets/metamask/src/selectors/onboarding/pinExtensionPage.ts rename to wallets/metamask/src/pages/OnboardingPage/selectors/pinExtensionPage.ts index 9a737d94a..b0a0d5eda 100644 --- a/wallets/metamask/src/selectors/onboarding/pinExtensionPage.ts +++ b/wallets/metamask/src/pages/OnboardingPage/selectors/pinExtensionPage.ts @@ -1,4 +1,4 @@ -import { createDataTestSelector } from '../../utils/selectors/createDataTestSelector' +import { createDataTestSelector } from '../../../utils/selectors/createDataTestSelector' export default { nextButton: createDataTestSelector('pin-extension-next'), diff --git a/wallets/metamask/src/selectors/onboarding/secretRecoveryPhrasePage.ts b/wallets/metamask/src/pages/OnboardingPage/selectors/secretRecoveryPhrasePage.ts similarity index 91% rename from wallets/metamask/src/selectors/onboarding/secretRecoveryPhrasePage.ts rename to wallets/metamask/src/pages/OnboardingPage/selectors/secretRecoveryPhrasePage.ts index 4d0a92339..3f97cd933 100644 --- a/wallets/metamask/src/selectors/onboarding/secretRecoveryPhrasePage.ts +++ b/wallets/metamask/src/pages/OnboardingPage/selectors/secretRecoveryPhrasePage.ts @@ -1,4 +1,4 @@ -import { createDataTestSelector } from '../../utils/selectors/createDataTestSelector' +import { createDataTestSelector } from '../../../utils/selectors/createDataTestSelector' const recoveryStep = { selectNumberOfWordsDropdown: '.import-srp__number-of-words-dropdown > .dropdown__select', diff --git a/wallets/metamask/src/pages/OnboardingPage/selectors/walletCreationSuccessPage.ts b/wallets/metamask/src/pages/OnboardingPage/selectors/walletCreationSuccessPage.ts new file mode 100644 index 000000000..b3ad52380 --- /dev/null +++ b/wallets/metamask/src/pages/OnboardingPage/selectors/walletCreationSuccessPage.ts @@ -0,0 +1,5 @@ +import { createDataTestSelector } from '../../../utils/selectors/createDataTestSelector' + +export default { + confirmButton: createDataTestSelector('onboarding-complete-done') +} diff --git a/wallets/metamask/src/selectors/index.ts b/wallets/metamask/src/selectors/index.ts index 7159570b7..b5113d2b8 100644 --- a/wallets/metamask/src/selectors/index.ts +++ b/wallets/metamask/src/selectors/index.ts @@ -1,4 +1,3 @@ -export * from './onboarding' export * from './unlocking' export * from './loading' export * from './crash' diff --git a/wallets/metamask/src/selectors/onboarding/walletCreationSuccessPage.ts b/wallets/metamask/src/selectors/onboarding/walletCreationSuccessPage.ts deleted file mode 100644 index 0b6315f1c..000000000 --- a/wallets/metamask/src/selectors/onboarding/walletCreationSuccessPage.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { createDataTestSelector } from '../../utils/selectors/createDataTestSelector' - -export default { - confirmButton: createDataTestSelector('onboarding-complete-done') -}