Disable e2e tests temporarily due to https://github.com/SeleniumHQ/selenium/issues/7485
This commit is contained in:
parent
2a29b6c49d
commit
dad12feaa8
|
@ -1,146 +1,146 @@
|
||||||
const path = require('path')
|
// const path = require('path')
|
||||||
const Func = require('./func').Functions
|
// const Func = require('./func').Functions
|
||||||
const account1 = '0x2E428ABd9313D256d64D1f69fe3929C3BE18fD1f'
|
// const account1 = '0x2E428ABd9313D256d64D1f69fe3929C3BE18fD1f'
|
||||||
const account1RSK = '0x2E428aBd9313D256d64D1f69fe3929c3Be18Fd1F'
|
// const account1RSK = '0x2E428aBd9313D256d64D1f69fe3929c3Be18Fd1F'
|
||||||
const account2 = '0xd7b7AFeCa35e32594e29504771aC847E2a803742'
|
// const account2 = '0xd7b7AFeCa35e32594e29504771aC847E2a803742'
|
||||||
const testsFolder = './test-cases'
|
// const testsFolder = './test-cases'
|
||||||
const setup = require(`${testsFolder}/setup.spec`)
|
// const setup = require(`${testsFolder}/setup.spec`)
|
||||||
const login = require(`${testsFolder}/login.spec`)
|
// const login = require(`${testsFolder}/login.spec`)
|
||||||
const { accountCreation, getCreatedAccounts } = require(`${testsFolder}/account-creation.spec`)
|
// const { accountCreation, getCreatedAccounts } = require(`${testsFolder}/account-creation.spec`)
|
||||||
const connectHDWallet = require(`${testsFolder}/connect-hd-wallet.spec`)
|
// const connectHDWallet = require(`${testsFolder}/connect-hd-wallet.spec`)
|
||||||
const importAccount = require(`${testsFolder}/import-account.spec`)
|
// const importAccount = require(`${testsFolder}/import-account.spec`)
|
||||||
const importContractAccount = require(`${testsFolder}/import-contract-account.spec`)
|
// const importContractAccount = require(`${testsFolder}/import-contract-account.spec`)
|
||||||
const deleteImportedAccount = require(`${testsFolder}/delete-imported-account.spec`)
|
// const deleteImportedAccount = require(`${testsFolder}/delete-imported-account.spec`)
|
||||||
const signData = require(`${testsFolder}/sign-data.spec`)
|
// const signData = require(`${testsFolder}/sign-data.spec`)
|
||||||
const exportPrivateKey = require(`${testsFolder}/export-private-key.spec`)
|
// const exportPrivateKey = require(`${testsFolder}/export-private-key.spec`)
|
||||||
const importGanacheSeedPhrase = require(`${testsFolder}/import-ganache-seed-phrase.spec`)
|
// const importGanacheSeedPhrase = require(`${testsFolder}/import-ganache-seed-phrase.spec`)
|
||||||
const RSKNetworkTests = require(`${testsFolder}/RSK-network-tests.js`)
|
// const RSKNetworkTests = require(`${testsFolder}/RSK-network-tests.js`)
|
||||||
const checkEmittedEvents = require(`${testsFolder}/check-emitted-events.spec`)
|
// const checkEmittedEvents = require(`${testsFolder}/check-emitted-events.spec`)
|
||||||
// const addCustomToken = require(`${testsFolder}/add-token-custom.spec`)
|
// // const addCustomToken = require(`${testsFolder}/add-token-custom.spec`)
|
||||||
const changePassword = require(`${testsFolder}/change-password.spec`)
|
// const changePassword = require(`${testsFolder}/change-password.spec`)
|
||||||
const addTokeFromSearch = require(`${testsFolder}/add-token-search.spec`)
|
// const addTokeFromSearch = require(`${testsFolder}/add-token-search.spec`)
|
||||||
const customRPC = require(`${testsFolder}/custom-rpc.spec`)
|
// const customRPC = require(`${testsFolder}/custom-rpc.spec`)
|
||||||
|
|
||||||
describe('Metamask popup page', async function () {
|
// describe('Metamask popup page', async function () {
|
||||||
|
|
||||||
this.timeout(15 * 60 * 1000)
|
// this.timeout(15 * 60 * 1000)
|
||||||
const f = new Func()
|
// const f = new Func()
|
||||||
let driver, extensionId
|
// let driver, extensionId
|
||||||
const password = '123456789'
|
// const password = '123456789'
|
||||||
const newPassword = {
|
// const newPassword = {
|
||||||
correct: 'abcDEF123!@#',
|
// correct: 'abcDEF123!@#',
|
||||||
short: '123',
|
// short: '123',
|
||||||
incorrect: '1234567890',
|
// incorrect: '1234567890',
|
||||||
}
|
// }
|
||||||
|
|
||||||
before(async function () {
|
// before(async function () {
|
||||||
if (process.env.SELENIUM_BROWSER === 'chrome') {
|
// if (process.env.SELENIUM_BROWSER === 'chrome') {
|
||||||
const extPath = path.resolve('dist/chrome')
|
// const extPath = path.resolve('dist/chrome')
|
||||||
driver = await Func.buildChromeWebDriver(extPath)
|
// driver = await Func.buildChromeWebDriver(extPath)
|
||||||
f.driver = driver
|
// f.driver = driver
|
||||||
extensionId = await f.getExtensionIdChrome()
|
// extensionId = await f.getExtensionIdChrome()
|
||||||
f.extensionId = extensionId
|
// f.extensionId = extensionId
|
||||||
await driver.get(`chrome-extension://${extensionId}/popup.html`)
|
// await driver.get(`chrome-extension://${extensionId}/popup.html`)
|
||||||
|
|
||||||
} else if (process.env.SELENIUM_BROWSER === 'firefox') {
|
// } else if (process.env.SELENIUM_BROWSER === 'firefox') {
|
||||||
const extPath = path.resolve('dist/firefox')
|
// const extPath = path.resolve('dist/firefox')
|
||||||
driver = await Func.buildFirefoxWebdriver()
|
// driver = await Func.buildFirefoxWebdriver()
|
||||||
f.driver = driver
|
// f.driver = driver
|
||||||
await f.installWebExt(extPath)
|
// await f.installWebExt(extPath)
|
||||||
await f.delay(700)
|
// await f.delay(700)
|
||||||
extensionId = await f.getExtensionIdFirefox()
|
// extensionId = await f.getExtensionIdFirefox()
|
||||||
f.extensionId = extensionId
|
// f.extensionId = extensionId
|
||||||
await driver.get(`moz-extension://${extensionId}/popup.html`)
|
// await driver.get(`moz-extension://${extensionId}/popup.html`)
|
||||||
}
|
// }
|
||||||
|
|
||||||
})
|
// })
|
||||||
|
|
||||||
afterEach(async function () {
|
// afterEach(async function () {
|
||||||
// logs command not supported in firefox
|
// // logs command not supported in firefox
|
||||||
// https://github.com/SeleniumHQ/selenium/issues/2910
|
// // https://github.com/SeleniumHQ/selenium/issues/2910
|
||||||
if (process.env.SELENIUM_BROWSER === 'chrome') {
|
// if (process.env.SELENIUM_BROWSER === 'chrome') {
|
||||||
// check for console errors
|
// // check for console errors
|
||||||
const errors = await f.checkBrowserForConsoleErrors(driver)
|
// const errors = await f.checkBrowserForConsoleErrors(driver)
|
||||||
if (errors.length) {
|
// if (errors.length) {
|
||||||
const errorReports = errors.map(err => err.message)
|
// const errorReports = errors.map(err => err.message)
|
||||||
const errorMessage = `Errors found in browser console:\n${errorReports.join('\n')}`
|
// const errorMessage = `Errors found in browser console:\n${errorReports.join('\n')}`
|
||||||
console.log(errorMessage)
|
// console.log(errorMessage)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// gather extra data if test failed
|
// // gather extra data if test failed
|
||||||
if (this.currentTest.state === 'failed') {
|
// if (this.currentTest.state === 'failed') {
|
||||||
await f.verboseReportOnFailure(this.currentTest)
|
// await f.verboseReportOnFailure(this.currentTest)
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
|
|
||||||
after(async function () {
|
// after(async function () {
|
||||||
await driver.quit()
|
// await driver.quit()
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Setup', async () => {
|
// describe('Setup', async () => {
|
||||||
await setup(f)
|
// await setup(f)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Log In', async () => {
|
// describe('Log In', async () => {
|
||||||
await login(f, password)
|
// await login(f, password)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Account Creation', async () => {
|
// describe('Account Creation', async () => {
|
||||||
await accountCreation(f, password)
|
// await accountCreation(f, password)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Connect Hardware Wallet', async () => {
|
// describe('Connect Hardware Wallet', async () => {
|
||||||
await connectHDWallet(f)
|
// await connectHDWallet(f)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Import Account', async () => {
|
// describe('Import Account', async () => {
|
||||||
await importAccount(f)
|
// await importAccount(f)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Import Contract account', async () => {
|
// describe('Import Contract account', async () => {
|
||||||
await importContractAccount(f, account1, getCreatedAccounts)
|
// await importContractAccount(f, account1, getCreatedAccounts)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Delete Imported Account', async () => {
|
// describe('Delete Imported Account', async () => {
|
||||||
await deleteImportedAccount(f)
|
// await deleteImportedAccount(f)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Sign Data', async () => {
|
// describe('Sign Data', async () => {
|
||||||
await signData(f)
|
// await signData(f)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Export private key', async () => {
|
// describe('Export private key', async () => {
|
||||||
await exportPrivateKey(f, password)
|
// await exportPrivateKey(f, password)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Import Ganache seed phrase', async () => {
|
// describe('Import Ganache seed phrase', async () => {
|
||||||
await importGanacheSeedPhrase(f, account2, password)
|
// await importGanacheSeedPhrase(f, account2, password)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('RSK network tests', async () => {
|
// describe('RSK network tests', async () => {
|
||||||
await RSKNetworkTests(f, account1RSK)
|
// await RSKNetworkTests(f, account1RSK)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Check the filter of emitted events', async () => {
|
// describe('Check the filter of emitted events', async () => {
|
||||||
await checkEmittedEvents(f, account1, account2)
|
// await checkEmittedEvents(f, account1, account2)
|
||||||
})
|
// })
|
||||||
|
|
||||||
// todo: it works locally, but doesn't work in CI
|
// // todo: it works locally, but doesn't work in CI
|
||||||
// describe('Add Token: Custom', async () => {
|
// // describe('Add Token: Custom', async () => {
|
||||||
// await addCustomToken(f, account1, account2)
|
// // await addCustomToken(f, account1, account2)
|
||||||
// })
|
// // })
|
||||||
|
|
||||||
describe('Change password', async () => {
|
// describe('Change password', async () => {
|
||||||
await changePassword(f, password, newPassword)
|
// await changePassword(f, password, newPassword)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Add Token:Search', async () => {
|
// describe('Add Token:Search', async () => {
|
||||||
await addTokeFromSearch(f)
|
// await addTokeFromSearch(f)
|
||||||
})
|
// })
|
||||||
|
|
||||||
describe('Custom RPC', async () => {
|
// describe('Custom RPC', async () => {
|
||||||
await customRPC(f)
|
// await customRPC(f)
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue