Skip to content

Commit

Permalink
Merge pull request #176 from dennis00010011b/e2e-poa-autodetect
Browse files Browse the repository at this point in the history
e2e tests for  autodetect tokens in Mainnet and Poa
  • Loading branch information
vbaranov authored Oct 31, 2018
2 parents 563555f + 731095d commit c5cf07d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 25 additions & 3 deletions test/e2e/metamask.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Metamask popup page', async function () {
})

after(async function () {
await driver.quit()
// await driver.quit()
})

describe('Setup', async function () {
Expand Down Expand Up @@ -237,6 +237,7 @@ describe('Metamask popup page', async function () {
describe('Import Account', () => {

it('opens import account menu', async function () {
await setProvider(NETWORKS.POA)
const menu = await waitUntilShowUp(menus.account.menu)
await menu.click()
const item = await waitUntilShowUp(menus.account.import)
Expand All @@ -248,19 +249,40 @@ describe('Metamask popup page', async function () {
it('imports account', async function () {
await delay(2000)
const privateKeyBox = await waitUntilShowUp(screens.importAccounts.fieldPrivateKey)
await privateKeyBox.sendKeys('c6b81c1252415d1acfda94474ab8f662a44c045f96749c805ff12a6074081586')// demo private key
await privateKeyBox.sendKeys('76bd0ced0a47055bb5d060e1ae4a8cb3ece658d668823e250dae6e79d3ab4435')// 0xf4702CbA917260b2D6731Aea6385215073e8551b
const button = await waitUntilShowUp(screens.importAccounts.buttonImport)
await click(button)
assert.equal(await button.getText(), 'Import', 'button has incorrect name')
const menu = await waitUntilShowUp(menus.account.menu)
await menu.click()
const importedLabel = await waitUntilShowUp(menus.account.labelImported)
assert.equal(await importedLabel.getText(), 'IMPORTED')

await menu.click()
})

it('Auto-detect tokens for POA core network ', async function () {
// await setProvider(NETWORKS.POA)
const tab = await waitUntilShowUp(screens.main.tokens.menu)
await tab.click()
const balance = await waitUntilShowUp(screens.main.tokens.balance)
console.log(await balance.getText())
assert.equal(await balance.getText(), '1 DOPR', 'token isnt\' auto-detected')
})

it.skip('Auto-detect tokens for MAIN core network ', async function () {
await setProvider(NETWORKS.MAINNET)
const balance = await waitUntilShowUp(screens.main.tokens.balance)
console.log(await balance.getText())
assert.equal(await balance.getText(), '0.001 WETH', 'token isnt\' auto-detected')
})

it('opens delete imported account screen', async function () {
const menu = await waitUntilShowUp(menus.account.delete)
await setProvider(NETWORKS.LOCALHOST)
const menu = await waitUntilShowUp(menus.account.menu)
await menu.click()
const item = await waitUntilShowUp(menus.account.delete)
await item.click()
const deleteImportedAccountTitle = await waitUntilShowUp(screens.deleteImportedAccount.title)
assert.equal(await deleteImportedAccountTitle.getText(), screens.deleteImportedAccount.titleText)
})
Expand Down

0 comments on commit c5cf07d

Please sign in to comment.