aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/beta
diff options
context:
space:
mode:
authorDan Miller <danjm.com@gmail.com>2018-07-25 01:24:13 +0800
committerDan Miller <danjm.com@gmail.com>2018-08-06 21:37:16 +0800
commit74e2225f36fb8ab10f701eb4b86ad9dab1a83474 (patch)
treed67678bd75ee0d45d46fca41b93ceaaccf4021a4 /test/e2e/beta
parentf2194e8482203988909da75e0442e66840c0bcab (diff)
downloadtangerine-wallet-browser-74e2225f36fb8ab10f701eb4b86ad9dab1a83474.tar
tangerine-wallet-browser-74e2225f36fb8ab10f701eb4b86ad9dab1a83474.tar.gz
tangerine-wallet-browser-74e2225f36fb8ab10f701eb4b86ad9dab1a83474.tar.bz2
tangerine-wallet-browser-74e2225f36fb8ab10f701eb4b86ad9dab1a83474.tar.lz
tangerine-wallet-browser-74e2225f36fb8ab10f701eb4b86ad9dab1a83474.tar.xz
tangerine-wallet-browser-74e2225f36fb8ab10f701eb4b86ad9dab1a83474.tar.zst
tangerine-wallet-browser-74e2225f36fb8ab10f701eb4b86ad9dab1a83474.zip
Improve waits for new tx-list-items after first contract method call in e2e beta tests.
Diffstat (limited to 'test/e2e/beta')
-rw-r--r--test/e2e/beta/contract-test/contract.js5
-rw-r--r--test/e2e/beta/contract-test/index.html3
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js12
3 files changed, 17 insertions, 3 deletions
diff --git a/test/e2e/beta/contract-test/contract.js b/test/e2e/beta/contract-test/contract.js
index 8af008dce..51891ea21 100644
--- a/test/e2e/beta/contract-test/contract.js
+++ b/test/e2e/beta/contract-test/contract.js
@@ -50,15 +50,20 @@ deployButton.addEventListener('click', async function (event) {
console.log(`contract`, contract)
+ document.getElementById('contractStatus').innerHTML = 'Deployed'
+
depositButton.addEventListener('click', function (event) {
+ document.getElementById('contractStatus').innerHTML = 'Deposit initiated'
contract.deposit({ from: web3.eth.accounts[0], value: '0x3782dace9d900000' }, function (result) {
console.log(result)
+ document.getElementById('contractStatus').innerHTML = 'Deposit completed'
})
})
withdrawButton.addEventListener('click', function (event) {
contract.withdraw('0xde0b6b3a7640000', { from: web3.eth.accounts[0] }, function (result) {
console.log(result)
+ document.getElementById('contractStatus').innerHTML = 'Withdrawn'
})
})
}
diff --git a/test/e2e/beta/contract-test/index.html b/test/e2e/beta/contract-test/index.html
index 0d63fd940..f6e6f44c7 100644
--- a/test/e2e/beta/contract-test/index.html
+++ b/test/e2e/beta/contract-test/index.html
@@ -10,6 +10,9 @@
<button id="depositButton">Deposit</button>
<button id="withdrawButton">Withdraw</button>
</div>
+ <div id="contractStatus" style="display: flex; font-size: 1rem;">
+ Not yet deployed
+ </div>
</div>
<div style="display: flex; flex-flow: column;">
<div style="display: flex; font-size: 1.25rem;">Send eth</div>
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index 98132e68c..f5bda4e68 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -516,7 +516,7 @@ describe('MetaMask', function () {
it('displays the contract creation data', async () => {
const dataTab = await findElement(driver, By.xpath(`//li[contains(text(), 'Data')]`))
- dataTab.click()
+ await dataTab.click()
await delay(regularDelayMs)
await findElement(driver, By.xpath(`//div[contains(text(), '127.0.0.1')]`))
@@ -526,7 +526,7 @@ describe('MetaMask', function () {
assert.equal(confirmDataText.match(/0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff/))
const detailsTab = await findElement(driver, By.xpath(`//li[contains(text(), 'Details')]`))
- detailsTab.click()
+ await detailsTab.click()
await delay(regularDelayMs)
})
@@ -547,9 +547,15 @@ describe('MetaMask', function () {
await driver.switchTo().window(dapp)
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'))
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 delay(largeDelayMs)