|
|
@ -8,270 +8,268 @@ const { |
|
|
|
regularDelayMs, |
|
|
|
regularDelayMs, |
|
|
|
} = require('../helpers'); |
|
|
|
} = require('../helpers'); |
|
|
|
|
|
|
|
|
|
|
|
if (process.env.EIP_1559_V2 === '1') { |
|
|
|
describe('Editing Confirm Transaction', function () { |
|
|
|
describe('Editing Confirm Transaction', function () { |
|
|
|
it('allows selecting high, medium, low gas estimates on edit gas fee popover', async function () { |
|
|
|
it('allows selecting high, medium, low gas estimates on edit gas fee popover', async function () { |
|
|
|
const ganacheOptions = { |
|
|
|
const ganacheOptions = { |
|
|
|
hardfork: 'london', |
|
|
|
hardfork: 'london', |
|
|
|
accounts: [ |
|
|
|
accounts: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
secretKey: |
|
|
|
|
|
|
|
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', |
|
|
|
|
|
|
|
balance: convertToHexValue(25000000000000000000), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
await withFixtures( |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
fixtures: 'eip-1559-v2', |
|
|
|
secretKey: |
|
|
|
ganacheOptions, |
|
|
|
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', |
|
|
|
title: this.test.title, |
|
|
|
balance: convertToHexValue(25000000000000000000), |
|
|
|
}, |
|
|
|
}, |
|
|
|
async ({ driver }) => { |
|
|
|
], |
|
|
|
await driver.navigate(); |
|
|
|
}; |
|
|
|
|
|
|
|
await withFixtures( |
|
|
|
await driver.fill('#password', 'correct horse battery staple'); |
|
|
|
{ |
|
|
|
await driver.press('#password', driver.Key.ENTER); |
|
|
|
fixtures: 'eip-1559-v2', |
|
|
|
|
|
|
|
ganacheOptions, |
|
|
|
const transactionAmounts = await driver.findElements( |
|
|
|
title: this.test.title, |
|
|
|
'.currency-display-component__text', |
|
|
|
}, |
|
|
|
); |
|
|
|
async ({ driver }) => { |
|
|
|
const transactionAmount = transactionAmounts[0]; |
|
|
|
await driver.navigate(); |
|
|
|
assert.equal(await transactionAmount.getText(), '2.2'); |
|
|
|
|
|
|
|
|
|
|
|
await driver.fill('#password', 'correct horse battery staple'); |
|
|
|
// update estimates to high
|
|
|
|
await driver.press('#password', driver.Key.ENTER); |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-button"]'); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
const transactionAmounts = await driver.findElements( |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-item-high"]'); |
|
|
|
'.currency-display-component__text', |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
); |
|
|
|
await driver.waitForSelector({ text: '🦍' }); |
|
|
|
const transactionAmount = transactionAmounts[0]; |
|
|
|
await driver.waitForSelector({ |
|
|
|
assert.equal(await transactionAmount.getText(), '2.2'); |
|
|
|
text: 'Aggressive', |
|
|
|
|
|
|
|
}); |
|
|
|
// update estimates to high
|
|
|
|
|
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-button"]'); |
|
|
|
// update estimates to medium
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-button"]'); |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-item-high"]'); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-item-medium"]'); |
|
|
|
await driver.waitForSelector({ text: '🦍' }); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.waitForSelector({ |
|
|
|
await driver.waitForSelector({ text: '🦊' }); |
|
|
|
text: 'Aggressive', |
|
|
|
await driver.waitForSelector({ |
|
|
|
}); |
|
|
|
text: 'Market', |
|
|
|
|
|
|
|
}); |
|
|
|
// update estimates to medium
|
|
|
|
|
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-button"]'); |
|
|
|
// update estimates to low
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-button"]'); |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-item-medium"]'); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-item-low"]'); |
|
|
|
await driver.waitForSelector({ text: '🦊' }); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.waitForSelector({ |
|
|
|
await driver.waitForSelector({ text: '🐢' }); |
|
|
|
text: 'Market', |
|
|
|
await driver.waitForSelector({ |
|
|
|
}); |
|
|
|
text: 'Low', |
|
|
|
|
|
|
|
}); |
|
|
|
// update estimates to low
|
|
|
|
await driver.waitForSelector('[data-testid="low-gas-fee-alert"]'); |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-button"]'); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
// confirms the transaction
|
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-item-low"]'); |
|
|
|
await driver.clickElement({ text: 'Confirm', tag: 'button' }); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.waitForSelector({ text: '🐢' }); |
|
|
|
|
|
|
|
await driver.waitForSelector({ |
|
|
|
await driver.clickElement('[data-testid="home__activity-tab"]'); |
|
|
|
text: 'Low', |
|
|
|
await driver.wait(async () => { |
|
|
|
}); |
|
|
|
const confirmedTxes = await driver.findElements( |
|
|
|
await driver.waitForSelector('[data-testid="low-gas-fee-alert"]'); |
|
|
|
'.transaction-list__completed-transactions .transaction-list-item', |
|
|
|
|
|
|
|
); |
|
|
|
// confirms the transaction
|
|
|
|
return confirmedTxes.length === 1; |
|
|
|
await driver.clickElement({ text: 'Confirm', tag: 'button' }); |
|
|
|
}, 10000); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
|
|
|
|
const txValues = await driver.findElements( |
|
|
|
await driver.clickElement('[data-testid="home__activity-tab"]'); |
|
|
|
'.transaction-list-item__primary-currency', |
|
|
|
await driver.wait(async () => { |
|
|
|
|
|
|
|
const confirmedTxes = await driver.findElements( |
|
|
|
|
|
|
|
'.transaction-list__completed-transactions .transaction-list-item', |
|
|
|
); |
|
|
|
); |
|
|
|
assert.equal(txValues.length, 1); |
|
|
|
return confirmedTxes.length === 1; |
|
|
|
assert.ok(/-2.2\s*ETH/u.test(await txValues[0].getText())); |
|
|
|
}, 10000); |
|
|
|
}, |
|
|
|
|
|
|
|
); |
|
|
|
const txValues = await driver.findElements( |
|
|
|
}); |
|
|
|
'.transaction-list-item__primary-currency', |
|
|
|
|
|
|
|
); |
|
|
|
it('allows accessing advance gas fee popover from edit gas fee popover', async function () { |
|
|
|
assert.equal(txValues.length, 1); |
|
|
|
const ganacheOptions = { |
|
|
|
assert.ok(/-2.2\s*ETH/u.test(await txValues[0].getText())); |
|
|
|
hardfork: 'london', |
|
|
|
}, |
|
|
|
accounts: [ |
|
|
|
); |
|
|
|
{ |
|
|
|
}); |
|
|
|
secretKey: |
|
|
|
|
|
|
|
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', |
|
|
|
it('allows accessing advance gas fee popover from edit gas fee popover', async function () { |
|
|
|
balance: convertToHexValue(25000000000000000000), |
|
|
|
const ganacheOptions = { |
|
|
|
}, |
|
|
|
hardfork: 'london', |
|
|
|
], |
|
|
|
accounts: [ |
|
|
|
}; |
|
|
|
|
|
|
|
await withFixtures( |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
fixtures: 'eip-1559-v2', |
|
|
|
secretKey: |
|
|
|
ganacheOptions, |
|
|
|
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', |
|
|
|
title: this.test.title, |
|
|
|
balance: convertToHexValue(25000000000000000000), |
|
|
|
}, |
|
|
|
}, |
|
|
|
async ({ driver }) => { |
|
|
|
], |
|
|
|
await driver.navigate(); |
|
|
|
}; |
|
|
|
|
|
|
|
await withFixtures( |
|
|
|
await driver.fill('#password', 'correct horse battery staple'); |
|
|
|
{ |
|
|
|
await driver.press('#password', driver.Key.ENTER); |
|
|
|
fixtures: 'eip-1559-v2', |
|
|
|
|
|
|
|
ganacheOptions, |
|
|
|
const transactionAmounts = await driver.findElements( |
|
|
|
title: this.test.title, |
|
|
|
'.currency-display-component__text', |
|
|
|
}, |
|
|
|
); |
|
|
|
async ({ driver }) => { |
|
|
|
const transactionAmount = transactionAmounts[0]; |
|
|
|
await driver.navigate(); |
|
|
|
assert.equal(await transactionAmount.getText(), '2.2'); |
|
|
|
|
|
|
|
|
|
|
|
await driver.fill('#password', 'correct horse battery staple'); |
|
|
|
// update estimates to high
|
|
|
|
await driver.press('#password', driver.Key.ENTER); |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-button"]'); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
const transactionAmounts = await driver.findElements( |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-item-custom"]'); |
|
|
|
'.currency-display-component__text', |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
); |
|
|
|
|
|
|
|
const transactionAmount = transactionAmounts[0]; |
|
|
|
// enter max fee
|
|
|
|
assert.equal(await transactionAmount.getText(), '2.2'); |
|
|
|
const maxBaseFee = await driver.findElement( |
|
|
|
|
|
|
|
'[data-testid="base-fee-input"]', |
|
|
|
// update estimates to high
|
|
|
|
); |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-button"]'); |
|
|
|
await maxBaseFee.clear(); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await maxBaseFee.sendKeys('8'); |
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-item-custom"]'); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
|
|
|
|
// enter priority fee
|
|
|
|
// enter max fee
|
|
|
|
const priorityFee = await driver.findElement( |
|
|
|
const maxBaseFee = await driver.findElement( |
|
|
|
'[data-testid="priority-fee-input"]', |
|
|
|
'[data-testid="base-fee-input"]', |
|
|
|
); |
|
|
|
); |
|
|
|
await priorityFee.clear(); |
|
|
|
await maxBaseFee.clear(); |
|
|
|
await priorityFee.sendKeys('8'); |
|
|
|
await maxBaseFee.sendKeys('8'); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
|
|
|
|
// save default values
|
|
|
|
// enter priority fee
|
|
|
|
await driver.clickElement('input[type="checkbox"]'); |
|
|
|
const priorityFee = await driver.findElement( |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
'[data-testid="priority-fee-input"]', |
|
|
|
|
|
|
|
); |
|
|
|
// edit gas limit
|
|
|
|
await priorityFee.clear(); |
|
|
|
await driver.clickElement('[data-testid="advanced-gas-fee-edit"]'); |
|
|
|
await priorityFee.sendKeys('8'); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
const gasLimit = await driver.findElement( |
|
|
|
|
|
|
|
'[data-testid="gas-limit-input"]', |
|
|
|
// save default values
|
|
|
|
|
|
|
|
await driver.clickElement('input[type="checkbox"]'); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// edit gas limit
|
|
|
|
|
|
|
|
await driver.clickElement('[data-testid="advanced-gas-fee-edit"]'); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
const gasLimit = await driver.findElement( |
|
|
|
|
|
|
|
'[data-testid="gas-limit-input"]', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
await gasLimit.clear(); |
|
|
|
|
|
|
|
await gasLimit.sendKeys('100000'); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Submit gas fee changes
|
|
|
|
|
|
|
|
await driver.clickElement({ text: 'Save', tag: 'button' }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// has correct updated value on the confirm screen the transaction
|
|
|
|
|
|
|
|
const editedTransactionAmounts = await driver.findElements( |
|
|
|
|
|
|
|
'.transaction-detail-item__row .transaction-detail-item__detail-values .currency-display-component__text:last-of-type', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
const editedTransactionAmount = editedTransactionAmounts[0]; |
|
|
|
|
|
|
|
assert.equal(await editedTransactionAmount.getText(), '0.0008'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const editedTransactionFee = editedTransactionAmounts[1]; |
|
|
|
|
|
|
|
assert.equal(await editedTransactionFee.getText(), '2.2008'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// confirms the transaction
|
|
|
|
|
|
|
|
await driver.clickElement({ text: 'Confirm', tag: 'button' }); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await driver.clickElement('[data-testid="home__activity-tab"]'); |
|
|
|
|
|
|
|
await driver.wait(async () => { |
|
|
|
|
|
|
|
const confirmedTxes = await driver.findElements( |
|
|
|
|
|
|
|
'.transaction-list__completed-transactions .transaction-list-item', |
|
|
|
); |
|
|
|
); |
|
|
|
await gasLimit.clear(); |
|
|
|
return confirmedTxes.length === 1; |
|
|
|
await gasLimit.sendKeys('100000'); |
|
|
|
}, 10000); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
|
|
|
|
const txValues = await driver.findElements( |
|
|
|
// Submit gas fee changes
|
|
|
|
'.transaction-list-item__primary-currency', |
|
|
|
await driver.clickElement({ text: 'Save', tag: 'button' }); |
|
|
|
); |
|
|
|
|
|
|
|
assert.equal(txValues.length, 1); |
|
|
|
|
|
|
|
assert.ok(/-2.2\s*ETH/u.test(await txValues[0].getText())); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// has correct updated value on the confirm screen the transaction
|
|
|
|
it('should use dapp suggested estimates for transaction coming from dapp', async function () { |
|
|
|
const editedTransactionAmounts = await driver.findElements( |
|
|
|
const ganacheOptions = { |
|
|
|
'.transaction-detail-item__row .transaction-detail-item__detail-values .currency-display-component__text:last-of-type', |
|
|
|
hardfork: 'london', |
|
|
|
); |
|
|
|
accounts: [ |
|
|
|
const editedTransactionAmount = editedTransactionAmounts[0]; |
|
|
|
|
|
|
|
assert.equal(await editedTransactionAmount.getText(), '0.0008'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const editedTransactionFee = editedTransactionAmounts[1]; |
|
|
|
|
|
|
|
assert.equal(await editedTransactionFee.getText(), '2.2008'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// confirms the transaction
|
|
|
|
|
|
|
|
await driver.clickElement({ text: 'Confirm', tag: 'button' }); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await driver.clickElement('[data-testid="home__activity-tab"]'); |
|
|
|
|
|
|
|
await driver.wait(async () => { |
|
|
|
|
|
|
|
const confirmedTxes = await driver.findElements( |
|
|
|
|
|
|
|
'.transaction-list__completed-transactions .transaction-list-item', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
return confirmedTxes.length === 1; |
|
|
|
|
|
|
|
}, 10000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const txValues = await driver.findElements( |
|
|
|
|
|
|
|
'.transaction-list-item__primary-currency', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
assert.equal(txValues.length, 1); |
|
|
|
|
|
|
|
assert.ok(/-2.2\s*ETH/u.test(await txValues[0].getText())); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('should use dapp suggested estimates for transaction coming from dapp', async function () { |
|
|
|
|
|
|
|
const ganacheOptions = { |
|
|
|
|
|
|
|
hardfork: 'london', |
|
|
|
|
|
|
|
accounts: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
secretKey: |
|
|
|
|
|
|
|
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', |
|
|
|
|
|
|
|
balance: convertToHexValue(25000000000000000000), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
await withFixtures( |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
fixtures: 'eip-1559-v2-dapp', |
|
|
|
secretKey: |
|
|
|
ganacheOptions, |
|
|
|
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', |
|
|
|
title: this.test.title, |
|
|
|
balance: convertToHexValue(25000000000000000000), |
|
|
|
dapp: true, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
async ({ driver }) => { |
|
|
|
], |
|
|
|
await driver.navigate(); |
|
|
|
}; |
|
|
|
|
|
|
|
await withFixtures( |
|
|
|
// login to extension
|
|
|
|
{ |
|
|
|
await driver.fill('#password', 'correct horse battery staple'); |
|
|
|
fixtures: 'eip-1559-v2-dapp', |
|
|
|
await driver.press('#password', driver.Key.ENTER); |
|
|
|
ganacheOptions, |
|
|
|
|
|
|
|
title: this.test.title, |
|
|
|
// open dapp and connect
|
|
|
|
dapp: true, |
|
|
|
await connectDappWithExtensionPopup(driver); |
|
|
|
}, |
|
|
|
await driver.clickElement({ text: 'Send', tag: 'button' }); |
|
|
|
async ({ driver }) => { |
|
|
|
|
|
|
|
await driver.navigate(); |
|
|
|
// check transaction in extension popup
|
|
|
|
|
|
|
|
const windowHandles = await getWindowHandles(driver, 3); |
|
|
|
// login to extension
|
|
|
|
await driver.switchToWindow(windowHandles.popup); |
|
|
|
await driver.fill('#password', 'correct horse battery staple'); |
|
|
|
await driver.delay(largeDelayMs); |
|
|
|
await driver.press('#password', driver.Key.ENTER); |
|
|
|
await driver.waitForSelector({ text: '🌐' }); |
|
|
|
|
|
|
|
await driver.waitForSelector({ |
|
|
|
// open dapp and connect
|
|
|
|
text: 'Site suggested', |
|
|
|
await connectDappWithExtensionPopup(driver); |
|
|
|
}); |
|
|
|
await driver.clickElement({ text: 'Send', tag: 'button' }); |
|
|
|
|
|
|
|
|
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-button"]'); |
|
|
|
// check transaction in extension popup
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
const windowHandles = await getWindowHandles(driver, 3); |
|
|
|
await driver.clickElement( |
|
|
|
await driver.switchToWindow(windowHandles.popup); |
|
|
|
'[data-testid="edit-gas-fee-item-dappSuggested"]', |
|
|
|
await driver.delay(largeDelayMs); |
|
|
|
|
|
|
|
await driver.waitForSelector({ text: '🌐' }); |
|
|
|
|
|
|
|
await driver.waitForSelector({ |
|
|
|
|
|
|
|
text: 'Site suggested', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await driver.clickElement('[data-testid="edit-gas-fee-button"]'); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
await driver.clickElement( |
|
|
|
|
|
|
|
'[data-testid="edit-gas-fee-item-dappSuggested"]', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const transactionAmounts = await driver.findElements( |
|
|
|
|
|
|
|
'.currency-display-component__text', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
const transactionAmount = transactionAmounts[0]; |
|
|
|
|
|
|
|
assert.equal(await transactionAmount.getText(), '3'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// has correct updated value on the confirm screen the transaction
|
|
|
|
|
|
|
|
const editedTransactionAmounts = await driver.findElements( |
|
|
|
|
|
|
|
'.transaction-detail-item__row .transaction-detail-item__detail-values .currency-display-component__text:last-of-type', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
const editedTransactionAmount = editedTransactionAmounts[0]; |
|
|
|
|
|
|
|
assert.equal(await editedTransactionAmount.getText(), '0.00042'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const editedTransactionFee = editedTransactionAmounts[1]; |
|
|
|
|
|
|
|
assert.equal(await editedTransactionFee.getText(), '3.00042'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// confirms the transaction
|
|
|
|
|
|
|
|
await driver.clickElement({ text: 'Confirm', tag: 'button' }); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// transaction should correct values in activity tab
|
|
|
|
|
|
|
|
await driver.switchToWindow(windowHandles.extension); |
|
|
|
|
|
|
|
await driver.clickElement('[data-testid="home__activity-tab"]'); |
|
|
|
|
|
|
|
await driver.wait(async () => { |
|
|
|
|
|
|
|
const confirmedTxes = await driver.findElements( |
|
|
|
|
|
|
|
'.transaction-list__completed-transactions .transaction-list-item', |
|
|
|
); |
|
|
|
); |
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
return confirmedTxes.length === 1; |
|
|
|
|
|
|
|
}, 10000); |
|
|
|
const transactionAmounts = await driver.findElements( |
|
|
|
|
|
|
|
'.currency-display-component__text', |
|
|
|
const txValues = await driver.findElements( |
|
|
|
); |
|
|
|
'.transaction-list-item__primary-currency', |
|
|
|
const transactionAmount = transactionAmounts[0]; |
|
|
|
); |
|
|
|
assert.equal(await transactionAmount.getText(), '3'); |
|
|
|
assert.equal(txValues.length, 1); |
|
|
|
|
|
|
|
assert.ok(/-3\s*ETH/u.test(await txValues[0].getText())); |
|
|
|
// has correct updated value on the confirm screen the transaction
|
|
|
|
}, |
|
|
|
const editedTransactionAmounts = await driver.findElements( |
|
|
|
); |
|
|
|
'.transaction-detail-item__row .transaction-detail-item__detail-values .currency-display-component__text:last-of-type', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
const editedTransactionAmount = editedTransactionAmounts[0]; |
|
|
|
|
|
|
|
assert.equal(await editedTransactionAmount.getText(), '0.00042'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const editedTransactionFee = editedTransactionAmounts[1]; |
|
|
|
|
|
|
|
assert.equal(await editedTransactionFee.getText(), '3.00042'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// confirms the transaction
|
|
|
|
|
|
|
|
await driver.clickElement({ text: 'Confirm', tag: 'button' }); |
|
|
|
|
|
|
|
await driver.delay(regularDelayMs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// transaction should correct values in activity tab
|
|
|
|
|
|
|
|
await driver.switchToWindow(windowHandles.extension); |
|
|
|
|
|
|
|
await driver.clickElement('[data-testid="home__activity-tab"]'); |
|
|
|
|
|
|
|
await driver.wait(async () => { |
|
|
|
|
|
|
|
const confirmedTxes = await driver.findElements( |
|
|
|
|
|
|
|
'.transaction-list__completed-transactions .transaction-list-item', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
return confirmedTxes.length === 1; |
|
|
|
|
|
|
|
}, 10000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const txValues = await driver.findElements( |
|
|
|
|
|
|
|
'.transaction-list-item__primary-currency', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
assert.equal(txValues.length, 1); |
|
|
|
|
|
|
|
assert.ok(/-3\s*ETH/u.test(await txValues[0].getText())); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|