aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/beta/metamask-beta-ui.spec.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-22 00:29:20 +0800
committerDan <danjm.com@gmail.com>2018-06-27 21:31:26 +0800
commitf5d43404dc35a849dcb9dc9f5d87f183be0aff0b (patch)
tree556d967d9eb31f0d2ba4db14645e6184d45fbb96 /test/e2e/beta/metamask-beta-ui.spec.js
parentbdf9cd8e3ad0ba126f452f0ff2d7f52f25eb249e (diff)
downloadtangerine-wallet-browser-f5d43404dc35a849dcb9dc9f5d87f183be0aff0b.tar.gz
tangerine-wallet-browser-f5d43404dc35a849dcb9dc9f5d87f183be0aff0b.tar.zst
tangerine-wallet-browser-f5d43404dc35a849dcb9dc9f5d87f183be0aff0b.zip
Fix send token tests in beta ui e2e tests.
Diffstat (limited to 'test/e2e/beta/metamask-beta-ui.spec.js')
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js23
1 files changed, 18 insertions, 5 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index 6391e686e..9711bf821 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -378,9 +378,8 @@ describe('MetaMask', function () {
const transactions = await findElements(driver, By.css('.tx-list-item'))
assert.equal(transactions.length, 1)
- const txValues = await findElements(driver, By.css('.tx-list-value'))
- assert.equal(txValues.length, 1)
- assert.equal(await txValues[0].getText(), '1 ETH')
+ const txValues = await findElement(driver, By.css('.tx-list-value'))
+ await driver.wait(until.elementTextMatches(txValues, /1\sETH/), 10000)
})
})
@@ -524,6 +523,8 @@ describe('MetaMask', function () {
describe('Add a custom token from TokenFactory', () => {
it('creates a new token', async () => {
openNewPage(driver, 'https://tokenfactory.surge.sh/#/factory')
+
+ await delay(regularDelayMs * 10)
const [extension, tokenFactory] = await driver.getAllWindowHandles()
const [
@@ -552,12 +553,15 @@ describe('MetaMask', function () {
await driver.switchTo().window(tokenFactory)
await delay(regularDelayMs)
+
const tokenContactAddress = await driver.findElement(By.css('div > div > div:nth-child(2) > span:nth-child(3)'))
tokenAddress = await tokenContactAddress.getText()
+
await driver.close()
await driver.switchTo().window(extension)
await loadExtension(driver, extensionId)
await delay(regularDelayMs)
+
})
it('clicks on the Add Token button', async () => {
@@ -641,6 +645,7 @@ describe('MetaMask', function () {
const txValues = await findElements(driver, By.css('.tx-list-value'))
assert.equal(txValues.length, 1)
+ await delay(regularDelayMs)
assert.equal(await txValues[0].getText(), '50 TST')
const txStatuses = await findElements(driver, By.css('.tx-list-status'))
const tx = await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed|Failed/))
@@ -684,16 +689,24 @@ describe('MetaMask', function () {
const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.customize-gas-input'))
await gasPriceInput.clear()
+ await delay(tinyDelayMs)
await gasPriceInput.sendKeys('10')
+ await delay(tinyDelayMs)
await gasLimitInput.clear()
+ await delay(tinyDelayMs)
+ await gasLimitInput.sendKeys(Key.chord(Key.CONTROL, 'a'))
await gasLimitInput.sendKeys('60000')
+ await gasLimitInput.sendKeys(Key.chord(Key.CONTROL, 'e'))
+ if (process.env.SELENIUM_BROWSER === 'firefox') {
+ await gasLimitInput.sendKeys(Key.BACK_SPACE)
+ }
+ await delay(tinyDelayMs)
- const save = await findElement(driver, By.xpath(`//button[contains(text(), 'Save')]`))
+ const save = await findElement(driver, By.css('.send-v2__customize-gas__save'))
await save.click()
await driver.wait(until.stalenessOf(gasModal))
const gasFeeInput = await findElement(driver, By.css('.currency-display__input'))
- await delay(regularDelayMs)
assert.equal(await gasFeeInput.getAttribute('value'), 0.0006)
})