mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Improve waits for new tx-list-items after first contract method call in e2e beta tests.
This commit is contained in:
parent
f2194e8482
commit
74e2225f36
@ -50,15 +50,20 @@ deployButton.addEventListener('click', async function (event) {
|
|||||||
|
|
||||||
console.log(`contract`, contract)
|
console.log(`contract`, contract)
|
||||||
|
|
||||||
|
document.getElementById('contractStatus').innerHTML = 'Deployed'
|
||||||
|
|
||||||
depositButton.addEventListener('click', function (event) {
|
depositButton.addEventListener('click', function (event) {
|
||||||
|
document.getElementById('contractStatus').innerHTML = 'Deposit initiated'
|
||||||
contract.deposit({ from: web3.eth.accounts[0], value: '0x3782dace9d900000' }, function (result) {
|
contract.deposit({ from: web3.eth.accounts[0], value: '0x3782dace9d900000' }, function (result) {
|
||||||
console.log(result)
|
console.log(result)
|
||||||
|
document.getElementById('contractStatus').innerHTML = 'Deposit completed'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
withdrawButton.addEventListener('click', function (event) {
|
withdrawButton.addEventListener('click', function (event) {
|
||||||
contract.withdraw('0xde0b6b3a7640000', { from: web3.eth.accounts[0] }, function (result) {
|
contract.withdraw('0xde0b6b3a7640000', { from: web3.eth.accounts[0] }, function (result) {
|
||||||
console.log(result)
|
console.log(result)
|
||||||
|
document.getElementById('contractStatus').innerHTML = 'Withdrawn'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
<button id="depositButton">Deposit</button>
|
<button id="depositButton">Deposit</button>
|
||||||
<button id="withdrawButton">Withdraw</button>
|
<button id="withdrawButton">Withdraw</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="contractStatus" style="display: flex; font-size: 1rem;">
|
||||||
|
Not yet deployed
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex; flex-flow: column;">
|
<div style="display: flex; flex-flow: column;">
|
||||||
<div style="display: flex; font-size: 1.25rem;">Send eth</div>
|
<div style="display: flex; font-size: 1.25rem;">Send eth</div>
|
||||||
|
@ -516,7 +516,7 @@ describe('MetaMask', function () {
|
|||||||
|
|
||||||
it('displays the contract creation data', async () => {
|
it('displays the contract creation data', async () => {
|
||||||
const dataTab = await findElement(driver, By.xpath(`//li[contains(text(), 'Data')]`))
|
const dataTab = await findElement(driver, By.xpath(`//li[contains(text(), 'Data')]`))
|
||||||
dataTab.click()
|
await dataTab.click()
|
||||||
await delay(regularDelayMs)
|
await delay(regularDelayMs)
|
||||||
|
|
||||||
await findElement(driver, By.xpath(`//div[contains(text(), '127.0.0.1')]`))
|
await findElement(driver, By.xpath(`//div[contains(text(), '127.0.0.1')]`))
|
||||||
@ -526,7 +526,7 @@ describe('MetaMask', function () {
|
|||||||
assert.equal(confirmDataText.match(/0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff/))
|
assert.equal(confirmDataText.match(/0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff/))
|
||||||
|
|
||||||
const detailsTab = await findElement(driver, By.xpath(`//li[contains(text(), 'Details')]`))
|
const detailsTab = await findElement(driver, By.xpath(`//li[contains(text(), 'Details')]`))
|
||||||
detailsTab.click()
|
await detailsTab.click()
|
||||||
await delay(regularDelayMs)
|
await delay(regularDelayMs)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -547,9 +547,15 @@ describe('MetaMask', function () {
|
|||||||
await driver.switchTo().window(dapp)
|
await driver.switchTo().window(dapp)
|
||||||
await delay(regularDelayMs)
|
await delay(regularDelayMs)
|
||||||
|
|
||||||
|
let contractStatus = await driver.findElement(By.css('#contractStatus'))
|
||||||
|
await driver.wait(until.elementTextMatches(contractStatus, /Deployed/))
|
||||||
|
|
||||||
const depositButton = await findElement(driver, By.css('#depositButton'))
|
const depositButton = await findElement(driver, By.css('#depositButton'))
|
||||||
await depositButton.click()
|
await depositButton.click()
|
||||||
await delay(regularDelayMs)
|
await delay(largeDelayMs)
|
||||||
|
|
||||||
|
contractStatus = await driver.findElement(By.css('#contractStatus'))
|
||||||
|
await driver.wait(until.elementTextMatches(contractStatus, /Deposit\sinitiated/))
|
||||||
|
|
||||||
await driver.switchTo().window(extension)
|
await driver.switchTo().window(extension)
|
||||||
await delay(largeDelayMs)
|
await delay(largeDelayMs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user