1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

test - e2e-beta - from import - handle phishing warning

This commit is contained in:
kumavis 2018-06-14 00:52:46 -07:00
parent e95fed06b7
commit c2afb79035

View File

@ -134,21 +134,34 @@ describe('Using MetaMask with an existing account', function () {
await delay(regularDelayMs) await delay(regularDelayMs)
}) })
it('clicks through the privacy notice', async () => { it('clicks through the ToS', async () => {
const [nextScreen] = await findElements(driver, By.css('.tou button')) // terms of use
await nextScreen.click()
await delay(regularDelayMs)
const canClickThrough = await driver.findElement(By.css('.tou button')).isEnabled() const canClickThrough = await driver.findElement(By.css('.tou button')).isEnabled()
assert.equal(canClickThrough, false, 'disabled continue button') assert.equal(canClickThrough, false, 'disabled continue button')
const element = await findElement(driver, By.linkText('Attributions')) const bottomOfTos = await findElement(driver, By.linkText('Attributions'))
await driver.executeScript('arguments[0].scrollIntoView(true)', element) await driver.executeScript('arguments[0].scrollIntoView(true)', bottomOfTos)
await delay(regularDelayMs) await delay(regularDelayMs)
const acceptTos = await findElement(driver, By.css('.tou button'))
const acceptTos = await findElement(driver, By.xpath(`//button[contains(text(), 'Accept')]`))
await acceptTos.click() await acceptTos.click()
await delay(regularDelayMs) await delay(regularDelayMs)
}) })
it('clicks through the privacy notice', async () => {
// privacy notice
const nextScreen = await findElement(driver, By.css('.tou button'))
await nextScreen.click()
await delay(regularDelayMs)
})
it('clicks through the phishing notice', async () => {
// phishing notice
const noticeElement = await driver.findElement(By.css('.markdown'))
await driver.executeScript('arguments[0].scrollTop = arguments[0].scrollHeight', noticeElement)
await delay(regularDelayMs)
const nextScreen = await findElement(driver, By.css('.tou button'))
await nextScreen.click()
await delay(regularDelayMs)
})
}) })
describe('Show account information', () => { describe('Show account information', () => {