Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Commit

Permalink
Re-arrange transaction navigation test actions (MetaMask#7806)
Browse files Browse the repository at this point in the history
These tests were updated in MetaMask#7473 to navigate in a different order,
because the transaction order changed. Unfortunately this meant that
a second contract deployment was being confirmed, where it was
previously being rejected.

This updates the test to ensure the same transaction is rejected and
confirmed as prior to the change in MetaMask#7473
  • Loading branch information
Gudahtt authored and yqrashawn committed Jan 15, 2020
1 parent 5debda8 commit 82774cd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/e2e/metamask-ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1036,11 +1036,11 @@ describe('MetaMask', function () {
)
})

it('confirms a transaction', async () => {
it('rejects a transaction', async () => {
await delay(tinyDelayMs)
const confirmButton = await findElement(
driver,
By.xpath(`//button[contains(text(), 'Confirm')]`),
By.xpath(`//button[contains(text(), 'Reject')]`),
10000
)
await confirmButton.click()
Expand All @@ -1052,14 +1052,14 @@ describe('MetaMask', function () {
)
await delay(tinyDelayMs)
const navigationText = await navigationElement.getText()
assert.equal(navigationText.includes('4'), true, 'transaction confirmed')
assert.equal(navigationText.includes('4'), true, 'transaction rejected')
})

it('rejects a transaction', async () => {
it('confirms a transaction', async () => {
await delay(tinyDelayMs / 2)
const rejectButton = await findElement(
driver,
By.xpath(`//button[contains(text(), 'Reject')]`),
By.xpath(`//button[contains(text(), 'Confirm')]`),
10000
)
await delay(tinyDelayMs / 2)
Expand All @@ -1073,7 +1073,7 @@ describe('MetaMask', function () {
await delay(tinyDelayMs / 2)
const navigationText = await navigationElement.getText()
await delay(tinyDelayMs / 2)
assert.equal(navigationText.includes('3'), true, 'transaction rejected')
assert.equal(navigationText.includes('3'), true, 'transaction confirmed')
})

it('rejects the rest of the transactions', async () => {
Expand Down Expand Up @@ -1362,11 +1362,11 @@ describe('MetaMask', function () {
)
await delay(regularDelayMs)
await driver.wait(
until.elementTextMatches(balance, /^90.*\s*ETH.*$/),
until.elementTextMatches(balance, /^87.*\s*ETH.*$/),
10000
)
const tokenAmount = await balance.getText()
assert.ok(/^90.*\s*ETH.*$/.test(tokenAmount))
assert.ok(/^87.*\s*ETH.*$/.test(tokenAmount))
await delay(regularDelayMs)
})
})
Expand Down

0 comments on commit 82774cd

Please sign in to comment.