aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/beta/from-import-beta-ui.spec.js29
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js25
-rw-r--r--test/e2e/func.js2
-rw-r--r--test/e2e/metamask.spec.js25
4 files changed, 59 insertions, 22 deletions
diff --git a/test/e2e/beta/from-import-beta-ui.spec.js b/test/e2e/beta/from-import-beta-ui.spec.js
index efae948f9..823c72a3a 100644
--- a/test/e2e/beta/from-import-beta-ui.spec.js
+++ b/test/e2e/beta/from-import-beta-ui.spec.js
@@ -134,19 +134,32 @@ describe('Using MetaMask with an existing account', function () {
await delay(regularDelayMs)
})
+ it('clicks through the ToS', async () => {
+ // terms of use
+ const canClickThrough = await driver.findElement(By.css('.tou 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('.tou button'))
+ await acceptTos.click()
+ await delay(regularDelayMs)
+ })
+
it('clicks through the privacy notice', async () => {
- const [nextScreen] = await findElements(driver, By.css('.tou button'))
+ // privacy notice
+ const nextScreen = await findElement(driver, By.css('.tou button'))
await nextScreen.click()
await delay(regularDelayMs)
+ })
- const canClickThrough = await driver.findElement(By.css('.tou button')).isEnabled()
- assert.equal(canClickThrough, false, 'disabled continue button')
- const element = await findElement(driver, By.linkText('Attributions'))
- await driver.executeScript('arguments[0].scrollIntoView(true)', element)
+ 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 acceptTos = await findElement(driver, By.xpath(`//button[contains(text(), 'Accept')]`))
- await acceptTos.click()
+ const nextScreen = await findElement(driver, By.css('.tou button'))
+ await nextScreen.click()
await delay(regularDelayMs)
})
})
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index ceeea31a5..d911b91ed 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -128,22 +128,35 @@ describe('MetaMask', function () {
await delay(regularDelayMs)
})
- it('clicks through the privacy notice', async () => {
- const nextScreen = await findElement(driver, By.css('.tou button'))
- await nextScreen.click()
- await delay(regularDelayMs)
-
+ it('clicks through the ToS', async () => {
+ // terms of use
const canClickThrough = await driver.findElement(By.css('.tou 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('.tou button'))
await acceptTos.click()
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)
+ })
+
let seedPhrase
it('reveals the seed phrase', async () => {
diff --git a/test/e2e/func.js b/test/e2e/func.js
index 9f06e7f37..7b1730959 100644
--- a/test/e2e/func.js
+++ b/test/e2e/func.js
@@ -21,7 +21,7 @@ function delay (time) {
}
function buildChromeWebDriver (extPath) {
- const tmpProfile = path.join(os.tmpdir(), fs.mkdtempSync('mm-chrome-profile'));
+ const tmpProfile = fs.mkdtempSync(path.join(os.tmpdir(), 'mm-chrome-profile'))
return new webdriver.Builder()
.withCapabilities({
chromeOptions: {
diff --git a/test/e2e/metamask.spec.js b/test/e2e/metamask.spec.js
index a08a34d96..b0a8fe411 100644
--- a/test/e2e/metamask.spec.js
+++ b/test/e2e/metamask.spec.js
@@ -71,13 +71,6 @@ describe('Metamask popup page', function () {
it('matches MetaMask title', async () => {
const title = await driver.getTitle()
assert.equal(title, 'MetaMask', 'title matches MetaMask')
- })
-
- it('shows privacy notice', async () => {
- await delay(300)
- const privacy = await driver.findElement(By.css('.terms-header')).getText()
- assert.equal(privacy, 'PRIVACY NOTICE', 'shows privacy notice')
- await driver.findElement(By.css('button')).click()
await delay(300)
})
@@ -100,6 +93,24 @@ describe('Metamask popup page', function () {
await button.click()
})
+ it('shows privacy notice', async () => {
+ const privacy = await driver.findElement(By.css('.terms-header')).getText()
+ assert.equal(privacy, 'PRIVACY NOTICE', 'shows privacy notice')
+ await driver.findElement(By.css('button')).click()
+ await delay(300)
+ })
+
+ it('shows phishing notice', async () => {
+ await delay(300)
+ const noticeHeader = await driver.findElement(By.css('.terms-header')).getText()
+ assert.equal(noticeHeader, 'PHISHING WARNING', 'shows phishing warning')
+ const element = await driver.findElement(By.css('.markdown'))
+ await driver.executeScript('arguments[0].scrollTop = arguments[0].scrollHeight', element)
+ await delay(300)
+ await driver.findElement(By.css('button')).click()
+ await delay(300)
+ })
+
it('accepts password with length of eight', async () => {
const passwordBox = await driver.findElement(By.id('password-box'))
const passwordBoxConfirm = await driver.findElement(By.id('password-box-confirm'))