Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚚 chore(metamask): Move onboarding selectors to page class #983

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Page } from '@playwright/test'
import { SecretRecoveryPhrasePageSelectors } from '../../../../selectors'
import { SecretRecoveryPhrasePageSelectors } from '../../selectors'

const StepSelectors = SecretRecoveryPhrasePageSelectors.recoveryStep

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Page } from '@playwright/test'
import { SecretRecoveryPhrasePageSelectors } from '../../../../selectors'
import { SecretRecoveryPhrasePageSelectors } from '../../selectors'

const StepSelectors = SecretRecoveryPhrasePageSelectors.passwordStep

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions wallets/metamask/src/pages/OnboardingPage/page.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createDataTestSelector } from '../../utils/selectors/createDataTestSelector'
import { createDataTestSelector } from '../../../utils/selectors/createDataTestSelector'

export default {
optIn: createDataTestSelector('metametrics-i-agree'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createDataTestSelector } from '../../utils/selectors/createDataTestSelector'
import { createDataTestSelector } from '../../../utils/selectors/createDataTestSelector'

export default {
createNewWallet: createDataTestSelector('onboarding-create-wallet'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createDataTestSelector } from '../../utils/selectors/createDataTestSelector'
import { createDataTestSelector } from '../../../utils/selectors/createDataTestSelector'

export default {
nextButton: createDataTestSelector('pin-extension-next'),
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createDataTestSelector } from '../../../utils/selectors/createDataTestSelector'

export default {
confirmButton: createDataTestSelector('onboarding-complete-done')
}
1 change: 0 additions & 1 deletion wallets/metamask/src/selectors/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './onboarding'
export * from './unlocking'
export * from './loading'
export * from './crash'
Expand Down

This file was deleted.