aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/beta/metamask-beta-ui.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/beta/metamask-beta-ui.spec.js')
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js34
1 files changed, 24 insertions, 10 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index 3ad5c2d61..43300bda6 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -88,7 +88,14 @@ describe('MetaMask', function () {
await driver.wait(until.stalenessOf(overlay))
} catch (e) {}
- const button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]"))
+ let button
+ try {
+ button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]"))
+ } catch (e) {
+ await loadExtension(driver, extensionId)
+ await delay(largeDelayMs)
+ button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]"))
+ }
await button.click()
await delay(regularDelayMs)
@@ -345,8 +352,8 @@ describe('MetaMask', function () {
const passwordInputs = await driver.findElements(By.css('input'))
await delay(regularDelayMs)
- passwordInputs[0].sendKeys('correct horse battery staple')
- passwordInputs[1].sendKeys('correct horse battery staple')
+ await passwordInputs[0].sendKeys('correct horse battery staple')
+ await passwordInputs[1].sendKeys('correct horse battery staple')
await driver.findElement(By.css('.first-time-flow__button')).click()
await delay(regularDelayMs)
})
@@ -438,7 +445,7 @@ describe('MetaMask', function () {
await driver.switchTo().window(windowHandles[2])
await delay(regularDelayMs)
- assertElementNotPresent(webdriver, driver, By.xpath(`//li[contains(text(), 'Data')]`))
+ await assertElementNotPresent(webdriver, driver, By.xpath(`//li[contains(text(), 'Data')]`))
const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`), 10000)
await confirmButton.click()
@@ -453,6 +460,11 @@ describe('MetaMask', function () {
const transactions = await findElements(driver, By.css('.tx-list-item'))
assert.equal(transactions.length, 2)
+ await findElement(driver, By.xpath(`//span[contains(text(), 'Submitted')]`))
+
+ const txStatuses = await findElements(driver, By.css('.tx-list-status'))
+ await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed/))
+
const txValues = await findElement(driver, By.css('.tx-list-value'))
await driver.wait(until.elementTextMatches(txValues, /3\sETH/), 10000)
})
@@ -503,6 +515,8 @@ describe('MetaMask', function () {
await confirmButton.click()
await delay(regularDelayMs)
+ await findElement(driver, By.xpath(`//span[contains(text(), 'Submitted')]`))
+
const txStatuses = await findElements(driver, By.css('.tx-list-status'))
await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed/))
@@ -515,15 +529,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/))
+ let contractStatus = await findElement(driver, By.css('#contractStatus'))
+ await driver.wait(until.elementTextMatches(contractStatus, /Deployed/), 15000)
const depositButton = await findElement(driver, By.css('#depositButton'))
await depositButton.click()
await delay(largeDelayMs)
- contractStatus = await driver.findElement(By.css('#contractStatus'))
- await driver.wait(until.elementTextMatches(contractStatus, /Deposit\sinitiated/))
+ contractStatus = await findElement(driver, By.css('#contractStatus'))
+ await driver.wait(until.elementTextMatches(contractStatus, /Deposit\sinitiated/), 10000)
await driver.switchTo().window(extension)
await delay(largeDelayMs)
@@ -539,8 +553,8 @@ describe('MetaMask', function () {
await configureGas.click()
await delay(regularDelayMs)
- const gasModal = await driver.findElement(By.css('span .modal'))
- await driver.wait(until.elementLocated(By.css('.customize-gas__title')))
+ const gasModal = await findElement(driver, By.css('span .modal'))
+ await driver.wait(until.elementLocated(By.css('.customize-gas__title')), 10000)
const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.customize-gas-input'))
await gasPriceInput.clear()