aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-11-07 08:08:23 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-11-07 08:08:23 +0800
commit6daf74925189cb05a656bdd4d361beebf235be85 (patch)
tree79bb65fc10c46111a847e4e32681edd7dc43d7a9 /test/e2e
parent5272073f4f3e787cec516a2b41ef463d0b37826d (diff)
downloadtangerine-wallet-browser-6daf74925189cb05a656bdd4d361beebf235be85.tar.gz
tangerine-wallet-browser-6daf74925189cb05a656bdd4d361beebf235be85.tar.zst
tangerine-wallet-browser-6daf74925189cb05a656bdd4d361beebf235be85.zip
update drizzle tests
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/beta/drizzle.spec.js25
1 files changed, 20 insertions, 5 deletions
diff --git a/test/e2e/beta/drizzle.spec.js b/test/e2e/beta/drizzle.spec.js
index ff4b4b74d..e6317c762 100644
--- a/test/e2e/beta/drizzle.spec.js
+++ b/test/e2e/beta/drizzle.spec.js
@@ -19,6 +19,7 @@ const {
openNewPage,
verboseReportOnFailure,
waitUntilXWindowHandles,
+ switchToWindowWithTitle,
} = require('./helpers')
describe('MetaMask', function () {
@@ -266,17 +267,31 @@ describe('MetaMask', function () {
})
describe('Drizzle', () => {
- it('should be able to detect our eth address', async () => {
+ let windowHandles
+ let extension
+ let popup
+ let dapp
+
+ it('be able to connect the account', async () => {
await openNewPage(driver, 'http://127.0.0.1:3000/')
await delay(regularDelayMs)
- await waitUntilXWindowHandles(driver, 2)
- const windowHandles = await driver.getAllWindowHandles()
- const dapp = windowHandles[1]
+ await waitUntilXWindowHandles(driver, 3)
+ windowHandles = await driver.getAllWindowHandles()
+
+ extension = windowHandles[0]
+ popup = await switchToWindowWithTitle(driver, 'MetaMask Notification', windowHandles)
+ dapp = windowHandles.find(handle => handle !== extension && handle !== popup)
- await driver.switchTo().window(dapp)
await delay(regularDelayMs)
+ const approveButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Connect')]`))
+ await approveButton.click()
+ })
+ it('should be able to detect our eth address', async () => {
+ // Check if address exposed
+ await driver.switchTo().window(dapp)
+ await delay(regularDelayMs)
const addressElement = await findElement(driver, By.css(`.pure-u-1-1 h4`))
const addressText = await addressElement.getText()