1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Update selenium tests

This commit is contained in:
Thomas 2018-03-09 23:57:44 -08:00
parent c18f2a17fc
commit a62fe4f7ea

View File

@ -14,10 +14,8 @@ describe('Metamask popup page', function () {
const extPath = path.resolve('dist/chrome') const extPath = path.resolve('dist/chrome')
driver = buildWebDriver(extPath) driver = buildWebDriver(extPath)
await driver.get('chrome://extensions-frame') await driver.get('chrome://extensions-frame')
const elems = await driver.findElements(By.xpath( const elems = await driver.findElements(By.className('extension-list-item-wrapper'))
'//*[@id="fmmjaglpijbgopejlfapbkhhbnaagbpj"]' const extensionId = await elems[1].getAttribute('id')
))
const extensionId = await elems[0].getAttribute('id')
await driver.get(`chrome-extension://${extensionId}/popup.html`) await driver.get(`chrome-extension://${extensionId}/popup.html`)
await delay(500) await delay(500)
}) })
@ -78,12 +76,12 @@ describe('Metamask popup page', function () {
it('should accept password with length of eight', async () => { it('should accept password with length of eight', async () => {
await delay(300) await delay(300)
const passwordBox = await driver.findElement(By.id('password-box')) const passwordBox = await driver.findElement(By.id('password-box'))
const passwordBoxConfirm = driver.findElement(By.id('password-box-confirm')) const passwordBoxConfirm = await driver.findElement(By.id('password-box-confirm'))
const button = driver.findElement(By.css('button')) const button = driver.findElement(By.css('button'))
passwordBox.sendKeys('12345678') passwordBox.sendKeys('123456789')
passwordBoxConfirm.sendKeys('12345678') passwordBoxConfirm.sendKeys('123456789')
await delay(300) await delay(500)
await button.click() await button.click()
}) })
@ -103,7 +101,7 @@ describe('Metamask popup page', function () {
it('should accept account password after lock', async () => { it('should accept account password after lock', async () => {
await delay(500) await delay(500)
await driver.findElement(By.id('password-box')).sendKeys('12345678') await driver.findElement(By.id('password-box')).sendKeys('123456789')
await driver.findElement(By.css('button')).click() await driver.findElement(By.css('button')).click()
await delay(500) await delay(500)
}) })