refactor account details test to use fixtures (#11926)

feature/default_network_editable
PeterYinusa 3 years ago committed by GitHub
parent 9b6acb7370
commit f4d93776d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      test/e2e/metamask-ui.spec.js
  2. 38
      test/e2e/tests/account-details.spec.js

@ -187,25 +187,6 @@ describe('MetaMask', function () {
}); });
}); });
describe('Show account information', function () {
it('shows the QR code for the account', async function () {
await driver.clickElement('[data-testid="account-options-menu-button"]');
await driver.clickElement(
'[data-testid="account-options-menu__account-details"]',
);
await driver.findVisibleElement('.qr-code__wrapper');
await driver.delay(regularDelayMs);
// wait for permission modal to be visible.
const permissionModal = await driver.findVisibleElement('span .modal');
await driver.clickElement('.account-modal__close');
// wait for permission modal to be removed from DOM.
await permissionModal.waitForElementState('hidden');
await driver.delay(regularDelayMs);
});
});
describe('Import Secret Recovery Phrase', function () { describe('Import Secret Recovery Phrase', function () {
it('logs out of the vault', async function () { it('logs out of the vault', async function () {
await driver.clickElement('.account-menu__icon'); await driver.clickElement('.account-menu__icon');

@ -0,0 +1,38 @@
const { strict: assert } = require('assert');
const { withFixtures } = require('../helpers');
describe('Show account details', function () {
const ganacheOptions = {
accounts: [
{
secretKey:
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',
balance: 25000000000000000000,
},
],
};
it('should show the QR code for the account', async function () {
await withFixtures(
{
fixtures: 'imported-account',
ganacheOptions,
title: this.test.title,
},
async ({ driver }) => {
await driver.navigate();
await driver.fill('#password', 'correct horse battery staple');
await driver.press('#password', driver.Key.ENTER);
await driver.clickElement(
'[data-testid="account-options-menu-button"]',
);
await driver.clickElement(
'[data-testid="account-options-menu__account-details"]',
);
const qrCode = await driver.findElement('.qr-code__wrapper');
assert.equal(await qrCode.isDisplayed(), true);
},
);
});
});
Loading…
Cancel
Save