mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #4251 from whymarrh/e2e-fixes
Small e2e test adjustments
This commit is contained in:
commit
6e79225dbf
@ -15,8 +15,8 @@
|
|||||||
"test:integration:build": "gulp build:scss",
|
"test:integration:build": "gulp build:scss",
|
||||||
"test:e2e:chrome": "shell-parallel -s 'npm run ganache:start' -x 'sleep 3 && npm run test:e2e:run:chrome'",
|
"test:e2e:chrome": "shell-parallel -s 'npm run ganache:start' -x 'sleep 3 && npm run test:e2e:run:chrome'",
|
||||||
"test:e2e:firefox": "shell-parallel -s 'npm run ganache:start' -x 'sleep 3 && npm run test:e2e:run:firefox'",
|
"test:e2e:firefox": "shell-parallel -s 'npm run ganache:start' -x 'sleep 3 && npm run test:e2e:run:firefox'",
|
||||||
"test:e2e:run:chrome": "SELENIUM_BROWSER=chrome mocha test/e2e/chrome/metamask.spec --recursive",
|
"test:e2e:run:chrome": "SELENIUM_BROWSER=chrome mocha test/e2e/chrome/metamask.spec --bail --recursive",
|
||||||
"test:e2e:run:firefox": "SELENIUM_BROWSER=firefox mocha test/e2e/firefox/metamask.spec --recursive",
|
"test:e2e:run:firefox": "SELENIUM_BROWSER=firefox mocha test/e2e/firefox/metamask.spec --bail --recursive",
|
||||||
"test:screens": "shell-parallel -s 'npm run ganache:start' -x 'sleep 3 && npm run test:screens:run'",
|
"test:screens": "shell-parallel -s 'npm run ganache:start' -x 'sleep 3 && npm run test:screens:run'",
|
||||||
"test:screens:run": "node test/screens/new-ui.js",
|
"test:screens:run": "node test/screens/new-ui.js",
|
||||||
"test:coverage": "nyc npm run test:unit && npm run test:coveralls-upload",
|
"test:coverage": "nyc npm run test:unit && npm run test:coveralls-upload",
|
||||||
|
@ -237,7 +237,7 @@ describe('Metamask popup page', function () {
|
|||||||
|
|
||||||
it('confirms transaction in MetaMask popup', async function () {
|
it('confirms transaction in MetaMask popup', async function () {
|
||||||
const windowHandles = await driver.getAllWindowHandles()
|
const windowHandles = await driver.getAllWindowHandles()
|
||||||
await driver.switchTo().window(windowHandles[2])
|
await driver.switchTo().window(windowHandles[windowHandles.length - 1])
|
||||||
const metamaskSubmit = await driver.findElement(By.css('#pending-tx-form > div.flex-row.flex-space-around.conf-buttons > input'))
|
const metamaskSubmit = await driver.findElement(By.css('#pending-tx-form > div.flex-row.flex-space-around.conf-buttons > input'))
|
||||||
await metamaskSubmit.click()
|
await metamaskSubmit.click()
|
||||||
await delay(1000)
|
await delay(1000)
|
||||||
@ -291,7 +291,7 @@ describe('Metamask popup page', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
async function getExtensionId () {
|
async function getExtensionId () {
|
||||||
const extension = await driver.executeScript('return document.querySelector("extensions-manager").shadowRoot.querySelector("extensions-view-manager extensions-item-list").shadowRoot.querySelector("#container > div.items-container > extensions-item:nth-child(2)").getAttribute("id")')
|
const extension = await driver.executeScript('return document.querySelector("extensions-manager").shadowRoot.querySelector("extensions-view-manager extensions-item-list").shadowRoot.querySelector("extensions-item:nth-child(2)").getAttribute("id")')
|
||||||
return extension
|
return extension
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ describe('', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('shows privacy notice', async () => {
|
it('shows privacy notice', async () => {
|
||||||
|
await delay(300)
|
||||||
const privacy = await driver.findElement(By.css('.terms-header')).getText()
|
const privacy = await driver.findElement(By.css('.terms-header')).getText()
|
||||||
assert.equal(privacy, 'PRIVACY NOTICE', 'shows privacy notice')
|
assert.equal(privacy, 'PRIVACY NOTICE', 'shows privacy notice')
|
||||||
await driver.findElement(By.css('button')).click()
|
await driver.findElement(By.css('button')).click()
|
||||||
@ -125,7 +126,7 @@ describe('', function () {
|
|||||||
it('accepts account password after lock', async () => {
|
it('accepts account password after lock', async () => {
|
||||||
await delay(500)
|
await delay(500)
|
||||||
await driver.findElement(By.id('password-box')).sendKeys('123456789')
|
await driver.findElement(By.id('password-box')).sendKeys('123456789')
|
||||||
await driver.findElement(By.css('button')).click()
|
await driver.findElement(By.id('password-box')).sendKeys(webdriver.Key.ENTER)
|
||||||
await delay(500)
|
await delay(500)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -238,7 +239,7 @@ describe('', function () {
|
|||||||
// There is an issue with blank confirmation window, but the button is still there and the driver is able to clicked (?.?)
|
// There is an issue with blank confirmation window, but the button is still there and the driver is able to clicked (?.?)
|
||||||
it('confirms transaction in MetaMask popup', async function () {
|
it('confirms transaction in MetaMask popup', async function () {
|
||||||
const windowHandles = await driver.getAllWindowHandles()
|
const windowHandles = await driver.getAllWindowHandles()
|
||||||
await driver.switchTo().window(windowHandles[2])
|
await driver.switchTo().window(windowHandles[windowHandles.length - 1])
|
||||||
const metamaskSubmit = await driver.findElement(By.css('#pending-tx-form > div.flex-row.flex-space-around.conf-buttons > input'))
|
const metamaskSubmit = await driver.findElement(By.css('#pending-tx-form > div.flex-row.flex-space-around.conf-buttons > input'))
|
||||||
await metamaskSubmit.click()
|
await metamaskSubmit.click()
|
||||||
await delay(1000)
|
await delay(1000)
|
||||||
|
Loading…
Reference in New Issue
Block a user