mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Update metamask-beta-ui e2e spec to fail on insufficient gas estimation.
This commit is contained in:
parent
309239afb4
commit
b64292d92f
@ -485,6 +485,7 @@ describe('MetaMask', function () {
|
|||||||
await delay(regularDelayMs)
|
await delay(regularDelayMs)
|
||||||
|
|
||||||
let gasModal = await driver.findElement(By.css('span .modal'))
|
let gasModal = await driver.findElement(By.css('span .modal'))
|
||||||
|
await driver.wait(until.elementLocated('send-v2__customize-gas__title'))
|
||||||
|
|
||||||
const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.customize-gas-input'))
|
const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.customize-gas-input'))
|
||||||
await gasPriceInput.clear()
|
await gasPriceInput.clear()
|
||||||
@ -612,12 +613,7 @@ describe('MetaMask', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('customizes gas', async () => {
|
it('customizes gas', async () => {
|
||||||
const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.customize-gas-input'))
|
await driver.wait(until.elementLocated(By.css('.send-v2__customize-gas__title')))
|
||||||
await gasPriceInput.clear()
|
|
||||||
await gasPriceInput.sendKeys('12.5')
|
|
||||||
await gasLimitInput.clear()
|
|
||||||
await gasLimitInput.sendKeys('56789')
|
|
||||||
|
|
||||||
const save = await findElement(driver, By.xpath(`//button[contains(text(), 'Save')]`))
|
const save = await findElement(driver, By.xpath(`//button[contains(text(), 'Save')]`))
|
||||||
await save.click()
|
await save.click()
|
||||||
await delay(regularDelayMs)
|
await delay(regularDelayMs)
|
||||||
@ -646,11 +642,13 @@ describe('MetaMask', function () {
|
|||||||
assert.equal(txValues.length, 1)
|
assert.equal(txValues.length, 1)
|
||||||
assert.equal(await txValues[0].getText(), '50 TST')
|
assert.equal(await txValues[0].getText(), '50 TST')
|
||||||
const txStatuses = await findElements(driver, By.css('.tx-list-status'))
|
const txStatuses = await findElements(driver, By.css('.tx-list-status'))
|
||||||
await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed/))
|
const tx = await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed|Failed/))
|
||||||
|
assert.equal(await tx.getText(), 'Confirmed')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('Send a custom token from TokenFactory', () => {
|
describe('Send a custom token from TokenFactory', () => {
|
||||||
|
let gasModal
|
||||||
it('sends an already created token', async () => {
|
it('sends an already created token', async () => {
|
||||||
await driver.executeScript(`window.open("https://tokenfactory.surge.sh/#/token/${tokenAddress}")`)
|
await driver.executeScript(`window.open("https://tokenfactory.surge.sh/#/token/${tokenAddress}")`)
|
||||||
await delay(waitingNewPageDelayMs)
|
await delay(waitingNewPageDelayMs)
|
||||||
@ -673,6 +671,32 @@ describe('MetaMask', function () {
|
|||||||
await loadExtension(driver, extensionId)
|
await loadExtension(driver, extensionId)
|
||||||
await delay(regularDelayMs)
|
await delay(regularDelayMs)
|
||||||
|
|
||||||
|
// Set the gas limit
|
||||||
|
const configureGas = await driver.wait(until.elementLocated(By.css('.send-v2__gas-fee-display button')))
|
||||||
|
await configureGas.click()
|
||||||
|
await delay(regularDelayMs)
|
||||||
|
|
||||||
|
gasModal = await driver.findElement(By.css('span .modal'))
|
||||||
|
})
|
||||||
|
|
||||||
|
it('customizes gas', async () => {
|
||||||
|
await driver.wait(until.elementLocated(By.css('.send-v2__customize-gas__title')))
|
||||||
|
|
||||||
|
const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.customize-gas-input'))
|
||||||
|
await gasPriceInput.clear()
|
||||||
|
await gasPriceInput.sendKeys('10')
|
||||||
|
await gasLimitInput.clear()
|
||||||
|
await gasLimitInput.sendKeys('60000')
|
||||||
|
|
||||||
|
const save = await findElement(driver, By.xpath(`//button[contains(text(), 'Save')]`))
|
||||||
|
await save.click()
|
||||||
|
await driver.wait(until.stalenessOf(gasModal))
|
||||||
|
|
||||||
|
const gasFeeInput = await findElement(driver, By.css('.currency-display__input'))
|
||||||
|
assert.equal(await gasFeeInput.getAttribute('value'), 0.0006)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('submits the transaction', async function () {
|
||||||
const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`))
|
const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`))
|
||||||
await confirmButton.click()
|
await confirmButton.click()
|
||||||
await delay(regularDelayMs)
|
await delay(regularDelayMs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user