mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove ONBOARDING_V2 flag for release (#16865)
* Remove ONBOARDING_V2 flag for release * Remove new usage * Update e2e tests * Update incremental-security.spec.js * Fix lint Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
This commit is contained in:
parent
3cc8a4535a
commit
52a28d52b3
@ -2,7 +2,6 @@
|
|||||||
PASSWORD=METAMASK PASSWORD
|
PASSWORD=METAMASK PASSWORD
|
||||||
INFURA_PROJECT_ID=00000000000
|
INFURA_PROJECT_ID=00000000000
|
||||||
SEGMENT_WRITE_KEY=
|
SEGMENT_WRITE_KEY=
|
||||||
ONBOARDING_V2=
|
|
||||||
SWAPS_USE_DEV_APIS=
|
SWAPS_USE_DEV_APIS=
|
||||||
COLLECTIBLES_V1=
|
COLLECTIBLES_V1=
|
||||||
PUBNUB_PUB_KEY=
|
PUBNUB_PUB_KEY=
|
||||||
|
@ -9,7 +9,6 @@ const configurationPropertyNames = [
|
|||||||
...commonConfigurationPropertyNames,
|
...commonConfigurationPropertyNames,
|
||||||
'COLLECTIBLES_V1',
|
'COLLECTIBLES_V1',
|
||||||
'INFURA_PROJECT_ID',
|
'INFURA_PROJECT_ID',
|
||||||
'ONBOARDING_V2',
|
|
||||||
'PHISHING_WARNING_PAGE_URL',
|
'PHISHING_WARNING_PAGE_URL',
|
||||||
'PORTFOLIO_URL',
|
'PORTFOLIO_URL',
|
||||||
'SEGMENT_HOST',
|
'SEGMENT_HOST',
|
||||||
|
@ -1032,7 +1032,6 @@ async function getEnvironmentVariables({ buildTarget, buildType, version }) {
|
|||||||
METAMASK_VERSION: version,
|
METAMASK_VERSION: version,
|
||||||
METAMASK_BUILD_TYPE: buildType,
|
METAMASK_BUILD_TYPE: buildType,
|
||||||
NODE_ENV: devMode ? ENVIRONMENT.DEVELOPMENT : ENVIRONMENT.PRODUCTION,
|
NODE_ENV: devMode ? ENVIRONMENT.DEVELOPMENT : ENVIRONMENT.PRODUCTION,
|
||||||
ONBOARDING_V2: config.ONBOARDING_V2 === '1',
|
|
||||||
PHISHING_WARNING_PAGE_URL: getPhishingWarningPageUrl({ config, testing }),
|
PHISHING_WARNING_PAGE_URL: getPhishingWarningPageUrl({ config, testing }),
|
||||||
PORTFOLIO_URL: config.PORTFOLIO_URL || 'https://portfolio.metamask.io',
|
PORTFOLIO_URL: config.PORTFOLIO_URL || 'https://portfolio.metamask.io',
|
||||||
PUBNUB_PUB_KEY: config.PUBNUB_PUB_KEY || '',
|
PUBNUB_PUB_KEY: config.PUBNUB_PUB_KEY || '',
|
||||||
|
@ -3,7 +3,6 @@ const { promises: fs } = require('fs');
|
|||||||
const BigNumber = require('bignumber.js');
|
const BigNumber = require('bignumber.js');
|
||||||
const mockttp = require('mockttp');
|
const mockttp = require('mockttp');
|
||||||
const createStaticServer = require('../../development/create-static-server');
|
const createStaticServer = require('../../development/create-static-server');
|
||||||
const enLocaleMessages = require('../../app/_locales/en/messages.json');
|
|
||||||
const { setupMocking } = require('./mock-e2e');
|
const { setupMocking } = require('./mock-e2e');
|
||||||
const Ganache = require('./ganache');
|
const Ganache = require('./ganache');
|
||||||
const FixtureServer = require('./fixture-server');
|
const FixtureServer = require('./fixture-server');
|
||||||
@ -219,65 +218,31 @@ const completeImportSRPOnboardingFlow = async (
|
|||||||
seedPhrase,
|
seedPhrase,
|
||||||
password,
|
password,
|
||||||
) => {
|
) => {
|
||||||
if (process.env.ONBOARDING_V2 === '1') {
|
// welcome
|
||||||
// welcome
|
await driver.clickElement('[data-testid="onboarding-import-wallet"]');
|
||||||
await driver.clickElement('[data-testid="onboarding-import-wallet"]');
|
|
||||||
|
|
||||||
// metrics
|
// metrics
|
||||||
await driver.clickElement('[data-testid="metametrics-no-thanks"]');
|
await driver.clickElement('[data-testid="metametrics-no-thanks"]');
|
||||||
|
|
||||||
// import with recovery phrase
|
// import with recovery phrase
|
||||||
await driver.fill('[data-testid="import-srp-text"]', seedPhrase);
|
await driver.pasteIntoField(
|
||||||
await driver.clickElement('[data-testid="import-srp-confirm"]');
|
'[data-testid="import-srp__srp-word-0"]',
|
||||||
|
seedPhrase,
|
||||||
|
);
|
||||||
|
await driver.clickElement('[data-testid="import-srp-confirm"]');
|
||||||
|
|
||||||
// create password
|
// create password
|
||||||
await driver.fill('[data-testid="create-password-new"]', password);
|
await driver.fill('[data-testid="create-password-new"]', password);
|
||||||
await driver.fill('[data-testid="create-password-confirm"]', password);
|
await driver.fill('[data-testid="create-password-confirm"]', password);
|
||||||
await driver.clickElement('[data-testid="create-password-terms"]');
|
await driver.clickElement('[data-testid="create-password-terms"]');
|
||||||
await driver.clickElement('[data-testid="create-password-import"]');
|
await driver.clickElement('[data-testid="create-password-import"]');
|
||||||
|
|
||||||
// complete
|
// complete
|
||||||
await driver.clickElement('[data-testid="onboarding-complete-done"]');
|
await driver.clickElement('[data-testid="onboarding-complete-done"]');
|
||||||
|
|
||||||
// pin extension
|
// pin extension
|
||||||
await driver.clickElement('[data-testid="pin-extension-next"]');
|
await driver.clickElement('[data-testid="pin-extension-next"]');
|
||||||
await driver.clickElement('[data-testid="pin-extension-done"]');
|
await driver.clickElement('[data-testid="pin-extension-done"]');
|
||||||
} else {
|
|
||||||
// clicks the continue button on the welcome screen
|
|
||||||
await driver.findElement('.welcome-page__header');
|
|
||||||
await driver.clickElement({
|
|
||||||
text: enLocaleMessages.getStarted.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
|
|
||||||
// clicks the "No thanks" option on the metametrics opt-in screen
|
|
||||||
await driver.clickElement('.btn-secondary');
|
|
||||||
|
|
||||||
// clicks the "Import Wallet" option
|
|
||||||
await driver.clickElement({ text: 'Import wallet', tag: 'button' });
|
|
||||||
|
|
||||||
// Import Secret Recovery Phrase
|
|
||||||
await driver.pasteIntoField(
|
|
||||||
'[data-testid="import-srp__srp-word-0"]',
|
|
||||||
seedPhrase,
|
|
||||||
);
|
|
||||||
|
|
||||||
await driver.fill('#password', password);
|
|
||||||
await driver.fill('#confirm-password', password);
|
|
||||||
|
|
||||||
await driver.clickElement(
|
|
||||||
'[data-testid="create-new-vault__terms-checkbox"]',
|
|
||||||
);
|
|
||||||
|
|
||||||
await driver.clickElement({ text: 'Import', tag: 'button' });
|
|
||||||
|
|
||||||
// clicks through the success screen
|
|
||||||
await driver.findElement({ text: 'Congratulations', tag: 'div' });
|
|
||||||
await driver.clickElement({
|
|
||||||
text: enLocaleMessages.endOfFlowMessage10.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const completeImportSRPOnboardingFlowWordByWord = async (
|
const completeImportSRPOnboardingFlowWordByWord = async (
|
||||||
@ -285,19 +250,13 @@ const completeImportSRPOnboardingFlowWordByWord = async (
|
|||||||
seedPhrase,
|
seedPhrase,
|
||||||
password,
|
password,
|
||||||
) => {
|
) => {
|
||||||
// clicks the continue button on the welcome screen
|
// welcome
|
||||||
await driver.findElement('.welcome-page__header');
|
await driver.clickElement('[data-testid="onboarding-import-wallet"]');
|
||||||
await driver.clickElement({
|
|
||||||
text: enLocaleMessages.getStarted.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
|
|
||||||
// clicks the "No thanks" option on the metametrics opt-in screen
|
// metrics
|
||||||
await driver.clickElement('.btn-secondary');
|
await driver.clickElement('[data-testid="metametrics-no-thanks"]');
|
||||||
|
|
||||||
// clicks the "Import Wallet" option
|
|
||||||
await driver.clickElement({ text: 'Import wallet', tag: 'button' });
|
|
||||||
|
|
||||||
|
// import with recovery phrase, word by word
|
||||||
const words = seedPhrase.split(' ');
|
const words = seedPhrase.split(' ');
|
||||||
for (const word of words) {
|
for (const word of words) {
|
||||||
await driver.pasteIntoField(
|
await driver.pasteIntoField(
|
||||||
@ -305,20 +264,20 @@ const completeImportSRPOnboardingFlowWordByWord = async (
|
|||||||
word,
|
word,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
await driver.clickElement('[data-testid="import-srp-confirm"]');
|
||||||
|
|
||||||
await driver.fill('#password', password);
|
// create password
|
||||||
await driver.fill('#confirm-password', password);
|
await driver.fill('[data-testid="create-password-new"]', password);
|
||||||
|
await driver.fill('[data-testid="create-password-confirm"]', password);
|
||||||
|
await driver.clickElement('[data-testid="create-password-terms"]');
|
||||||
|
await driver.clickElement('[data-testid="create-password-import"]');
|
||||||
|
|
||||||
await driver.clickElement('[data-testid="create-new-vault__terms-checkbox"]');
|
// complete
|
||||||
|
await driver.clickElement('[data-testid="onboarding-complete-done"]');
|
||||||
|
|
||||||
await driver.clickElement({ text: 'Import', tag: 'button' });
|
// pin extension
|
||||||
|
await driver.clickElement('[data-testid="pin-extension-next"]');
|
||||||
// clicks through the success screen
|
await driver.clickElement('[data-testid="pin-extension-done"]');
|
||||||
await driver.findElement({ text: 'Congratulations', tag: 'div' });
|
|
||||||
await driver.clickElement({
|
|
||||||
text: enLocaleMessages.endOfFlowMessage10.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -90,94 +90,53 @@ describe('MetaMask', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Going through the first time flow', function () {
|
describe('Going through the first time flow', function () {
|
||||||
it('clicks the continue button on the welcome screen', async function () {
|
it('clicks the "Create New Wallet" button on the welcome screen', async function () {
|
||||||
await driver.findElement('.welcome-page__header');
|
await driver.clickElement('[data-testid="onboarding-create-wallet"]');
|
||||||
await driver.clickElement({
|
|
||||||
text: enLocaleMessages.getStarted.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
await driver.delay(largeDelayMs);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('clicks the "No thanks" option on the metametrics opt-in screen', async function () {
|
it('clicks the "No thanks" option on the metametrics opt-in screen', async function () {
|
||||||
await driver.clickElement('.btn-secondary');
|
await driver.clickElement('[data-testid="metametrics-no-thanks"]');
|
||||||
await driver.delay(largeDelayMs);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('clicks the "Create New Wallet" option', async function () {
|
|
||||||
await driver.clickElement({ text: 'Create a wallet', tag: 'button' });
|
|
||||||
await driver.delay(largeDelayMs);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('accepts a secure password', async function () {
|
it('accepts a secure password', async function () {
|
||||||
await driver.fill(
|
const password = 'correct horse battery staple';
|
||||||
'.first-time-flow__form #create-password',
|
await driver.fill('[data-testid="create-password-new"]', password);
|
||||||
'correct horse battery staple',
|
await driver.fill('[data-testid="create-password-confirm"]', password);
|
||||||
);
|
await driver.clickElement('[data-testid="create-password-terms"]');
|
||||||
await driver.fill(
|
await driver.clickElement('[data-testid="create-password-wallet"]');
|
||||||
'.first-time-flow__form #confirm-password',
|
|
||||||
'correct horse battery staple',
|
|
||||||
);
|
|
||||||
|
|
||||||
await driver.clickElement('.first-time-flow__checkbox');
|
|
||||||
|
|
||||||
await driver.clickElement('.first-time-flow__form button');
|
|
||||||
await driver.delay(regularDelayMs);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let seedPhrase;
|
|
||||||
|
|
||||||
it('renders the Secret Recovery Phrase intro screen', async function () {
|
it('renders the Secret Recovery Phrase intro screen', async function () {
|
||||||
await driver.clickElement('.seed-phrase-intro__left button');
|
await driver.clickElement('[data-testid="secure-wallet-recommended"]');
|
||||||
await driver.delay(regularDelayMs);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let chipTwo, chipThree, chipSeven;
|
||||||
|
|
||||||
it('reveals the Secret Recovery Phrase', async function () {
|
it('reveals the Secret Recovery Phrase', async function () {
|
||||||
const byRevealButton =
|
await driver.clickElement('[data-testid="recovery-phrase-reveal"]');
|
||||||
'.reveal-seed-phrase__secret-blocker .reveal-seed-phrase__reveal-button';
|
chipTwo = await (
|
||||||
await driver.findElement(byRevealButton);
|
await driver.findElement('[data-testid="recovery-phrase-chip-2"]')
|
||||||
await driver.clickElement(byRevealButton);
|
).getText();
|
||||||
await driver.delay(regularDelayMs);
|
chipThree = await (
|
||||||
|
await driver.findElement('[data-testid="recovery-phrase-chip-3"]')
|
||||||
const revealedSeedPhrase = await driver.findElement(
|
).getText();
|
||||||
'.reveal-seed-phrase__secret-words',
|
chipSeven = await (
|
||||||
);
|
await driver.findElement('[data-testid="recovery-phrase-chip-7"]')
|
||||||
seedPhrase = await revealedSeedPhrase.getText();
|
).getText();
|
||||||
assert.equal(seedPhrase.split(' ').length, 12);
|
await driver.clickElement('[data-testid="recovery-phrase-next"]');
|
||||||
await driver.delay(regularDelayMs);
|
|
||||||
|
|
||||||
await driver.clickElement({
|
|
||||||
text: enLocaleMessages.next.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
await driver.delay(regularDelayMs);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
async function clickWordAndWait(word) {
|
|
||||||
await driver.clickElement(
|
|
||||||
`[data-testid="seed-phrase-sorted"] [data-testid="draggable-seed-${word}"]`,
|
|
||||||
);
|
|
||||||
await driver.delay(tinyDelayMs);
|
|
||||||
}
|
|
||||||
|
|
||||||
it('can retype the Secret Recovery Phrase', async function () {
|
it('can retype the Secret Recovery Phrase', async function () {
|
||||||
const words = seedPhrase.split(' ');
|
await driver.fill('[data-testid="recovery-phrase-input-2"]', chipTwo);
|
||||||
|
await driver.fill('[data-testid="recovery-phrase-input-3"]', chipThree);
|
||||||
for (const word of words) {
|
await driver.fill('[data-testid="recovery-phrase-input-7"]', chipSeven);
|
||||||
await clickWordAndWait(word);
|
await driver.clickElement('[data-testid="recovery-phrase-confirm"]');
|
||||||
}
|
|
||||||
|
|
||||||
await driver.clickElement({ text: 'Confirm', tag: 'button' });
|
|
||||||
await driver.delay(regularDelayMs);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('clicks through the success screen', async function () {
|
it('clicks through the success screen', async function () {
|
||||||
await driver.findElement({ text: 'Congratulations', tag: 'div' });
|
await driver.clickElement('[data-testid="onboarding-complete-done"]');
|
||||||
await driver.clickElement({
|
await driver.clickElement('[data-testid="pin-extension-next"]');
|
||||||
text: enLocaleMessages.endOfFlowMessage10.message,
|
await driver.clickElement('[data-testid="pin-extension-done"]');
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
await driver.delay(regularDelayMs);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
const { strict: assert } = require('assert');
|
const { strict: assert } = require('assert');
|
||||||
const { convertToHexValue, withFixtures, tinyDelayMs } = require('../helpers');
|
const { convertToHexValue, withFixtures } = require('../helpers');
|
||||||
const enLocaleMessages = require('../../../app/_locales/en/messages.json');
|
|
||||||
const FixtureBuilder = require('../fixture-builder');
|
const FixtureBuilder = require('../fixture-builder');
|
||||||
|
|
||||||
describe('Incremental Security', function () {
|
describe('Incremental Security', function () {
|
||||||
@ -30,42 +29,40 @@ describe('Incremental Security', function () {
|
|||||||
},
|
},
|
||||||
async ({ driver }) => {
|
async ({ driver }) => {
|
||||||
await driver.navigate();
|
await driver.navigate();
|
||||||
await driver.delay(tinyDelayMs);
|
|
||||||
|
|
||||||
// clicks the continue button on the welcome screen
|
// welcome
|
||||||
await driver.findElement('.welcome-page__header');
|
await driver.clickElement('[data-testid="onboarding-create-wallet"]');
|
||||||
await driver.clickElement({
|
|
||||||
text: enLocaleMessages.getStarted.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
|
|
||||||
// clicks the "No thanks" option on the metametrics opt-in screen
|
// metrics
|
||||||
await driver.clickElement('.btn-secondary');
|
await driver.clickElement('[data-testid="metametrics-no-thanks"]');
|
||||||
|
|
||||||
// clicks the "Create New Wallet" option
|
// create password
|
||||||
await driver.clickElement({ text: 'Create a wallet', tag: 'button' });
|
|
||||||
|
|
||||||
// accepts a secure password
|
|
||||||
await driver.fill(
|
await driver.fill(
|
||||||
'.first-time-flow__form #create-password',
|
'[data-testid="create-password-new"]',
|
||||||
'correct horse battery staple',
|
'correct horse battery staple',
|
||||||
);
|
);
|
||||||
await driver.fill(
|
await driver.fill(
|
||||||
'.first-time-flow__form #confirm-password',
|
'[data-testid="create-password-confirm"]',
|
||||||
'correct horse battery staple',
|
'correct horse battery staple',
|
||||||
);
|
);
|
||||||
await driver.clickElement('.first-time-flow__checkbox');
|
await driver.clickElement('[data-testid="create-password-terms"]');
|
||||||
await driver.clickElement('.first-time-flow__form button');
|
await driver.clickElement('[data-testid="create-password-wallet"]');
|
||||||
|
|
||||||
// renders the Secret Recovery Phrase intro screen'
|
// secure wallet later
|
||||||
await driver.clickElement('.seed-phrase-intro__left button');
|
await driver.clickElement('[data-testid="secure-wallet-later"]');
|
||||||
|
await driver.clickElement(
|
||||||
|
'[data-testid="skip-srp-backup-popover-checkbox"]',
|
||||||
|
);
|
||||||
|
await driver.clickElement('[data-testid="skip-srp-backup"]');
|
||||||
|
|
||||||
// skips the Secret Recovery Phrase challenge
|
// complete
|
||||||
await driver.clickElement({
|
await driver.clickElement('[data-testid="onboarding-complete-done"]');
|
||||||
text: enLocaleMessages.remindMeLater.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
|
|
||||||
|
// pin extension
|
||||||
|
await driver.clickElement('[data-testid="pin-extension-next"]');
|
||||||
|
await driver.clickElement('[data-testid="pin-extension-done"]');
|
||||||
|
|
||||||
|
// open account menu
|
||||||
await driver.clickElement(
|
await driver.clickElement(
|
||||||
'[data-testid="account-options-menu-button"]',
|
'[data-testid="account-options-menu-button"]',
|
||||||
);
|
);
|
||||||
@ -124,41 +121,24 @@ describe('Incremental Security', function () {
|
|||||||
await driver.clickElement('.home-notification__accept-button');
|
await driver.clickElement('.home-notification__accept-button');
|
||||||
|
|
||||||
// reveals the Secret Recovery Phrase
|
// reveals the Secret Recovery Phrase
|
||||||
await driver.clickElement(
|
await driver.clickElement('[data-testid="secure-wallet-recommended"]');
|
||||||
'.reveal-seed-phrase__secret-blocker .reveal-seed-phrase__reveal-button',
|
await driver.clickElement('[data-testid="recovery-phrase-reveal"]');
|
||||||
);
|
const chipTwo = await (
|
||||||
|
await driver.findElement('[data-testid="recovery-phrase-chip-2"]')
|
||||||
const revealedSeedPhrase = await driver.findElement(
|
).getText();
|
||||||
'.reveal-seed-phrase__secret-words',
|
const chipThree = await (
|
||||||
);
|
await driver.findElement('[data-testid="recovery-phrase-chip-3"]')
|
||||||
await driver.waitForNonEmptyElement(revealedSeedPhrase);
|
).getText();
|
||||||
const seedPhrase = await revealedSeedPhrase.getText();
|
const chipSeven = await (
|
||||||
assert.equal(seedPhrase.split(' ').length, 12);
|
await driver.findElement('[data-testid="recovery-phrase-chip-7"]')
|
||||||
|
).getText();
|
||||||
await driver.clickElement({
|
await driver.clickElement('[data-testid="recovery-phrase-next"]');
|
||||||
text: enLocaleMessages.next.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
|
|
||||||
// selecting the words from seedphrase
|
|
||||||
async function clickWordAndWait(word) {
|
|
||||||
await driver.clickElement(
|
|
||||||
`[data-testid="seed-phrase-sorted"] [data-testid="draggable-seed-${word}"]`,
|
|
||||||
);
|
|
||||||
await driver.delay(tinyDelayMs);
|
|
||||||
}
|
|
||||||
|
|
||||||
// can retype the Secret Recovery Phrase
|
// can retype the Secret Recovery Phrase
|
||||||
const words = seedPhrase.split(' ');
|
await driver.fill('[data-testid="recovery-phrase-input-2"]', chipTwo);
|
||||||
|
await driver.fill('[data-testid="recovery-phrase-input-3"]', chipThree);
|
||||||
for (const word of words) {
|
await driver.fill('[data-testid="recovery-phrase-input-7"]', chipSeven);
|
||||||
await clickWordAndWait(word);
|
await driver.clickElement('[data-testid="recovery-phrase-confirm"]');
|
||||||
}
|
|
||||||
|
|
||||||
await driver.clickElement({ text: 'Confirm', tag: 'button' });
|
|
||||||
|
|
||||||
// can click through the success screen
|
|
||||||
await driver.clickElement({ text: 'All done', tag: 'button' });
|
|
||||||
|
|
||||||
// should have the correct amount of eth
|
// should have the correct amount of eth
|
||||||
currencyDisplay = await driver.waitForSelector({
|
currencyDisplay = await driver.waitForSelector({
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
const { strict: assert } = require('assert');
|
const { strict: assert } = require('assert');
|
||||||
const { convertToHexValue, withFixtures, tinyDelayMs } = require('../helpers');
|
const { convertToHexValue, withFixtures } = require('../helpers');
|
||||||
const enLocaleMessages = require('../../../app/_locales/en/messages.json');
|
|
||||||
const FixtureBuilder = require('../fixture-builder');
|
const FixtureBuilder = require('../fixture-builder');
|
||||||
|
|
||||||
describe('MetaMask Responsive UI', function () {
|
describe('MetaMask Responsive UI', function () {
|
||||||
@ -17,127 +16,52 @@ describe('MetaMask Responsive UI', function () {
|
|||||||
async ({ driver }) => {
|
async ({ driver }) => {
|
||||||
await driver.navigate();
|
await driver.navigate();
|
||||||
|
|
||||||
async function clickWordAndWait(word) {
|
// welcome
|
||||||
await driver.clickElement(
|
await driver.clickElement('[data-testid="onboarding-create-wallet"]');
|
||||||
`[data-testid="seed-phrase-sorted"] [data-testid="draggable-seed-${word}"]`,
|
|
||||||
);
|
|
||||||
await driver.delay(tinyDelayMs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.env.ONBOARDING_V2 === '1') {
|
// metrics
|
||||||
// welcome
|
await driver.clickElement('[data-testid="metametrics-no-thanks"]');
|
||||||
await driver.clickElement('[data-testid="onboarding-create-wallet"]');
|
|
||||||
|
|
||||||
// metrics
|
// create password
|
||||||
await driver.clickElement('[data-testid="metametrics-no-thanks"]');
|
await driver.fill(
|
||||||
|
'[data-testid="create-password-new"]',
|
||||||
|
'correct horse battery staple',
|
||||||
|
);
|
||||||
|
await driver.fill(
|
||||||
|
'[data-testid="create-password-confirm"]',
|
||||||
|
'correct horse battery staple',
|
||||||
|
);
|
||||||
|
await driver.clickElement('[data-testid="create-password-terms"]');
|
||||||
|
await driver.clickElement('[data-testid="create-password-wallet"]');
|
||||||
|
|
||||||
// create password
|
// secure wallet
|
||||||
await driver.fill(
|
await driver.clickElement('[data-testid="secure-wallet-recommended"]');
|
||||||
'[data-testid="create-password-new"]',
|
|
||||||
'correct horse battery staple',
|
|
||||||
);
|
|
||||||
await driver.fill(
|
|
||||||
'[data-testid="create-password-confirm"]',
|
|
||||||
'correct horse battery staple',
|
|
||||||
);
|
|
||||||
await driver.clickElement('[data-testid="create-password-terms"]');
|
|
||||||
await driver.clickElement('[data-testid="create-password-wallet"]');
|
|
||||||
|
|
||||||
// secure wallet
|
// review
|
||||||
await driver.clickElement(
|
await driver.clickElement('[data-testid="recovery-phrase-reveal"]');
|
||||||
'[data-testid="secure-wallet-recommended"]',
|
const chipTwo = await (
|
||||||
);
|
await driver.findElement('[data-testid="recovery-phrase-chip-2"]')
|
||||||
|
).getText();
|
||||||
|
const chipThree = await (
|
||||||
|
await driver.findElement('[data-testid="recovery-phrase-chip-3"]')
|
||||||
|
).getText();
|
||||||
|
const chipSeven = await (
|
||||||
|
await driver.findElement('[data-testid="recovery-phrase-chip-7"]')
|
||||||
|
).getText();
|
||||||
|
await driver.clickElement('[data-testid="recovery-phrase-next"]');
|
||||||
|
|
||||||
// review
|
// confirm
|
||||||
await driver.clickElement('[data-testid="recovery-phrase-reveal"]');
|
await driver.fill('[data-testid="recovery-phrase-input-2"]', chipTwo);
|
||||||
const chipTwo = await (
|
await driver.fill('[data-testid="recovery-phrase-input-3"]', chipThree);
|
||||||
await driver.findElement('[data-testid="recovery-phrase-chip-2"]')
|
await driver.fill('[data-testid="recovery-phrase-input-7"]', chipSeven);
|
||||||
).getText();
|
await driver.clickElement('[data-testid="recovery-phrase-confirm"]');
|
||||||
const chipThree = await (
|
|
||||||
await driver.findElement('[data-testid="recovery-phrase-chip-3"]')
|
|
||||||
).getText();
|
|
||||||
const chipSeven = await (
|
|
||||||
await driver.findElement('[data-testid="recovery-phrase-chip-7"]')
|
|
||||||
).getText();
|
|
||||||
await driver.clickElement('[data-testid="recovery-phrase-next"]');
|
|
||||||
|
|
||||||
// confirm
|
// complete
|
||||||
await driver.fill('[data-testid="recovery-phrase-input-2"]', chipTwo);
|
await driver.clickElement('[data-testid="onboarding-complete-done"]');
|
||||||
await driver.fill(
|
|
||||||
'[data-testid="recovery-phrase-input-3"]',
|
|
||||||
chipThree,
|
|
||||||
);
|
|
||||||
await driver.fill(
|
|
||||||
'[data-testid="recovery-phrase-input-7"]',
|
|
||||||
chipSeven,
|
|
||||||
);
|
|
||||||
await driver.clickElement('[data-testid="recovery-phrase-confirm"]');
|
|
||||||
|
|
||||||
// complete
|
// pin extension
|
||||||
await driver.clickElement('[data-testid="onboarding-complete-done"]');
|
await driver.clickElement('[data-testid="pin-extension-next"]');
|
||||||
|
await driver.clickElement('[data-testid="pin-extension-done"]');
|
||||||
// pin extension
|
|
||||||
await driver.clickElement('[data-testid="pin-extension-next"]');
|
|
||||||
await driver.clickElement('[data-testid="pin-extension-done"]');
|
|
||||||
} else {
|
|
||||||
// clicks the continue button on the welcome screen
|
|
||||||
await driver.findElement('.welcome-page__header');
|
|
||||||
await driver.clickElement({
|
|
||||||
text: enLocaleMessages.getStarted.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
await driver.delay(tinyDelayMs);
|
|
||||||
|
|
||||||
// clicks the "I agree" option on the metametrics opt-in screen
|
|
||||||
await driver.clickElement('.btn-primary');
|
|
||||||
|
|
||||||
// clicks the "Create New Wallet" option
|
|
||||||
await driver.clickElement({ text: 'Create a wallet', tag: 'button' });
|
|
||||||
|
|
||||||
// accepts a secure password
|
|
||||||
await driver.fill(
|
|
||||||
'.first-time-flow__form #create-password',
|
|
||||||
'correct horse battery staple',
|
|
||||||
);
|
|
||||||
await driver.fill(
|
|
||||||
'.first-time-flow__form #confirm-password',
|
|
||||||
'correct horse battery staple',
|
|
||||||
);
|
|
||||||
await driver.clickElement('.first-time-flow__checkbox');
|
|
||||||
await driver.clickElement('.first-time-flow__form button');
|
|
||||||
|
|
||||||
// renders the Secret Recovery Phrase intro screen
|
|
||||||
await driver.clickElement('.seed-phrase-intro__left button');
|
|
||||||
|
|
||||||
// reveals the Secret Recovery Phrase
|
|
||||||
await driver.clickElement(
|
|
||||||
'.reveal-seed-phrase__secret-blocker .reveal-seed-phrase__reveal-button',
|
|
||||||
);
|
|
||||||
const revealedSeedPhrase = await driver.findElement(
|
|
||||||
'.reveal-seed-phrase__secret-words',
|
|
||||||
);
|
|
||||||
const seedPhrase = await revealedSeedPhrase.getText();
|
|
||||||
assert.equal(seedPhrase.split(' ').length, 12);
|
|
||||||
|
|
||||||
await driver.clickElement({
|
|
||||||
text: enLocaleMessages.next.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
|
|
||||||
// can retype the Secret Recovery Phrase
|
|
||||||
const words = seedPhrase.split(' ');
|
|
||||||
for (const word of words) {
|
|
||||||
await clickWordAndWait(word);
|
|
||||||
}
|
|
||||||
await driver.clickElement({ text: 'Confirm', tag: 'button' });
|
|
||||||
|
|
||||||
// clicks through the success screen
|
|
||||||
await driver.findElement({ text: 'Congratulations', tag: 'div' });
|
|
||||||
await driver.clickElement({
|
|
||||||
text: enLocaleMessages.endOfFlowMessage10.message,
|
|
||||||
tag: 'button',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// assert balance
|
// assert balance
|
||||||
const balance = await driver.findElement(
|
const balance = await driver.findElement(
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Redirect, Route } from 'react-router-dom';
|
import { Redirect, Route } from 'react-router-dom';
|
||||||
import {
|
import { UNLOCK_ROUTE, ONBOARDING_ROUTE } from '../../constants/routes';
|
||||||
UNLOCK_ROUTE,
|
|
||||||
INITIALIZE_ROUTE,
|
|
||||||
ONBOARDING_ROUTE,
|
|
||||||
} from '../../constants/routes';
|
|
||||||
|
|
||||||
export default function Authenticated(props) {
|
export default function Authenticated(props) {
|
||||||
const { isUnlocked, completedOnboarding } = props;
|
const { isUnlocked, completedOnboarding } = props;
|
||||||
@ -16,9 +12,7 @@ export default function Authenticated(props) {
|
|||||||
return (
|
return (
|
||||||
<Redirect
|
<Redirect
|
||||||
to={{
|
to={{
|
||||||
pathname: process.env.ONBOARDING_V2
|
pathname: ONBOARDING_ROUTE,
|
||||||
? ONBOARDING_ROUTE
|
|
||||||
: INITIALIZE_ROUTE,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Redirect, Route } from 'react-router-dom';
|
import { Redirect, Route } from 'react-router-dom';
|
||||||
import { INITIALIZE_ROUTE, ONBOARDING_ROUTE } from '../../constants/routes';
|
import { ONBOARDING_ROUTE } from '../../constants/routes';
|
||||||
|
|
||||||
export default function Initialized(props) {
|
export default function Initialized(props) {
|
||||||
return props.completedOnboarding ? (
|
return props.completedOnboarding ? (
|
||||||
@ -9,9 +9,7 @@ export default function Initialized(props) {
|
|||||||
) : (
|
) : (
|
||||||
<Redirect
|
<Redirect
|
||||||
to={{
|
to={{
|
||||||
pathname: process.env.ONBOARDING_V2
|
pathname: ONBOARDING_ROUTE,
|
||||||
? ONBOARDING_ROUTE
|
|
||||||
: INITIALIZE_ROUTE,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -36,7 +36,6 @@ import {
|
|||||||
RESTORE_VAULT_ROUTE,
|
RESTORE_VAULT_ROUTE,
|
||||||
CONFIRM_TRANSACTION_ROUTE,
|
CONFIRM_TRANSACTION_ROUTE,
|
||||||
CONFIRM_ADD_SUGGESTED_TOKEN_ROUTE,
|
CONFIRM_ADD_SUGGESTED_TOKEN_ROUTE,
|
||||||
INITIALIZE_BACKUP_SEED_PHRASE_ROUTE,
|
|
||||||
CONNECT_ROUTE,
|
CONNECT_ROUTE,
|
||||||
CONNECTED_ROUTE,
|
CONNECTED_ROUTE,
|
||||||
CONNECTED_ACCOUNTS_ROUTE,
|
CONNECTED_ACCOUNTS_ROUTE,
|
||||||
@ -415,9 +414,7 @@ export default class Home extends PureComponent {
|
|||||||
descriptionText={t('backupApprovalNotice')}
|
descriptionText={t('backupApprovalNotice')}
|
||||||
acceptText={t('backupNow')}
|
acceptText={t('backupNow')}
|
||||||
onAccept={() => {
|
onAccept={() => {
|
||||||
const backUpSRPRoute = process.env.ONBOARDING_V2
|
const backUpSRPRoute = `${ONBOARDING_SECURE_YOUR_WALLET_ROUTE}/?isFromReminder=true`;
|
||||||
? `${ONBOARDING_SECURE_YOUR_WALLET_ROUTE}/?isFromReminder=true`
|
|
||||||
: INITIALIZE_BACKUP_SEED_PHRASE_ROUTE;
|
|
||||||
if (isPopup) {
|
if (isPopup) {
|
||||||
global.platform.openExtensionInBrowser(backUpSRPRoute);
|
global.platform.openExtensionInBrowser(backUpSRPRoute);
|
||||||
} else {
|
} else {
|
||||||
|
@ -174,9 +174,7 @@ export default class Routes extends Component {
|
|||||||
|
|
||||||
const routes = (
|
const routes = (
|
||||||
<Switch>
|
<Switch>
|
||||||
{process.env.ONBOARDING_V2 && (
|
<Route path={ONBOARDING_ROUTE} component={OnboardingFlow} />
|
||||||
<Route path={ONBOARDING_ROUTE} component={OnboardingFlow} />
|
|
||||||
)}
|
|
||||||
<Route path={LOCK_ROUTE} component={Lock} exact />
|
<Route path={LOCK_ROUTE} component={Lock} exact />
|
||||||
<Route path={INITIALIZE_ROUTE} component={FirstTimeFlow} />
|
<Route path={INITIALIZE_ROUTE} component={FirstTimeFlow} />
|
||||||
<Initialized path={UNLOCK_ROUTE} component={UnlockPage} exact />
|
<Initialized path={UNLOCK_ROUTE} component={UnlockPage} exact />
|
||||||
@ -307,7 +305,7 @@ export default class Routes extends Component {
|
|||||||
|
|
||||||
const isInitializing = Boolean(
|
const isInitializing = Boolean(
|
||||||
matchPath(location.pathname, {
|
matchPath(location.pathname, {
|
||||||
path: process.env.ONBOARDING_V2 ? ONBOARDING_ROUTE : INITIALIZE_ROUTE,
|
path: ONBOARDING_ROUTE,
|
||||||
exact: false,
|
exact: false,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@ -436,9 +434,7 @@ export default class Routes extends Component {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{process.env.ONBOARDING_V2 && this.showOnboardingHeader() && (
|
{this.showOnboardingHeader() && <OnboardingAppHeader />}
|
||||||
<OnboardingAppHeader />
|
|
||||||
)}
|
|
||||||
{completedOnboarding ? <NetworkDropdown /> : null}
|
{completedOnboarding ? <NetworkDropdown /> : null}
|
||||||
<AccountMenu />
|
<AccountMenu />
|
||||||
<div className="main-container-wrapper">
|
<div className="main-container-wrapper">
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import {
|
import {
|
||||||
INITIALIZE_CREATE_PASSWORD_ROUTE,
|
|
||||||
INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE,
|
|
||||||
DEFAULT_ROUTE,
|
DEFAULT_ROUTE,
|
||||||
ONBOARDING_CREATE_PASSWORD_ROUTE,
|
ONBOARDING_CREATE_PASSWORD_ROUTE,
|
||||||
ONBOARDING_IMPORT_WITH_SRP_ROUTE,
|
ONBOARDING_IMPORT_WITH_SRP_ROUTE,
|
||||||
@ -11,13 +9,9 @@ export function getFirstTimeFlowTypeRoute(state) {
|
|||||||
|
|
||||||
let nextRoute;
|
let nextRoute;
|
||||||
if (firstTimeFlowType === 'create') {
|
if (firstTimeFlowType === 'create') {
|
||||||
nextRoute = process.env.ONBOARDING_V2
|
nextRoute = ONBOARDING_CREATE_PASSWORD_ROUTE;
|
||||||
? ONBOARDING_CREATE_PASSWORD_ROUTE
|
|
||||||
: INITIALIZE_CREATE_PASSWORD_ROUTE;
|
|
||||||
} else if (firstTimeFlowType === 'import') {
|
} else if (firstTimeFlowType === 'import') {
|
||||||
nextRoute = process.env.ONBOARDING_V2
|
nextRoute = ONBOARDING_IMPORT_WITH_SRP_ROUTE;
|
||||||
? ONBOARDING_IMPORT_WITH_SRP_ROUTE
|
|
||||||
: INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE;
|
|
||||||
} else {
|
} else {
|
||||||
nextRoute = DEFAULT_ROUTE;
|
nextRoute = DEFAULT_ROUTE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user