aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2019-05-16 00:40:11 +0800
committerGitHub <noreply@github.com>2019-05-16 00:40:11 +0800
commitc043132b00801f81d467748bebe147cae6893719 (patch)
tree6aaabe61b00214f549a97b917a0eefde152f7ade
parentd6a1c2a3b8e690b0a8a0f7a5feeca7bfeb4e3a2d (diff)
downloadtangerine-wallet-browser-c043132b00801f81d467748bebe147cae6893719.tar
tangerine-wallet-browser-c043132b00801f81d467748bebe147cae6893719.tar.gz
tangerine-wallet-browser-c043132b00801f81d467748bebe147cae6893719.tar.bz2
tangerine-wallet-browser-c043132b00801f81d467748bebe147cae6893719.tar.lz
tangerine-wallet-browser-c043132b00801f81d467748bebe147cae6893719.tar.xz
tangerine-wallet-browser-c043132b00801f81d467748bebe147cae6893719.tar.zst
tangerine-wallet-browser-c043132b00801f81d467748bebe147cae6893719.zip
Adds e2e test for removing imported accounts. (#6615)
-rw-r--r--app/_locales/en/messages.json2
-rw-r--r--test/e2e/beta/from-import-beta-ui.spec.js55
2 files changed, 54 insertions, 3 deletions
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json
index bef278f79..47c1cfde8 100644
--- a/app/_locales/en/messages.json
+++ b/app/_locales/en/messages.json
@@ -1249,7 +1249,7 @@
"message": "Revert"
},
"remove": {
- "message": "remove"
+ "message": "Remove"
},
"removeAccount": {
"message": "Remove account"
diff --git a/test/e2e/beta/from-import-beta-ui.spec.js b/test/e2e/beta/from-import-beta-ui.spec.js
index a913caa79..625330dbb 100644
--- a/test/e2e/beta/from-import-beta-ui.spec.js
+++ b/test/e2e/beta/from-import-beta-ui.spec.js
@@ -27,6 +27,8 @@ describe('Using MetaMask with an existing account', function () {
const testSeedPhrase = 'forum vessel pink push lonely enact gentle tail admit parrot grunt dress'
const testAddress = '0x0Cc5261AB8cE458dc977078A3623E2BaDD27afD3'
const testPrivateKey2 = '14abe6f4aab7f9f626fe981c864d0adeb5685f289ac9270c27b8fd790b4235d6'
+ const testPrivateKey3 = 'F4EC2590A0C10DE95FBF4547845178910E40F5035320C516A18C117DE02B5669'
+ const tinyDelayMs = 200
const regularDelayMs = 1000
const largeDelayMs = regularDelayMs * 2
@@ -323,11 +325,60 @@ describe('Using MetaMask with an existing account', function () {
})
})
- describe('Connects to a Hardware wallet', () => {
- it('choose Connect Hardware Wallet from the account menu', async () => {
+ describe('Imports and removes an account', () => {
+ it('choose Create Account from the account menu', async () => {
await driver.findElement(By.css('.account-menu__icon')).click()
await delay(regularDelayMs)
+ const [importAccount] = await findElements(driver, By.xpath(`//div[contains(text(), 'Import Account')]`))
+ await importAccount.click()
+ await delay(regularDelayMs)
+ })
+
+ it('enter private key', async () => {
+ const privateKeyInput = await findElement(driver, By.css('#private-key-box'))
+ await privateKeyInput.sendKeys(testPrivateKey3)
+ await delay(regularDelayMs)
+ const importButtons = await findElements(driver, By.xpath(`//button[contains(text(), 'Import')]`))
+ await importButtons[0].click()
+ await delay(regularDelayMs)
+ })
+
+ it('should open the remove account modal', async () => {
+ const [accountName] = await findElements(driver, By.css('.account-name'))
+ assert.equal(await accountName.getText(), 'Account 5')
+ await delay(regularDelayMs)
+
+ await driver.findElement(By.css('.account-menu__icon')).click()
+ await delay(regularDelayMs)
+
+ const accountListItems = await findElements(driver, By.css('.account-menu__account'))
+ assert.equal(accountListItems.length, 5)
+
+ const removeAccountIcons = await findElements(driver, By.css('.remove-account-icon'))
+ await removeAccountIcons[1].click()
+ await delay(tinyDelayMs)
+
+ await findElement(driver, By.css('.confirm-remove-account__account'))
+ })
+
+ it('should remove the account', async () => {
+ const removeButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Remove')]`))
+ await removeButton.click()
+
+ await delay(regularDelayMs)
+
+ const [accountName] = await findElements(driver, By.css('.account-name'))
+ assert.equal(await accountName.getText(), 'Account 1')
+ await delay(regularDelayMs)
+
+ const accountListItems = await findElements(driver, By.css('.account-menu__account'))
+ assert.equal(accountListItems.length, 4)
+ })
+ })
+
+ describe('Connects to a Hardware wallet', () => {
+ it('choose Connect Hardware Wallet from the account menu', async () => {
const [connectAccount] = await findElements(driver, By.xpath(`//div[contains(text(), 'Connect Hardware Wallet')]`))
await connectAccount.click()
await delay(regularDelayMs)