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

First time flow updates #6192

Merged
merged 16 commits into from
Feb 27, 2019
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
65 changes: 64 additions & 1 deletion app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@
"advanced": {
"message": "Advanced"
},
"agreeTermsOfService": {
"message": "I agree to the Terms of Service"
},
"allDone": {
"message": "All Done"
},
"alreadyHaveSeedPhrase": {
"message": "No, I already have a seed phrase"
},
"amount": {
"message": "Amount"
},
Expand Down Expand Up @@ -239,6 +248,9 @@
"confirmTransaction": {
"message": "Confirm Transaction"
},
"congratulations": {
"message": "Congratulations"
},
"connectHardwareWallet": {
"message": "Connect Hardware Wallet"
},
Expand Down Expand Up @@ -326,6 +338,9 @@
"createAccount": {
"message": "Create Account"
},
"createAWallet": {
"message": "Create a Wallet"
},
"createDen": {
"message": "Create"
},
Expand Down Expand Up @@ -448,6 +463,24 @@
"encryptNewDen": {
"message": "Encrypt your new DEN"
},
"endOfFlowMessage1": {
"message": "You passed the test - keep your seedphrase safe, it's your responsibility!"
},
"endOfFlowMessage2": {
"message": "Tips on storing it safely"
},
"endOfFlowMessage3": {
"message": "Save a backup in multiple places"
},
"endOfFlowMessage4": {
"message": "Never tell anyone"
},
"endOfFlowMessage5": {
"message": "If you need to back your seed phrase again, you can find it in Settings -> Security."
},
"endOfFlowMessage6": {
"message": "MetaMask cannot recover your seedphrase. Learn more."
},
"ensNameNotFound": {
"message": "ENS name not found"
},
Expand Down Expand Up @@ -581,10 +614,16 @@
"getHelp": {
"message": "Get Help."
},
"getStarted": {
"message": "Get Started"
},
"greaterThanMin": {
"message": "must be greater than or equal to $1.",
"description": "helper for inputting hex as decimal input"
},
"happyToSeeYou": {
"message": "We’re happy to see you."
},
"hardware": {
"message": "hardware"
},
Expand Down Expand Up @@ -647,6 +686,9 @@
"importDen": {
"message": "Import Existing DEN"
},
"importWallet": {
"message": "Import Wallet"
},
"imported": {
"message": "Imported",
"description": "status showing that an account has been fully loaded into the keyring"
Expand Down Expand Up @@ -731,6 +773,9 @@
"message": "must be less than or equal to $1.",
"description": "helper for inputting hex as decimal input"
},
"letsGoSetUp": {
"message": "Yes, let’s get set up!"
},
"likeToAddTokens": {
"message": "Would you like to add these tokens?"
},
Expand Down Expand Up @@ -777,7 +822,7 @@
"message": "Message"
},
"metamaskDescription": {
"message": "MetaMask is a secure identity vault for Ethereum."
"message": "Connecting you to Ethereum and the Decentralized Web."
},
"metamaskSeedWords": {
"message": "MetaMask Seed Words"
Expand Down Expand Up @@ -848,6 +893,21 @@
"newNetwork": {
"message": "New Network"
},
"newToMetaMask": {
"message": "New to MetaMask?"
},
"noAlreadyHaveSeed": {
"message": "No, I already have a seed phrase"
},
"protectYourKeys": {
"message": "Protect Your Keys!"
},
"protectYourKeysMessage1": {
"message": "Be careful with your seed phrase — there have been reports of websites that attempt to imitate MetaMask. MetaMask will never ask for your seed phrase!"
},
"protectYourKeysMessage2": {
"message": "Keep your phrase safe. If you see something fishy, or you’re uncertain about a website, email support@metamask.io"
},
"rpcURL": {
"message": "New RPC URL"
},
Expand Down Expand Up @@ -1603,6 +1663,9 @@
"yourUniqueAccountImageDescription2": {
"message": "You’ll see this image everytime you need to confirm a transaction."
},
"yourUniqueAccountImageDescription3": {
"message": "MetaMask will never ask for your seed phrase!"
},
"zeroGasPriceOnSpeedUpError": {
"message":"Zero gas price on speed up"
}
Expand Down
5 changes: 5 additions & 0 deletions app/images/download-alt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/images/sleuth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/images/thin-plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 22 additions & 30 deletions test/e2e/beta/from-import-beta-ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ describe('Using MetaMask with an existing account', function () {

beforeEach(async function () {
await driver.executeScript(
'window.origFetch = window.fetch.bind(window);' +
'window.fetch = ' +
'(...args) => { ' +
'if (args[0] === "https://ethgasstation.info/json/ethgasAPI.json") { return ' +
'Promise.resolve({ json: () => Promise.resolve(JSON.parse(\'' + fetchMockResponses.ethGasBasic + '\')) }); } else if ' +
'(args[0] === "https://ethgasstation.info/json/predictTable.json") { return ' +
'Promise.resolve({ json: () => Promise.resolve(JSON.parse(\'' + fetchMockResponses.ethGasPredictTable + '\')) }); } ' +
'return window.fetch(...args); }'
'Promise.resolve({ json: () => Promise.resolve(JSON.parse(\'' + fetchMockResponses.ethGasPredictTable + '\')) }); } else if ' +
'(args[0] === "https://dev.blockscale.net/api/gasexpress.json") { return ' +
'Promise.resolve({ json: () => Promise.resolve(JSON.parse(\'' + fetchMockResponses.gasExpress + '\')) }); } ' +
'return window.origFetch(...args); }'
)
})

Expand All @@ -95,16 +98,19 @@ describe('Using MetaMask with an existing account', function () {

describe('First time flow starting from an existing seed phrase', () => {
it('clicks the continue button on the welcome screen', async () => {
const welcomeScreenBtn = await findElement(driver, By.css('.welcome-page .first-time-flow__button'))
await findElement(driver, By.css('.welcome-page__header'))
const welcomeScreenBtn = await findElement(driver, By.css('.first-time-flow__button'))
welcomeScreenBtn.click()
await delay(largeDelayMs)
})

it('imports a seed phrase', async () => {
const [seedPhrase] = await findElements(driver, By.xpath(`//a[contains(text(), 'Import with seed phrase')]`))
await seedPhrase.click()
await delay(regularDelayMs)
it('clicks the "Import Wallet" option', async () => {
const customRpcButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Import Wallet')]`))
customRpcButton.click()
await delay(largeDelayMs)
})

it('imports a seed phrase', async () => {
const [seedTextArea] = await findElements(driver, By.css('textarea.first-time-flow__textarea'))
await seedTextArea.sendKeys(testSeedPhrase)
await delay(regularDelayMs)
Expand All @@ -114,39 +120,25 @@ describe('Using MetaMask with an existing account', function () {
const [confirmPassword] = await findElements(driver, By.id('confirm-password'))
confirmPassword.sendKeys('correct horse battery staple')

const tosCheckBox = await findElement(driver, By.css('.first-time-flow__checkbox'))
await tosCheckBox.click()

const [importButton] = await findElements(driver, By.xpath(`//button[contains(text(), 'Import')]`))
await importButton.click()
await delay(regularDelayMs)
})

it('clicks through the ToS', async () => {
// terms of use
await findElement(driver, By.css('.first-time-flow__markdown'))
const canClickThrough = await driver.findElement(By.css('button.first-time-flow__button')).isEnabled()
assert.equal(canClickThrough, false, 'disabled continue button')
const bottomOfTos = await findElement(driver, By.linkText('Attributions'))
await driver.executeScript('arguments[0].scrollIntoView(true)', bottomOfTos)
await delay(regularDelayMs)
const acceptTos = await findElement(driver, By.css('button.first-time-flow__button'))
driver.wait(until.elementIsEnabled(acceptTos))
await acceptTos.click()
await delay(regularDelayMs)
})

it('clicks through the privacy notice', async () => {
// privacy notice
it('clicks through the security warning screen', async () => {
await findElement(driver, By.xpath(`//div[contains(text(), 'Protect Your Keys!')]`))
const nextScreen = await findElement(driver, By.css('button.first-time-flow__button'))
await nextScreen.click()
await delay(regularDelayMs)
})

it('clicks through the phishing notice', async () => {
// phishing notice
const noticeElement = await driver.findElement(By.css('.first-time-flow__markdown'))
await driver.executeScript('arguments[0].scrollTop = arguments[0].scrollHeight', noticeElement)
await delay(regularDelayMs)
const nextScreen = await findElement(driver, By.css('button.first-time-flow__button'))
await nextScreen.click()
it('clicks through the success screen', async () => {
await findElement(driver, By.xpath(`//div[contains(text(), 'Congratulations')]`))
const doneButton = await findElement(driver, By.css('button.first-time-flow__button'))
await doneButton.click()
await delay(regularDelayMs)
})
})
Expand Down
Loading